/* =================================================================
   MyApp Storefront — Stylesheet
   Mobile-first. Bootstrap 5 utility classes carry most layout work;
   this file is the brand layer (colors, cards, transitions, header).
================================================================= */

:root {
    --primary:    #2d277c;   /* mirrors admin primary */
    --secondary:  #973081;
    --accent:     #ff9f00;
    --success:    #16a34a;
    --danger:     #dc2626;
    --ink:        #111827;
    --ink-soft:   #4b5563;
    --line:       #e5e7eb;
    --bg:         #f3f4f6;
    --bg-soft:    #fafafa;
    --radius:     10px;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.04);
    --shadow:     0 4px 16px rgba(0,0,0,.06);
    --shadow-lg:  0 8px 28px rgba(0,0,0,.10);
}

* { box-sizing: border-box; }
html, body { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    padding-bottom: 60px; /* room for mobile bottom-nav */
}

@media (min-width: 768px) {
    body { padding-bottom: 0; }
}

a { color: inherit; }

/* =================================================================
   TOP STRIP (announcement bar)
================================================================= */
.top-strip {
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    padding: 6px 0;
    text-align: center;
}
.top-strip a { color: var(--accent); text-decoration: none; }

/* =================================================================
   STICKY HEADER
================================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: var(--shadow);
}

.site-brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.3px;
    color: #fff !important;
    text-decoration: none;
}

.site-brand .bi { color: var(--accent); }

/* Search */
.search-wrap { position: relative; flex: 1; }

.search-input {
    border: 0 !important;
    height: 42px;
    border-radius: 8px !important;
    padding-right: 48px !important;
    font-size: 14.5px;
}
.search-input:focus { box-shadow: 0 0 0 3px rgba(255,159,0,.5) !important; }

.search-submit {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1040;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
}
.search-suggestions.is-open { display: block; }

.search-suggestion {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--line);
}
.search-suggestion:last-child { border-bottom: 0; }
.search-suggestion:hover { background: var(--bg-soft); }
.search-suggestion img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.search-suggestion .sug-name { font-size: 13.5px; font-weight: 500; }
.search-suggestion .sug-meta { font-size: 12px; color: var(--ink-soft); }

/* Header action icons (cart / wishlist / account) */
.header-action {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
    position: relative;
}
.header-action:hover { background: rgba(255,255,255,.1); color: #fff; }
.header-action .bi { font-size: 18px; }

.header-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: #111;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =================================================================
   MEGA MENU
================================================================= */
.mega-nav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: none;
}
@media (min-width: 992px) {
    .mega-nav { display: block; }
}

.mega-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.mega-nav-item { position: relative; }

.mega-nav-link {
    display: inline-block;
    padding: 10px 14px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.mega-nav-link:hover { color: var(--primary); }

.mega-nav-item:hover .mega-panel { display: block; }

.mega-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    min-width: 280px;
    z-index: 1020;
}

.mega-panel a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 13.5px;
}
.mega-panel a:hover { background: var(--bg-soft); color: var(--primary); }

/* =================================================================
   HERO SLIDER
================================================================= */
.hero-slider .carousel-inner { border-radius: var(--radius); overflow: hidden; }
.hero-slide {
    aspect-ratio: 16 / 5;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: #fff;
}
.hero-slide-content {
    background: linear-gradient(transparent, rgba(0,0,0,.6));
    width: 100%;
    padding: 20px;
}
.hero-slide-content h3 { font-weight: 700; margin: 0 0 4px; font-size: 22px; }
.hero-slide-content p  { margin: 0; opacity: .9; font-size: 14px; }

@media (max-width: 575px) {
    .hero-slide { aspect-ratio: 4 / 3; }
    .hero-slide-content h3 { font-size: 17px; }
}

/* =================================================================
   SECTION HEADINGS
================================================================= */
.section-block { margin: 24px 0; }
.section-block-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.section-block-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.section-block-link { font-size: 13px; color: var(--primary); text-decoration: none; }
.section-block-link:hover { text-decoration: underline; }

/* =================================================================
   PRODUCT CARD
================================================================= */
.product-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
    background: #fff;
    border: 1px solid var(--line) !important;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
}

