:root {
    --brand-1: #0f766e;
    --brand-2: #0d9488;
    --brand-3: #14b8a6;
    --accent: #f59e0b;
    --accent-2: #ea580c;
    --ink: #134e4a;
    --muted: #5b716e;
    --surface: #ffffff;
    --bg-1: #ecfdf5;
    --bg-2: #f0fdfa;
    --danger: #dc2626;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(15, 118, 110, 0.12);
    --font-display: "Playfair Display", Georgia, serif;
    --font-body: "Noto Sans Bengali", "Noto Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 35%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 30%),
        linear-gradient(180deg, #f8fffc 0%, #eefaf6 45%, #f7fbf9 100%);
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.store-wrap {
    width: min(1200px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.store-brand {
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
}
.store-brand h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    background: linear-gradient(120deg, var(--brand-1), var(--brand-3), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.02em;
}
.store-brand p {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}
.header-whatsapp {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 800;
    color: #0369a1;
    text-decoration: none;
    line-height: 1.45;
}
.header-whatsapp:hover {
    color: #0284c7;
    text-decoration: underline;
}

.book-card {
    margin: 1.25rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(160deg, rgba(255,255,255,0.96), rgba(240,253,250,0.95));
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 118, 110, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.book-card.is-open {
    box-shadow: 0 22px 60px rgba(13, 148, 136, 0.18);
}
.book-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 1.1rem;
    align-items: center;
}
.book-card-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
    min-width: 0;
}
.book-card-main-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 1rem;
    min-width: 0;
}
.book-cover {
    width: 140px;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: #d1fae5;
}
.book-meta {
    min-width: 0;
}
.book-meta h2 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    font-weight: 800;
    color: #dc2626;
}
.book-author {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
}
.price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}
.price-current {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--brand-1);
}
.price-mrp {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 1rem;
}
.discount-badge {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.book-short {
    color: var(--muted);
    margin: 0.35rem 0 0.75rem;
    line-height: 1.55;
}
.expand-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--brand-2);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}
.expand-hint-mobile {
    display: none;
    grid-area: expand;
    justify-self: start;
    margin-top: 0.15rem;
}
.expand-hint .chevron {
    transition: transform 0.3s ease;
}
.book-card.is-open .expand-hint .chevron {
    transform: rotate(180deg);
}

.book-body {
    display: none;
    padding: 0 1.1rem 1.2rem;
    border-top: 1px dashed rgba(15, 118, 110, 0.15);
}
.book-card.is-open .book-body {
    display: block;
    animation: fadeSlide 0.35s ease;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.book-description {
    white-space: pre-line;
    line-height: 1.8;
    color: #15803d;
    font-size: 1.2rem;
    margin: 1rem 0 0;
}
.buy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.qty-control button {
    border: 0;
    background: #f0fdfa;
    width: 38px;
    height: 42px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--brand-1);
}
.qty-control input {
    width: 52px;
    border: 0;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    height: 42px;
}
.btn-gradient {
    border: 0;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    box-shadow: 0 10px 24px rgba(13, 148, 136, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-add-cart.btn-gradient {
    background: #facc15;
    color: #111;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(250, 204, 21, 0.35);
}
.btn-gradient:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.btn-add-cart.btn-gradient:hover {
    filter: brightness(1.03);
}
.btn-gradient:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.btn-accent {
    background: #facc15;
    color: #111;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(250, 204, 21, 0.35);
}
#place-order-btn.btn-accent {
    background: #facc15;
    color: #111;
}
#place-order-btn.btn-accent:hover {
    filter: brightness(1.03);
    color: #111;
}
.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

