/* Sadiq's Bookstore storefront — brand theme on Bootstrap 5.3 */
:root {
    --brand: #4b5a23;          /* olive green from the logo */
    --brand-dark: #38441a;
    --brand-light: #eef1e4;
    --accent: #ff6b00;         /* orange from the logo */
    --accent-dark: #e05e00;
    --ink: #1f2416;
    --muted: #6b7160;
    --line: #e6e8df;
    --bg-soft: #f7f8f3;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(31, 36, 22, .08);
    --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--ink);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--accent-dark);
    --bs-link-color-rgb: 75, 90, 35;
    --bs-link-hover-color-rgb: 224, 94, 0;
}
body { font-size: .95rem; background: #fff; }
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--ink); }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }
.bg-soft { background: var(--bg-soft); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: #f3a46d; --bs-btn-disabled-border-color: #f3a46d; --bs-btn-disabled-color: #fff; }
.btn-olive { --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-color: #fff; }
.btn-outline-olive { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; border: 0; }
.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.btn-icon { font-size: 1.6rem; padding: .1rem .4rem; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(75, 90, 35, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--brand-dark); color: #dfe4cf; font-size: .8rem; padding: .4rem 0; }
.topbar a { color: #fff; }
.topbar i { color: var(--accent); margin-right: .25rem; }
.site-header { background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .06); z-index: 1030; }
.header-row { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; }
.brand img { border-radius: 8px; display: block; }
.header-search { flex: 1; display: flex; max-width: 640px; margin: 0 auto; }
.header-search .form-control { border-radius: 10px 0 0 10px; border: 2px solid var(--line); border-right: 0; padding: .55rem 1rem; }
.header-search .btn { border-radius: 0 10px 10px 0; padding: .55rem 1.1rem; }
.header-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.header-action { position: relative; display: flex; align-items: center; gap: .4rem; color: var(--ink); padding: .4rem .6rem; border-radius: 10px; font-size: .9rem; }
.header-action i { font-size: 1.4rem; }
.header-action:hover { background: var(--bg-soft); color: var(--brand); }
.count-badge { position: absolute; top: 0; left: 1.6rem; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600;
    min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.count-badge[hidden] { display: none; }
.count-badge.bump { animation: bump .4s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }
.category-nav { background: var(--brand); }
.category-nav .nav-link { color: #fff; font-weight: 500; padding: .7rem 1rem; font-size: .9rem; }
.category-nav .nav-link:hover, .category-nav .nav-link.active { color: var(--accent); background: rgba(255, 255, 255, .06); }
.category-nav .dropdown-menu { border: 0; border-radius: 0 0 var(--radius) var(--radius); margin-top: 0; }
.dropdown-item:active { background: var(--brand); }
.dropdown-item i, .list-group-item i { margin-right: .4rem; color: var(--brand); }
.offcanvas .list-group-item { padding: .8rem .25rem; }

/* ---------- Hero ---------- */
.hero { margin-top: 1.25rem; }
.hero .carousel { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero .carousel-item img { width: 100%; height: auto; aspect-ratio: 2401 / 632; object-fit: cover; }
.hero .carousel-indicators [data-bs-target] { background: var(--accent); width: 24px; height: 4px; border-radius: 2px; }

/* ---------- Sections ---------- */
.section { padding: 2.5rem 0; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.25rem; gap: 1rem; }
.section-title h2 { font-size: 1.45rem; margin: 0; position: relative; padding-bottom: .5rem; }
.section-title h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; background: var(--accent); border-radius: 2px; }
.section-title a { font-weight: 500; white-space: nowrap; }

/* Category tiles */
.cat-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem;
    padding: 1.4rem .75rem; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink);
    height: 100%; transition: all .2s ease; }
.cat-tile i { font-size: 2rem; color: var(--brand); width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: all .2s ease; }
.cat-tile b { font-weight: 600; }
.cat-tile span { color: var(--muted); font-size: .8rem; }
.cat-tile:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.cat-tile:hover i { background: var(--accent); color: #fff; }

/* Product grid & cards */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
@media (min-width: 1200px) { .product-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .product-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.product-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.product-card__media img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; transition: transform .3s ease; }
.product-card:hover .product-card__media img { transform: scale(1.04); }
.product-card__body { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; flex: 1; border-top: 1px solid var(--line); }
.product-card__title { font-size: .88rem; font-weight: 500; line-height: 1.35; margin: 0 0 .6rem; min-height: 2.4em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__title a { color: var(--ink); }
.product-card__title a:hover { color: var(--brand); }
.product-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.product-card__price { font-weight: 700; color: var(--brand); font-size: 1rem; }
.product-card .btn-sm { padding: .3rem .65rem; }
.badge-stock { position: absolute; left: .6rem; top: .6rem; font-size: .7rem; font-weight: 600; padding: .2rem .5rem; border-radius: 6px; }
.badge-out { background: #6c757d; color: #fff; }
.badge-low { background: #fff3e8; color: var(--accent-dark); border: 1px solid #ffd2b0; }
.wish-btn { position: absolute; right: .55rem; top: .55rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .95); color: var(--muted); display: flex; align-items: center; justify-content: center; z-index: 2; }
.wish-btn:hover, .wish-btn.is-active { color: #e0245e; border-color: #f7c1d1; }

/* ---------- Shop page ---------- */
.page-head { background: linear-gradient(90deg, var(--brand-dark), var(--brand)); color: #fff; padding: 1.6rem 0; }
.page-head h1 { color: #fff; font-size: 1.6rem; margin: 0; }
.page-head .breadcrumb { margin: .35rem 0 0; --bs-breadcrumb-divider-color: #c9d1ae; --bs-breadcrumb-item-active-color: #dfe4cf; font-size: .85rem; }
.page-head .breadcrumb a { color: #fff; }
.filter-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: #fff; }
.filter-card h6 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .75rem; }
.filter-list a { display: flex; justify-content: space-between; padding: .4rem .6rem; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.filter-list a:hover { background: var(--bg-soft); }
.filter-list a.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.filter-list .sub a { padding-left: 1.4rem; font-size: .85rem; }
.filter-list span { color: var(--muted); font-size: .8rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.toolbar .form-select { width: auto; min-width: 190px; }
.pagination { --bs-pagination-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand);
    --bs-pagination-hover-color: var(--accent-dark); --bs-pagination-border-radius: 10px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 3rem; color: #c9cfb8; display: block; margin-bottom: .75rem; }

/* ---------- Product page ---------- */
.pdp-media { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: #fff; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.pdp-media img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s ease; }
.pdp-title { font-size: 1.6rem; margin-bottom: .5rem; }
.pdp-price { font-size: 1.8rem; font-weight: 700; color: var(--brand); }
.pdp-meta { color: var(--muted); font-size: .88rem; }
.pdp-meta a { font-weight: 500; }
.qty-stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty-stepper button { border: 0; background: var(--bg-soft); width: 38px; height: 40px; font-size: 1.1rem; color: var(--ink); }
.qty-stepper button:hover { background: var(--brand-light); }
.qty-stepper input { width: 52px; text-align: center; border: 0; height: 40px; font-weight: 600; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper.sm button { width: 30px; height: 32px; }
.qty-stepper.sm input { width: 40px; height: 32px; }
.pdp-perks { list-style: none; padding: 1rem; margin: 1.25rem 0 0; background: var(--bg-soft); border-radius: var(--radius); font-size: .88rem; }
.pdp-perks li { padding: .25rem 0; }
.pdp-perks i { color: var(--brand); margin-right: .5rem; }
.description { line-height: 1.7; }
.description table { width: 100%; }

/* ---------- Cart, checkout & account ---------- */
.card-soft { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cart-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; }
.cart-item__title { font-weight: 500; color: var(--ink); line-height: 1.3; }
.cart-item__actions { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.cart-item__total { font-weight: 700; color: var(--brand); text-align: right; white-space: nowrap; }
.link-remove { color: var(--muted); font-size: .85rem; background: none; border: 0; padding: 0; }
.link-remove:hover { color: #dc3545; }
.summary-row { display: flex; justify-content: space-between; padding: .4rem 0; }
.summary-total { font-size: 1.2rem; font-weight: 700; border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .75rem; }
.pay-option { display: block; border: 2px solid var(--line); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; margin-bottom: .6rem; }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.pay-option small { display: block; color: var(--muted); margin-left: 1.6rem; }
.auth-card { max-width: 460px; margin: 2.5rem auto; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.auth-card.wide { max-width: 640px; }
.account-nav .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: .25rem; }
.account-nav .list-group-item.active { background: var(--brand); color: #fff; }
.account-nav .list-group-item.active i { color: #fff; }
.order-card { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.order-card__head { background: var(--bg-soft); padding: .8rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; font-size: .88rem; }
.order-card__line { display: flex; gap: .8rem; align-items: center; padding: .6rem 1rem; border-top: 1px solid var(--line); }
.order-card__line img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; }
.order-steps { display: flex; gap: .4rem; font-size: .75rem; color: var(--muted); }
.order-steps span { padding: .15rem .55rem; border-radius: 20px; background: #eceee6; }
.order-steps span.done { background: var(--brand); color: #fff; }
.success-icon { font-size: 4rem; color: var(--brand); }

/* ---------- Trust strip & footer ---------- */
.trust-strip { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 1.75rem 0; margin-top: 2rem; }
.trust-item { display: flex; gap: .75rem; align-items: center; justify-content: center; }
@media (min-width: 768px) { .trust-item { justify-content: flex-start; } }
.trust-item i { font-size: 1.8rem; color: var(--accent); }
.trust-item b { display: block; font-size: .9rem; }
.trust-item span { font-size: .78rem; color: var(--muted); }
@media (max-width: 575px) { .trust-item { flex-direction: column; text-align: center; gap: .25rem; } }
.site-footer { background: #232a12; color: #d9ddcc; padding: 3rem 0 1rem; font-size: .9rem; }
.site-footer h6 { color: #fff; margin-bottom: 1rem; }
.site-footer a { color: #d9ddcc; }
.site-footer a:hover { color: var(--accent); }
.site-footer li { margin-bottom: .45rem; }
.contact-list i { color: var(--accent); margin-right: .4rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2rem; padding-top: 1rem; display: flex; flex-wrap: wrap;
    justify-content: space-between; gap: .5rem; font-size: .8rem; color: #a7ad95; }
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem; box-shadow: 0 6px 20px rgba(37, 211, 102, .45); z-index: 1040; }
.wa-float:hover { color: #fff; transform: scale(1.06); }
.toast { border: 0; border-radius: 12px; box-shadow: var(--shadow); }

/* Small screens */
@media (max-width: 991px) {
    .brand img { height: 42px; }
    .header-row { gap: .5rem; }
    .section { padding: 1.75rem 0; }
}
@media (max-width: 575px) {
    .product-card__body { padding: .6rem; }
    .product-card__title { font-size: .82rem; }
    .product-card__price { font-size: .92rem; }
    .cart-item { grid-template-columns: 60px 1fr; }
    .cart-item img { width: 60px; height: 60px; }
    .cart-item__total { grid-column: 2; text-align: left; }
    .page-head h1 { font-size: 1.3rem; }
}

/* Phone polish */
@media (max-width: 575px) {
    .hero { margin-top: .75rem; }
    .hero .carousel-indicators, .hero .carousel-control-prev, .hero .carousel-control-next { display: none; }
    .cat-tile { padding: .9rem .4rem; gap: .3rem; }
    .cat-tile i { width: 46px; height: 46px; font-size: 1.4rem; }
    .cat-tile b { font-size: .78rem; line-height: 1.2; }
    .cat-tile span { font-size: .7rem; }
    .section-title h2 { font-size: 1.2rem; }
}