.product-card-img-wrap {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-soft);
    overflow: hidden;
}
.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.product-card:hover .product-card-img { transform: scale(1.04); }

.product-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 32px;
}

.product-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--success);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.product-card-price-row { display: flex; align-items: baseline; gap: 8px; }
.product-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.product-card-mrp {
    font-size: 12.5px;
    color: var(--ink-soft);
    text-decoration: line-through;
}

/* =================================================================
   CATEGORY TILES (homepage)
================================================================= */
.category-tile {
    background: #fff;
    border-radius: var(--radius);
    text-align: center;
    padding: 14px 8px;
    transition: all .18s ease;
    text-decoration: none;
    color: var(--ink);
    display: block;
    border: 1px solid var(--line);
    height: 100%;
}
.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--primary);
}
.category-tile-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    background: var(--bg-soft);
}
.category-tile-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.category-tile-name { font-size: 12.5px; font-weight: 500; }

/* =================================================================
   BRAND TILE
================================================================= */
.brand-tile {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 1px solid var(--line);
    transition: all .18s ease;
    text-decoration: none;
}
.brand-tile:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.brand-tile img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}
.brand-tile-text {
    font-weight: 600;
    color: var(--ink-soft);
    text-align: center;
}

/* =================================================================
   PRODUCT DETAIL PAGE
================================================================= */
.pdp-gallery {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.pdp-gallery-main {
    aspect-ratio: 1;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pdp-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pdp-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
}
.pdp-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--bg-soft);
}
.pdp-thumb.active { border-color: var(--primary); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pdp-info-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--line);
}

.pdp-title { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.pdp-brand { font-size: 13px; color: var(--ink-soft); }

.pdp-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
}

.pdp-price { font-size: 28px; font-weight: 700; }
.pdp-mrp { color: var(--ink-soft); text-decoration: line-through; font-size: 16px; margin-left: 8px; }
.pdp-discount { color: var(--success); font-size: 14px; font-weight: 600; margin-left: 8px; }

.pdp-variant-group { margin-top: 16px; }
.pdp-variant-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pdp-variant-chip {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-right: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s ease;
    background: #fff;
}
.pdp-variant-chip:hover { border-color: var(--primary); }
.pdp-variant-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* =================================================================
   FILTER SIDEBAR (shop / category pages)
================================================================= */
.filter-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 16px;
    margin-bottom: 16px;
}
.filter-card h6 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-soft);
    margin-bottom: 12px;
}
.filter-card .form-check { font-size: 14px; margin-bottom: 4px; }

/* =================================================================
   MOBILE BOTTOM NAV
================================================================= */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 1040;
    box-shadow: 0 -2px 8px rgba(0,0,0,.05);
}
@media (min-width: 768px) {
    .mobile-bottom-nav { display: none; }
}

.mobile-bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 11px;
    position: relative;
}
.mobile-bottom-nav a .bi { display: block; font-size: 19px; margin-bottom: 2px; }
.mobile-bottom-nav a.active { color: var(--primary); }

.mobile-bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 25%;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    padding: 0 5px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =================================================================
   FOOTER
================================================================= */
.site-footer {
    background: var(--ink);
    color: #d1d5db;
    padding: 32px 0 60px;
    margin-top: 40px;
    font-size: 14px;
}
.site-footer h6 {
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.site-footer a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 3px 0;
}
.site-footer a:hover { color: #fff; }
.site-footer-bottom {
    border-top: 1px solid #374151;
    margin-top: 24px;
    padding-top: 16px;
    font-size: 12.5px;
    color: #9ca3af;
}

/* =================================================================
   AUTH / CHECKOUT FORM
================================================================= */
.auth-card {
    max-width: 440px;
    margin: 24px auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.auth-card h4 { font-weight: 600; margin-bottom: 4px; }
.auth-card p.text-muted { margin-bottom: 18px; }

/* =================================================================
   UTILITY
================================================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-soft);
}
.empty-state .bi { font-size: 48px; opacity: .4; }
.empty-state h5 { margin-top: 12px; font-weight: 600; }

.star-row { color: #fbbf24; font-size: 14px; }
.star-row .bi-star { color: #d1d5db; }