.checkout-section {
    margin-top: 2rem;
    padding: 1.35rem;
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(165deg, #ffffff, #f0fdfa);
    border: 1px solid rgba(15, 118, 110, 0.1);
    box-shadow: var(--shadow);
    transition: box-shadow 0.4s ease, outline 0.4s ease;
}
.checkout-section.highlight {
    outline: 3px solid rgba(20, 184, 166, 0.55);
    box-shadow: 0 0 0 8px rgba(20, 184, 166, 0.15), var(--shadow);
}
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.checkout-col h2 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.7rem;
    background: linear-gradient(120deg, var(--brand-1), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.checkout-section h2 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.7rem;
    background: linear-gradient(120deg, var(--brand-1), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.form-grid {
    display: grid;
    gap: 0.9rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}
.required-star { color: var(--danger); }
.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font: inherit;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}
.form-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.25rem;
    display: none;
}

.cart-items { margin-top: 0; }
.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 118, 110, 0.1);
}
.cart-item img {
    width: 64px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
}
.cart-item-title { font-weight: 700; margin-bottom: 0.25rem; }
.cart-item-meta { color: var(--muted); font-size: 0.88rem; }
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}
.cart-item-actions .qty-control { transform: scale(0.92); transform-origin: right center; }
.btn-remove-icon {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, opacity 0.2s ease;
}
.btn-remove-icon:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.08);
}
.btn-remove-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.btn-remove-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.btn-link {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}
.place-order-wrap {
    margin-top: 1.2rem;
}
.totals {
    margin-top: 1rem;
    padding-top: 0.5rem;
}
.totals-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    color: var(--muted);
}
.totals-row.grand {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(15, 118, 110, 0.15);
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 800;
}
.empty-cart {
    text-align: center;
    color: var(--muted);
    padding: 1.25rem 0.5rem;
}
.whatsapp-help {
    margin-top: 1rem;
    text-align: center;
    line-height: 1.55;
}
.whatsapp-help a {
    display: inline-block;
    color: #0369a1;
    font-size: clamp(1.05rem, 2.6vw, 1.25rem);
    font-weight: 700;
    text-decoration: none;
}
.whatsapp-help a:hover {
    color: #0284c7;
    text-decoration: underline;
}
.whatsapp-help .wa-number {
    font-size: 1.35em;
    font-weight: 800;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%) translateY(120%);
    background: #0f766e;
    color: #fff;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    z-index: 50;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: min(90vw, 420px);
    text-align: center;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.error { background: #b91c1c; }

.success-panel {
    display: none;
    text-align: center;
    padding: 1.5rem 1rem;
}
.success-panel.active { display: block; animation: fadeSlide 0.4s ease; }
.success-panel h3 {
    font-family: var(--font-display);
    color: var(--brand-1);
    margin-bottom: 0.5rem;
}
#checkout-main.hidden,
.checkout-form-wrap.hidden,
.cart-panel.hidden { display: none; }

@media (min-width: 901px) {
    .checkout-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }
}

@media (max-width: 900px) {
    .book-card-top {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .book-card-toggle {
        order: 1;
        width: 100%;
    }
    .book-card-main-row {
        grid-template-columns: 110px minmax(0, 1fr);
    }
    .book-cover {
        width: 110px;
        height: 150px;
    }
    .book-short {
        width: 100%;
        margin: 0;
    }
    .buy-row {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: stretch;
        width: 100%;
        gap: 0.75rem;
    }
    .buy-row .qty-control {
        width: 100%;
        display: flex;
    }
    .buy-row .qty-control button {
        width: 52px;
        height: 54px;
        font-size: 1.4rem;
        flex-shrink: 0;
    }
    .buy-row .qty-control input {
        flex: 1;
        width: auto;
        min-width: 0;
        height: 54px;
        font-size: 1.2rem;
    }
    .buy-row .btn-add-cart {
        width: 100%;
        display: block;
        padding: 1rem 1.4rem;
        font-size: 1.12rem;
        text-align: center;
    }
    .expand-hint-desktop {
        display: none;
    }
    .expand-hint-mobile {
        display: inline-flex;
        order: 3;
    }
    .book-description {
        font-size: 1.28rem;
    }
    .header-whatsapp {
        font-size: 1.12rem;
        padding: 0 0.5rem;
    }
    .cart-item {
        grid-template-columns: 56px 1fr;
    }
    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

