:root {
    --primary: #DC2626;
    --dark: #222;
    --text-dark: #222;
    --text-grey: #767676;
    --bg: #f5f5f5;
}

* { box-sizing: border-box; }

/* Stops Android OEM browsers (Tecno's HiOS browser, Walton's stock
   browser, Samsung Internet, etc.) from auto-inflating font sizes on
   their own "readability boost" heuristic. Without this, the exact
   same font-size can render visibly larger/smaller across brands even
   though the CSS is identical — this locks it to what we actually
   wrote everywhere. */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Belt-and-braces: stops any single oversized element (a long
   unbroken link, an image without max-width, etc.) from ever being
   able to push the page wider than the viewport and create a sliver
   of empty background down one side from horizontal scroll. */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', 'Noto Sans Bengali', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    margin: 0;

}

a { text-decoration: none; color: inherit; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 12px; }

/* ---------------- TOP BAR ---------------- */
.topbar {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: .3px;
}
.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    margin-right: 4px;
}

/* Left-side category drawer — dark theme with per-item icons, matching
   the reference site's off-canvas menu but colored from the site's own
   primary_color setting instead of a hardcoded brand color. */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.category-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 82vw;
    background: #16181c; z-index: 91; transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1); overflow-y: auto;
    padding: 50px 14px 20px;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
}
.category-drawer.open { transform: translateX(0); }
.drawer-close {
    position: absolute; top: 10px; right: 12px; background: none; border: none;
    color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 2;
}
.category-drawer-list { display: flex; flex-direction: column; gap: 4px; }
.category-drawer-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    font-size: 14.5px; font-weight: 500; color: #d8dadf; border-radius: 10px;
}
.category-drawer-item i { width: 18px; text-align: center; font-size: 15px; color: var(--primary); flex-shrink: 0; }
.category-drawer-item:hover { background: rgba(255,255,255,.06); }
/* The current page's item — a solid light "pill", matching the reference
   screenshot's highlighted "Home" state. */
.category-drawer-item.is-active { background: #fff; color: #111; }
.category-drawer-item.is-active i { color: var(--primary); }

.brand img { height: 30px; width: auto; }
.topnav { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.topnav a { display: flex; align-items: center; gap: 4px; }
.btn-signup { background: #fff; color: var(--primary); padding: 6px 14px; border-radius: 4px; font-weight: 700; }

/* ---------------- SEARCH BAR (top bar) ---------------- */
.search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
    max-width: 420px;
    margin: 0 16px;
}
.search-bar input {
    border: none;
    outline: none;
    padding: 8px 10px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    color: #222;
}
.search-bar button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
@media (max-width: 640px) {
    .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
    .search-bar { order: 3; max-width: 100%; margin: 0; flex-basis: 100%; }
}

/* ---------------- NOTICE MARQUEE ---------------- */
.notice-bar {
    background: #222;
    color: #fff;
    font-size: 12.5px;
    padding: 6px 0;
    overflow: hidden;
    white-space: nowrap;
}
.notice-bar marquee { color: #fff; }

/* ---------------- HERO BANNER SLIDER ----------------
   Fixed height (not aspect-ratio driven) so it can never blow up huge
   on wide screens, and no drag-to-scroll — just a simple auto-advancing
   translateX slider. Much less prone to layout glitches. */
.hero-banner {
    margin: 12px auto;
    max-width: 1320px;
    padding: 0 12px;
}
.slider-container {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    background: #eee;
}
@media (min-width: 640px) { .slider-container { height: 220px; } }
@media (min-width: 1024px) { .slider-container { height: 320px; } }

.slider-wrapper {
    display: flex;
    height: 100%;
    transition: transform .5s ease-in-out;
}
.slide { min-width: 100%; height: 100%; position: relative; cursor: pointer; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-caption {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,.5);
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}
.slider-dots {
    position: absolute;
    bottom: 8px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 5px;
}
.slider-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); transition: .3s; }
.slider-dots span.active { background: #fff; width: 16px; border-radius: 4px; }

/* ---------------- CATEGORY ICON STRIP ---------------- */
.category-strip {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 12px 14px;
    max-width: 1320px;
    margin: 0 auto;
    scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }

/* ---------------- PRODUCT PAGE THUMBNAIL STRIP ---------------- */
/* Horizontal drag/swipe strip for a product's extra gallery images —
   touch-drag on mobile, mouse-drag/wheel on desktop is enough on its
   own, so there are deliberately no arrow/slider controls here. Height
   is reserved by min-height on the element itself (see product.php) so
   a product with no gallery images doesn't end up with a visibly
   shorter image column than one that has them. */
.thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.thumb-strip::-webkit-scrollbar { display: none; }
.thumb-strip-img { flex-shrink: 0; }

.category-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 68px;
    text-align: center;
}
.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1px solid #eee;
}
.category-icon-fallback {
    width: 56px; height: 56px; border-radius: 50%;
    background: #fff; border: 1px solid #eee;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--primary); font-size: 18px;
}
.category-item span { font-size: 11px; color: var(--text-dark); line-height: 1.2; }

