/* =====================================================================
   Begun Online — storefront stylesheet
   Design matches the reference screenshots: cream/off-white background,
   black top utility bar, clean white nav, orange "Sale"/discount accents,
   card-based product grids, dark navy footer.
   ===================================================================== */

:root {
    --bgn-bg: #faf8f5;
    --bgn-cream: #f3ede3;
    --bgn-ink: #1a1a1a;
    --bgn-navy: #101828;
    --bgn-orange: #e8590c;
    --bgn-orange-dark: #c94a09;
    --bgn-red: #e11d2e;
    --bgn-star: #f5a524;
    --bgn-border: #e7e2d8;
    --bgn-muted: #767268;
    --bgn-white: #ffffff;
    --bgn-radius: 10px;
    --bgn-shadow: 0 2px 14px rgba(20, 16, 8, 0.06);
    --bgn-shadow-lg: 0 10px 30px rgba(20, 16, 8, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', -apple-system, sans-serif;
    background: var(--bgn-bg);
    color: var(--bgn-ink);
    font-size: 15px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top utility bar ---------- */
.topbar {
    background: var(--bgn-ink);
    color: #eee;
    font-size: 12.5px;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar span { display: flex; align-items: center; gap: 6px; opacity: .92; }

/* ---------- Main nav ---------- */
.navbar {
    background: var(--bgn-white);
    border-bottom: 1px solid var(--bgn-border);
    position: sticky;
    top: 0;
    z-index: 500;
}
.navbar .container {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.brand { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand .brand-main { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.brand .brand-main span { color: var(--bgn-orange); }
.brand .brand-sub { font-size: 9.5px; letter-spacing: 2.5px; color: var(--bgn-muted); font-weight: 600; }

.nav-links { display: flex; gap: 22px; font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--bgn-orange); }
.nav-links .sale { color: var(--bgn-red); font-weight: 700; }

.nav-search { flex: 1; max-width: 420px; position: relative; }
.nav-search input {
    width: 100%;
    padding: 10px 42px 10px 16px;
    border-radius: 24px;
    border: 1px solid var(--bgn-border);
    background: var(--bgn-cream);
    font-size: 13.5px;
}
.nav-search button {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: var(--bgn-ink); color: #fff; display: flex; align-items: center; justify-content: center;
}

.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-icon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--bgn-ink); }
.nav-icon svg { width: 21px; height: 21px; }
.nav-icon .badge {
    position: absolute; top: -6px; right: -10px;
    background: var(--bgn-orange); color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 50%; width: 17px; height: 17px; display: flex; align-items: center; justify-content: center;
}

.mobile-menu-btn { display: none; background: none; border: none; font-size: 22px; }

/* ---------- Hero ---------- */
.hero {
    background: var(--bgn-cream);
    border-radius: var(--bgn-radius);
    margin: 24px auto;
    overflow: hidden;
    position: relative;
}
.hero-inner {
    display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px;
    padding: 48px 56px;
}
.hero-text h1 { font-size: 40px; line-height: 1.1; margin: 6px 0 14px; font-weight: 800; }
.hero-text .eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--bgn-ink); }
.hero-text p { color: var(--bgn-muted); margin: 0 0 22px; font-size: 15px; }
.hero-text img.hero-photo { border-radius: var(--bgn-radius); width: 100%; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bgn-ink); color: #fff; border: none;
    padding: 13px 26px; border-radius: 6px; font-weight: 600; font-size: 14px;
    transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #000; transform: translateY(-1px); }
.btn-orange { background: var(--bgn-orange); }
.btn-orange:hover { background: var(--bgn-orange-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--bgn-ink); color: var(--bgn-ink); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Sections ---------- */
.section { margin: 40px auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.section-head a { font-size: 13.5px; color: var(--bgn-orange); font-weight: 600; }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat-card { text-align: center; }
.cat-card .cat-img {
    aspect-ratio: 1/1; border-radius: var(--bgn-radius); overflow: hidden;
    background: var(--bgn-cream); margin-bottom: 10px; box-shadow: var(--bgn-shadow);
}
.cat-card .cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.cat-card:hover .cat-img img { transform: scale(1.06); }
.cat-card .cat-name { font-size: 13.5px; font-weight: 600; }

/* ---------- Product grid / cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.product-card {
    background: var(--bgn-white); border-radius: var(--bgn-radius); border: 1px solid var(--bgn-border);
    overflow: hidden; position: relative; transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--bgn-shadow-lg); transform: translateY(-2px); }
.product-card .thumb-wrap {
    aspect-ratio: 1/1; background: var(--bgn-cream); position: relative; overflow: hidden;
}
.product-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .discount-badge {
    position: absolute; top: 10px; left: 10px; background: var(--bgn-orange); color: #fff;
    font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.product-card .wish-btn {
    position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
    background: #fff; border: 1px solid var(--bgn-border); display: flex; align-items: center; justify-content: center;
}
.product-card .wish-btn.active { color: var(--bgn-red); border-color: var(--bgn-red); }
.product-card .body { padding: 12px 14px 16px; }
.product-card .cat-tag { font-size: 11px; color: var(--bgn-muted); text-transform: uppercase; letter-spacing: .5px; }
.product-card .name { font-size: 14px; font-weight: 600; margin: 4px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.product-card .price { font-size: 16px; font-weight: 700; }
.product-card .mrp { font-size: 12.5px; color: var(--bgn-muted); text-decoration: line-through; }
.stars { color: var(--bgn-star); font-size: 12.5px; }
.stars .count { color: var(--bgn-muted); margin-left: 4px; }

/* ---------- Layout: sidebar + main (shop page) ---------- */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: start; }
.filter-box { background: var(--bgn-white); border: 1px solid var(--bgn-border); border-radius: var(--bgn-radius); padding: 18px; }
.filter-box h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px; color: var(--bgn-muted); }
.filter-box .cat-list li { margin-bottom: 8px; }
.filter-box .cat-list a { font-size: 14px; display: flex; justify-content: space-between; }
.filter-box .cat-list a.active, .filter-box .cat-list a:hover { color: var(--bgn-orange); font-weight: 600; }

/* ---------- Sidebar widgets (home page) ---------- */
.home-layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: flex-start; }
.side-widgets { display: flex; flex-direction: column; gap: 16px; }
.widget-card { background: var(--bgn-white); border: 1px solid var(--bgn-border); border-radius: var(--bgn-radius); padding: 18px; }
.widget-card h4 { font-size: 13px; margin: 0 0 12px; font-weight: 700; }
.service-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; text-align: center; }
.service-grid .svc { font-size: 11px; }
.service-grid .svc .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--bgn-cream); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 18px; }
.promo-banner { background: var(--bgn-navy); color: #fff; border-radius: var(--bgn-radius); padding: 20px; }
.promo-banner h4 { margin: 0 0 4px; font-size: 15px; }
.promo-banner p { margin: 0 0 12px; font-size: 12.5px; color: #b8bfce; }
.mini-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bgn-border); font-size: 12.5px; }
.mini-list li:last-child { border: none; }
.mini-list img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bgn-cream); }
.mini-list .mini-price { margin-left: auto; font-weight: 700; }

