/* ===== Afiyat Store BD - Complete Stylesheet =====
   Two verticals share one brand:
   - Islamic travel (Hajj & Umrah)  → emerald + gold, geometric star pattern
   - Organic FMCG                   → emerald + leaf green, warm cream
*/

:root {
    --af-emerald: #0d4d3a;
    --af-emerald-700: #0a3d2e;
    --af-emerald-900: #062a20;
    --af-gold: #b88a3e;
    --af-gold-600: #9a7130;
    --af-gold-soft: #f6eedf;
    --af-leaf: #3f7d2c;
    --af-leaf-600: #33671f;
    --af-leaf-soft: #ecf4e5;
    --af-cream: #fbf8f1;
    --af-ink: #18231f;
    --af-muted: #66726b;
    --af-line: #e8e2d4;
    --af-sale: #c2412d;
    --af-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    /* 8-point star (Rub el Hizb) tile used on travel surfaces */
    --af-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10'%3E%3Crect x='17' y='17' width='22' height='22'/%3E%3Crect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='4'/%3E%3C/g%3E%3C/svg%3E");

    --primary: var(--af-emerald);
    --primary-dark: var(--af-emerald-700);
    --secondary: #6c757d;
    --success: #2f7d43;
    --text-dark: var(--af-ink);
    --text-muted: var(--af-muted);
    --border: var(--af-line);
    --bg-light: var(--af-cream);
    --shadow: 0 4px 20px rgba(6,42,32,0.07);
    --shadow-hover: 0 10px 32px rgba(6,42,32,0.14);
    --radius: 14px;
    --radius-sm: 8px;
}

/* Map Bootstrap's "primary" to the Afiyat emerald */
:root {
    --bs-primary: #0d4d3a;
    --bs-primary-rgb: 13, 77, 58;
    --bs-link-color: #0d4d3a;
    --bs-link-color-rgb: 13, 77, 58;
    --bs-link-hover-color: #0a3d2e;
    --bs-link-hover-color-rgb: 10, 61, 46;
}
.btn-primary {
    --bs-btn-bg: #0d4d3a; --bs-btn-border-color: #0d4d3a;
    --bs-btn-hover-bg: #0a3d2e; --bs-btn-hover-border-color: #0a3d2e;
    --bs-btn-active-bg: #062a20; --bs-btn-active-border-color: #062a20;
    --bs-btn-disabled-bg: #0d4d3a; --bs-btn-disabled-border-color: #0d4d3a;
    --bs-btn-focus-shadow-rgb: 13, 77, 58;
}
.btn-outline-primary {
    --bs-btn-color: #0d4d3a; --bs-btn-border-color: #0d4d3a;
    --bs-btn-hover-bg: #0d4d3a; --bs-btn-hover-border-color: #0d4d3a; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #0a3d2e; --bs-btn-active-border-color: #0a3d2e;
}
.form-control:focus, .form-select:focus { border-color: #6f9d8b; box-shadow: 0 0 0 .2rem rgba(13,77,58,.16); }

/* Brand logo (inline SVG emblem + wordmark — see Views/Shared/_BrandLogo.cshtml) */
.brand-logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; line-height: 1; color: var(--af-emerald); }
.brand-logo:hover { color: var(--af-emerald-700); }
.brand-logo svg { width: 44px; height: 44px; flex: 0 0 auto; }
.brand-logo .bl-name { display: block; font-family: var(--af-display); font-weight: 600; font-size: 1.45rem; letter-spacing: -.01em; }
.brand-logo .bl-sub { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--af-gold-600); margin-top: 3px; }
.brand-logo.on-dark { color: #fff; }
.brand-logo.on-dark .bl-sub { color: #e2c48c; }
.brand-logo .bl-sub { white-space: nowrap; }
@media (max-width: 576px) { .brand-logo svg { width: 36px; height: 36px; } .brand-logo .bl-name { font-size: 1.2rem; } .brand-logo .bl-sub { font-size: .52rem; letter-spacing: .1em; } }

body {
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: #ffffff;
}
a { transition: color 0.2s; }
img.object-fit-cover { object-fit: cover; }

/* Navbar */
.navbar { transition: box-shadow 0.3s, background 0.3s; padding: 12px 0; }
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.1); background: rgba(255,255,255,0.97)!important; backdrop-filter: blur(10px); }
.navbar-brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.nav-link { font-weight: 500; color: var(--text-dark)!important; padding: 6px 14px!important; border-radius: 8px; }
.nav-link:hover { background: var(--bg-light); }

/* Hero */
.hero-section, .hero-section .carousel-item { min-height: 520px; }

/* Category Cards */
.category-card { border-radius: var(--radius); overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; text-decoration: none; display: block; }
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.category-card img, .product-card .card-img-top { transition: transform 0.4s ease; }
.category-card:hover img { transform: scale(1.06); }