/* ---------------- SECTION TITLE ---------------- */
.section-title {
    font-weight: 800;
    font-size: 16px;
    margin: 18px 12px 10px;
    max-width: 1320px;
    margin-left: auto; margin-right: auto;
    padding: 0 12px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

/* ---------------- PRODUCT GRID (dense, Daraz-style) ---------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 12px 20px;
}
@media (min-width: 560px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 800px)  { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .product-grid { grid-template-columns: repeat(6, 1fr); } }

.product-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .15s, transform .15s;
    display: block;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-2px); }
.product-thumb-wrap { width: 100%; aspect-ratio: 1 / 1; background: #f1f1f1; overflow: hidden; }
.product-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info { padding: 8px; }
.product-name {
    font-size: 12.5px;
    line-height: 1.35;
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
    color: var(--text-dark);
}
.product-price-row { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.product-price { color: var(--primary); font-weight: 700; font-size: 13.5px; }
.product-old-price { text-decoration: line-through; color: #aaa; font-size: 11px; }
.discount-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
}

/* ---------------- GENERIC BITS reused across pages ---------------- */
.card-box { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.btn-primary:hover { opacity: .92; }
.price-tag { color: var(--primary); font-weight: 800; }
.old-price { text-decoration: line-through; color: #999; font-size: 12px; }

/* Rich-text product description — output from the admin's Summernote
   editor. Reset list/table defaults since the editor's HTML expects
   normal browser styling, not our utility resets. */
.product-description {
    font-size: 13.5px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    word-wrap: break-word;
}
.product-description p { margin: 0 0 10px; }
.product-description ul, .product-description ol { margin: 0 0 10px 20px; }
.product-description table { border-collapse: collapse; margin: 10px 0; }
.product-description table td, .product-description table th { border: 1px solid #ddd; padding: 6px 10px; }
.product-description img { max-width: 100%; height: auto; }

.empty-state { text-align: center; padding: 60px 20px; color: #888; }

/* Compatibility: earlier pages (cart/checkout/wallet/login/register/
   profile) use these utility class names inline with Tailwind. */
.sharp-edge { border-radius: 4px; }
.brand-text { font-weight: 800; }

/* ---------------- FOOTER ---------------- */
.site-footer { background: #222; color: #ccc; margin-top: 30px; }
.support-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 16px 12px; font-size: 13px; }
.support-row a { display: flex; align-items: center; gap: 6px; color: #ccc; }
.support-row a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 14px; font-size: 12.5px; color: #999; border-top: 1px solid #333; }
.download-app-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary); color: #fff; padding: 8px 16px;
    border-radius: 6px; font-size: 13px; font-weight: 600; margin: 10px auto; width: fit-content;
}

/* Reviewer badges — bright, animated, tiered by qualifying-review count */
.reviewer-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; letter-spacing: .2px;
    padding: 2px 8px; border-radius: 20px; margin-left: 6px; color: #fff;
    background-size: 200% 200%;
    animation: badge-shimmer 2.5s ease infinite, badge-pulse 1.8s ease-in-out infinite;
}
.reviewer-badge.tier-bronze   { background-image: linear-gradient(120deg, #cd7f32, #e6b17e, #cd7f32); }
.reviewer-badge.tier-silver   { background-image: linear-gradient(120deg, #9ba4ad, #e2e8f0, #9ba4ad); }
.reviewer-badge.tier-gold     { background-image: linear-gradient(120deg, #d4af37, #fff2b2, #d4af37); color: #5a4300; }
.reviewer-badge.tier-diamond  { background-image: linear-gradient(120deg, #38bdf8, #e0f2fe, #38bdf8); color: #023047; }
.reviewer-badge.tier-platinum { background-image: linear-gradient(120deg, #a78bfa, #f3e8ff, #a78bfa); color: #3b0764; }
.reviewer-badge.tier-mythic   { background-image: linear-gradient(120deg, #f43f5e, #fbbf24, #f43f5e); }

@keyframes badge-shimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(0,0,0,0); transform: scale(1); }
    50%      { box-shadow: 0 0 8px rgba(0,0,0,0.25); transform: scale(1.05); }
}

/* Review likes + threaded replies */
.review-like-btn {
    border: none; background: none; cursor: pointer; font-size: 12px; color: #888;
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 0;
}
.review-like-btn.liked { color: #e0245e; font-weight: 700; }
.review-replies { margin: 8px 0 0 24px; border-left: 2px solid #eee; padding-left: 12px; }
.review-reply { padding: 6px 0; font-size: 12px; }
.review-reply-form textarea {
    width: 100%; font-size: 12px; padding: 6px; border-radius: 6px; border: 1px solid #ddd; resize: vertical;
}