/* ---------- Perks strip ---------- */
.perks { background: #fbe9e2; border-radius: var(--bgn-radius); margin: 34px auto; padding: 22px 30px; }
.perks .container { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; padding: 0; }
.perk { display: flex; align-items: center; gap: 12px; }
.perk .ic { font-size: 22px; color: var(--bgn-red); }
.perk strong { display: block; font-size: 13.5px; color: var(--bgn-red); }
.perk span { font-size: 11.5px; color: var(--bgn-muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bgn-ink); color: #cfcac0; margin-top: 60px; padding: 46px 0 0; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) 1.2fr; gap: 24px; padding-bottom: 30px; }
.footer-grid h4 { color: #fff; font-size: 13.5px; margin: 0 0 14px; }
.footer-grid li { margin-bottom: 9px; opacity: .85; }
.footer-grid li:hover { opacity: 1; color: var(--bgn-orange); }
.footer-newsletter input { width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid #333; background: #1f1f1f; color: #fff; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid #2a2a2a; padding: 16px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8b8880; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 30px; height: 30px; border-radius: 50%; background: #232323; display: flex; align-items: center; justify-content: center; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 12.5px; color: var(--bgn-muted); margin: 18px auto; }
.breadcrumb a:hover { color: var(--bgn-orange); }

/* ---------- Product detail page ---------- */
.pdp { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 26px; margin: 10px auto 40px; align-items: flex-start; }
.pdp-thumbs { display: flex; flex-direction: column; gap: 10px; }
.pdp-thumbs .thumb { border: 1.5px solid var(--bgn-border); border-radius: 8px; overflow: hidden; aspect-ratio: 1/1; cursor: pointer; }
.pdp-thumbs .thumb.active { border-color: var(--bgn-orange); }
.pdp-main-img { background: var(--bgn-cream); border-radius: var(--bgn-radius); aspect-ratio: 1/1; overflow: hidden; position: relative; }
.pdp-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info h1 { font-size: 22px; margin: 0 0 8px; }
.pdp-info .rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.pdp-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pdp-price-row .price { font-size: 26px; font-weight: 800; }
.pdp-price-row .mrp { font-size: 15px; color: var(--bgn-muted); text-decoration: line-through; }
.pdp-price-row .off { color: var(--bgn-orange); font-weight: 700; font-size: 13.5px; }
.pdp-swatches { display: flex; gap: 10px; margin-bottom: 18px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--bgn-border); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--bgn-orange); }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty-box { display: flex; align-items: center; border: 1px solid var(--bgn-border); border-radius: 6px; }
.qty-box button { width: 34px; height: 34px; border: none; background: none; font-size: 16px; }
.qty-box input { width: 40px; text-align: center; border: none; font-size: 14px; }
.pdp-actions { display: flex; gap: 12px; margin-bottom: 22px; }
.pdp-meta-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.pdp-meta-table td { padding: 9px 10px; border-bottom: 1px solid var(--bgn-border); }
.pdp-meta-table td:first-child { color: var(--bgn-muted); width: 45%; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--bgn-border); margin: 34px auto 20px; }
.tabs button { background: none; border: none; padding: 12px 2px; font-weight: 600; color: var(--bgn-muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--bgn-orange); border-color: var(--bgn-orange); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.review-item { border-bottom: 1px solid var(--bgn-border); padding: 14px 0; }
.review-item .rname { font-weight: 700; font-size: 13.5px; }

/* ---------- Cart & checkout ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; margin: 20px auto 50px; }
.cart-row { display: grid; grid-template-columns: 80px 1fr auto auto auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--bgn-border); }
.cart-row img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background: var(--bgn-cream); }
.cart-row .rm-btn { color: var(--bgn-red); font-size: 12px; background: none; border: none; }
.summary-card { background: var(--bgn-white); border: 1px solid var(--bgn-border); border-radius: var(--bgn-radius); padding: 22px; position: sticky; top: 90px; }
.summary-card h3 { margin: 0 0 16px; font-size: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; }
.summary-row.total { font-weight: 800; font-size: 16px; border-top: 1px solid var(--bgn-border); margin-top: 8px; padding-top: 12px; }
.coupon-box { display: flex; gap: 8px; margin: 14px 0; }
.coupon-box input { flex: 1; padding: 10px 12px; border: 1px solid var(--bgn-border); border-radius: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1/-1; }
.field label { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; display: block; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--bgn-border); border-radius: 6px; font-size: 14px; font-family: inherit;
}
.pay-methods { display: flex; gap: 12px; margin: 16px 0; }
.pay-method { flex: 1; border: 1.5px solid var(--bgn-border); border-radius: 8px; padding: 14px; text-align: center; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.pay-method.active { border-color: var(--bgn-orange); color: var(--bgn-orange); background: #fff6f0; }

/* ---------- Account / OTP modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,12,8,.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; padding: 30px; width: 380px; max-width: 92vw; position: relative; }
.modal-box .close-x { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 18px; color: var(--bgn-muted); }
.modal-box h3 { margin: 0 0 6px; font-size: 19px; }
.modal-box p.sub { color: var(--bgn-muted); font-size: 13px; margin: 0 0 20px; }
.otp-inputs { display: flex; gap: 8px; margin-bottom: 16px; }
.otp-inputs input { width: 40px; height: 44px; text-align: center; font-size: 18px; border: 1px solid var(--bgn-border); border-radius: 6px; }

/* ---------- Toast ---------- */
.bgn-toast { position: fixed; top: 20px; right: 20px; z-index: 9999; padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 13.5px; box-shadow: var(--bgn-shadow-lg); max-width: 320px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--bgn-muted); }
.empty-state .ic { font-size: 40px; margin-bottom: 10px; }

/* ---------- Account page ---------- */
.account-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.account-tabs button { padding: 10px 18px; border-radius: 24px; border: 1px solid var(--bgn-border); background: #fff; font-weight: 600; font-size: 13px; }
.account-tabs button.active { background: var(--bgn-ink); color: #fff; border-color: var(--bgn-ink); }
.order-card { background: #fff; border: 1px solid var(--bgn-border); border-radius: var(--bgn-radius); padding: 18px; margin-bottom: 14px; }
.order-card .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.status-pill { padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.status-placed, .status-confirmed { background: #fef3c7; color: #92400e; }
.status-packed, .status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled, .status-returned { background: #fee2e2; color: #991b1b; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; padding: 32px; text-align: center; }
    .home-layout { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: repeat(3,1fr); }
    .product-grid, .product-grid.cols-6 { grid-template-columns: repeat(2,1fr); }
    .shop-layout { grid-template-columns: 1fr; }
    .cart-layout { grid-template-columns: 1fr; }
    .pdp { grid-template-columns: 1fr; }
    .pdp-thumbs { flex-direction: row; order: 2; }
    .footer-grid { grid-template-columns: repeat(2,1fr); }
    .nav-links, .nav-search { display: none; }
    .mobile-menu-btn { display: block; }
    .perks .container { grid-template-columns: repeat(2,1fr); }
}

/* Phones: with nav-search/nav-links already hidden above, the remaining
   navbar row (logo + wishlist/account/cart + hamburger) still doesn't
   fit under ~420px wide — it was forcing the whole page into horizontal
   scroll, cutting off content on the left. Drop the icon text labels
   and tighten the gaps so the row actually fits. */
@media (max-width: 480px) {
    .navbar .container { gap: 10px; padding-left: 16px; padding-right: 16px; }
    .nav-actions { gap: 12px; }
    .nav-icon-label { display: none; }
    .brand .brand-sub { display: none; }
    .brand .brand-main { font-size: 19px; }
}