/* Product Card */
.product-card { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; background: #fff; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: transparent; }
.product-card .card-img-wrapper { position: relative; overflow: hidden; aspect-ratio: 1; background: var(--bg-light); }
.product-card .card-img-top { width: 100%; height: 100%; object-fit: cover; }
.product-card:hover .card-img-top { transform: scale(1.07); }

/* Card Overlay */
.card-overlay { position: absolute; bottom: -60px; left: 0; right: 0; display: flex; gap: 6px; padding: 12px; transition: bottom 0.25s ease; background: linear-gradient(to top, rgba(0,0,0,0.4), transparent); }
.product-card:hover .card-overlay { bottom: 0; }
.card-overlay .btn { font-size: 0.8rem; flex: 1; border-radius: 8px; }

/* Wishlist */
.btn-wishlist { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 1; }
.btn-wishlist:hover, .btn-wishlist.active { background: #ff4d6d; color: white; }
.btn-wishlist:hover { transform: scale(1.1); }

/* Badges */
.badge-sale, .badge-new { position: absolute; top: 10px; left: 10px; font-size: 0.7rem; font-weight: 700; border-radius: 6px; padding: 3px 8px; text-transform: uppercase; letter-spacing: 0.5px; z-index: 1; }
.badge-sale { background: #ff4d6d; color: white; }
.badge-new { background: #00c853; color: white; }

.stars { color: #ffc107; font-size: 0.85rem; }
.price-current { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.price-compare { font-size: 0.85rem; text-decoration: line-through; color: var(--text-muted); }

/* Product Detail */
.product-gallery .main-image { border-radius: var(--radius); overflow: hidden; background: var(--bg-light); aspect-ratio: 1; }
.product-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.product-gallery .thumb.active, .product-gallery .thumb:hover { border-color: var(--primary); }
.product-gallery .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Variants */
.variant-option { min-width: 44px; padding: 6px 14px; border: 2px solid var(--border); border-radius: 8px; background: white; font-size: 0.875rem; cursor: pointer; transition: all 0.15s; font-weight: 500; }
.variant-option:hover { border-color: var(--primary); color: var(--primary); }
.variant-option.active { border-color: var(--primary); background: var(--primary); color: white; }
.variant-option.color-swatch { width: 34px; height: 34px; min-width: unset; padding: 0; border-radius: 50%; }
.variant-option.color-swatch.active { box-shadow: 0 0 0 3px var(--primary); }

/* Qty */
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-control button { width: 38px; height: 42px; border: none; background: var(--bg-light); font-size: 1.1rem; cursor: pointer; transition: background 0.15s; }
.qty-control button:hover { background: #e9ecef; }
.qty-input { width: 52px; height: 42px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-weight: 600; }

/* Checkout */
.checkout-steps { gap: 0; }
.step { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-muted); }
.step.active { color: var(--primary); }
.step span { width: 28px; height: 28px; background: var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.step.active span { background: var(--primary); color: white; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 12px; max-width: 80px; }
.shipping-option { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.2s; }
.shipping-option.selected { border-color: var(--primary); background: #eef6ef; }

/* Filter */
.filter-section { border-bottom: 1px solid var(--border); padding: 16px 0; }
.filter-section:last-child { border-bottom: none; }
.color-filter-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.15s; display: inline-block; }
.color-filter-swatch:hover { transform: scale(1.15); }
.color-filter-swatch.active { border-color: var(--text-dark); box-shadow: 0 0 0 2px white inset; }

/* Admin Sidebar */
.admin-sidebar { width: 260px; min-height: 100vh; background: #1a1a2e; position: fixed; top: 0; left: 0; z-index: 100; overflow-y: auto; transition: transform 0.3s; }
.admin-sidebar .brand { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.admin-sidebar .brand h4 { color: white; margin: 0; font-weight: 800; }
.sidebar-nav { padding: 12px 0; }
.sidebar-nav .nav-link { color: rgba(255,255,255,0.65)!important; padding: 10px 24px!important; border-radius: 0; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; transition: background 0.15s, color 0.15s; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active { background: rgba(255,255,255,0.1); color: white!important; }
.sidebar-nav .nav-link i { font-size: 1rem; opacity: 0.8; }
.sidebar-nav .nav-link.active i { opacity: 1; }
.sidebar-section-label { padding: 10px 24px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.3); font-weight: 600; }
.admin-main { margin-left: 260px; min-height: 100vh; background: var(--bg-light); }
.admin-topbar { background: white; border-bottom: 1px solid var(--border); padding: 12px 28px; position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 28px; }

/* Stat Cards */
.stat-card { border-radius: var(--radius); border: none; padding: 24px; background: white; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* Admin table */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: var(--text-muted); }

/* ── Minimal / editorial product card (Home, Product Detail) ───────── */
.pc-min { display: flex; flex-direction: column; position: relative; background: #fff; border: 1px solid var(--af-line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.pc-min:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.pc-min-img { position: relative; aspect-ratio: 1 / 1; background: var(--af-cream); overflow: hidden; }
.pc-min-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.pc-min:hover .pc-min-img img { transform: scale(1.04); }
.pc-min-badge {
    position: absolute; top: 10px; right: 10px; background: var(--af-sale); color: #fff; border-radius: 999px;
    font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; text-transform: uppercase;
}
.pc-min-badge-muted { background: #6b6b70; }
.pc-min-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.pc-min-title { font-size: .92rem; font-weight: 600; margin: 4px 0 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pc-min-title a { color: var(--af-ink); text-decoration: none; }
.pc-min-title a:hover { color: var(--af-emerald); }
.pc-min-meta { font-size: .74rem; color: var(--af-muted); margin: 3px 0 0; }
.pc-min-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.pc-min-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc-min-price-now { font-weight: 700; font-size: 1rem; color: var(--af-ink); }
.pc-min-price-was { font-size: .8rem; color: var(--af-muted); }
.pc-min-price-off { font-size: .74rem; font-weight: 700; color: var(--af-sale); }
.pc-min-addbtn-form { margin: 0; position: relative; z-index: 2; }
.pc-min-addbtn {
    height: 36px; padding: 0 12px; border: 1.5px solid var(--af-emerald); border-radius: 999px; background: #fff; color: var(--af-emerald);
    display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap;
    transition: background .15s, color .15s;
}
.pc-min-addbtn:hover, .pc-min-addbtn:focus-visible { background: var(--af-emerald); color: #fff; }
.pc-min-addbtn.is-loading { opacity: .6; pointer-events: none; }
.pc-min.v-travel .pc-min-addbtn { border-color: var(--af-gold-600); color: var(--af-gold-600); }
.pc-min.v-travel .pc-min-addbtn:hover { background: var(--af-gold-600); color: #fff; }

/* Vertical chip ("Hajj & Umrah" / "Organic") — cards, PDP, cart */
.af-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.af-chip.v-travel { background: var(--af-gold-soft); color: var(--af-gold-600); }
.af-chip.v-organic { background: var(--af-leaf-soft); color: var(--af-leaf-600); }
.pc-min-img .af-chip { position: absolute; top: 10px; left: 10px; z-index: 1; }

/* ===== Header ===== */
.af-topbar { background: var(--af-emerald-900); color: rgba(255,255,255,.85); font-size: .8rem; }
.af-topbar a { color: inherit; text-decoration: none; }
.af-topbar a:hover { color: #fff; }
.af-topbar .af-topbar-msg strong { color: #e2c48c; font-weight: 600; }
.site-header .af-search .form-control { border-radius: 999px 0 0 999px; border-color: var(--af-line); padding-left: 1.1rem; background: var(--af-cream); }
.site-header .af-search .btn { border-radius: 0 999px 999px 0; padding: 0 1.1rem; }
.af-icon-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; color: var(--af-ink); text-decoration: none; font-size: .7rem; font-weight: 500; background: none; border: 0; padding: 0; }
.af-icon-btn i { font-size: 1.3rem; line-height: 1; }
.af-icon-btn:hover { color: var(--af-emerald); }
.af-icon-btn .cart-count { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; font-size: .66rem; display: inline-flex; align-items: center; justify-content: center; background: var(--af-gold) !important; }
@media (max-width: 767.98px) { .af-icon-btn span.af-icon-label { display: none; } }

.af-mainnav .nav-link { font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem; }
.af-mainnav .nav-link.active { color: var(--af-emerald) !important; }
.af-mainnav .af-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.af-mainnav .v-travel .af-dot { background: var(--af-gold); }
.af-mainnav .v-organic .af-dot { background: var(--af-leaf); }
.af-mega { min-width: 280px; padding: .75rem; border: 1px solid var(--af-line); border-radius: var(--radius); box-shadow: var(--shadow-hover); }
.af-mega .af-mega-head { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem .8rem; border-bottom: 1px solid var(--af-line); margin-bottom: .4rem; }
.af-mega .af-mega-head i { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.af-mega.v-travel .af-mega-head i { background: var(--af-gold-soft); color: var(--af-gold-600); }
.af-mega.v-organic .af-mega-head i { background: var(--af-leaf-soft); color: var(--af-leaf-600); }
.af-mega .af-mega-head strong { display: block; font-size: .95rem; }
.af-mega .af-mega-head small { color: var(--af-muted); font-size: .75rem; }
.af-mega .dropdown-item { border-radius: 8px; font-size: .9rem; padding: .45rem .7rem; }
.af-mega .dropdown-item:active { background: var(--af-emerald); }

/* Shop-page range switcher */
.af-vertical-switch { display: flex; gap: .5rem; flex-wrap: wrap; }
.af-vertical-switch a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--af-line); color: var(--af-ink); text-decoration: none; font-weight: 600; font-size: .88rem; background: #fff; }
.af-vertical-switch a:hover { border-color: var(--af-emerald); }
.af-vertical-switch a.active { background: var(--af-emerald); border-color: var(--af-emerald); color: #fff; }
.af-vertical-switch a.v-travel.active { background: var(--af-gold-600); border-color: var(--af-gold-600); }
.af-vertical-switch a.v-organic.active { background: var(--af-leaf-600); border-color: var(--af-leaf-600); }

/* ===== Mini-cart drawer ===== */
.af-minicart { --bs-offcanvas-width: 420px; }
.af-minicart .offcanvas-header { border-bottom: 1px solid var(--af-line); }
.af-minicart .offcanvas-title { font-family: var(--af-display); font-weight: 600; }
.af-minicart .offcanvas-body { padding: 0; display: flex; flex-direction: column; }
.mc-wrap { display: flex; flex-direction: column; min-height: 100%; }
.mc-ship { padding: 14px 20px; background: var(--af-cream); border-bottom: 1px solid var(--af-line); font-size: .84rem; }
.mc-ship .progress { height: 6px; background: #e9e3d3; margin-top: 8px; }
.mc-ship .progress-bar { background: var(--af-emerald); }
.mc-items { padding: 6px 20px; flex: 1; }
.mc-group-title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 14px 0 4px; display: flex; align-items: center; gap: 6px; }
.mc-group-title.v-travel { color: var(--af-gold-600); }
.mc-group-title.v-organic { color: var(--af-leaf-600); }
.mc-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--af-line); }
.mc-item:last-child { border-bottom: 0; }
.mc-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--af-cream); flex: 0 0 auto; }
.mc-item-name { font-weight: 600; font-size: .88rem; color: var(--af-ink); text-decoration: none; line-height: 1.3; display: block; }
.mc-item-var { font-size: .76rem; color: var(--af-muted); }
.mc-qty { display: inline-flex; align-items: center; border: 1px solid var(--af-line); border-radius: 999px; height: 30px; }
.mc-qty button { width: 28px; height: 100%; border: 0; background: none; font-weight: 600; color: var(--af-ink); }
.mc-qty span { min-width: 22px; text-align: center; font-size: .85rem; font-weight: 600; }
.mc-remove { border: 0; background: none; color: var(--af-muted); font-size: .78rem; padding: 0; text-decoration: underline; }
.mc-remove:hover { color: var(--af-sale); }
.mc-xsell { margin: 6px 20px 14px; padding: 12px 14px; border-radius: 12px; display: flex; gap: 10px; align-items: center; text-decoration: none; font-size: .84rem; }
.mc-xsell.v-travel { background: var(--af-gold-soft); color: var(--af-gold-600); }
.mc-xsell.v-organic { background: var(--af-leaf-soft); color: var(--af-leaf-600); }
.mc-xsell i { font-size: 1.3rem; }
.mc-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--af-line); padding: 16px 20px 20px; }
.mc-empty { text-align: center; padding: 3rem 1.5rem; color: var(--af-muted); }
.mc-empty i { font-size: 2.6rem; color: var(--af-line); display: block; margin-bottom: .75rem; }
.mc-loading { padding: 3rem; text-align: center; color: var(--af-muted); }

/* Toasts */
.af-toast { background: var(--af-emerald-900); color: #fff; border-radius: 12px; box-shadow: var(--shadow-hover); min-width: 280px; }
.af-toast.is-error { background: var(--af-sale); }

/* Trust Badges */
.trust-badge { display: flex; align-items: center; gap: 8px; }
.trust-badge i { font-size: 1.4rem; color: var(--primary); }

/* Footer */
footer { background: var(--af-emerald-900); }
footer.af-footer { background: var(--af-emerald-900) var(--af-pattern); }
footer h3 { color: #e2c48c; letter-spacing: .08em; }
footer a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
footer a:hover { color: white; }
footer h6 { color: white; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }

/* Pagination */
.pagination .page-item .page-link { border-radius: 8px!important; margin: 0 2px; border: 1px solid var(--border); color: var(--text-dark); font-weight: 500; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.pagination .page-item .page-link:hover { background: var(--bg-light); }

/* Utils */
.cursor-pointer { cursor: pointer; }
.object-fit-cover { object-fit: cover; }

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-260px); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}
@media (max-width: 768px) {
    .hero-section, .hero-section .carousel-item { min-height: 320px; }
}
