:root {
    --brand-red: #FF3037;
    --brand-red-dark: #E02027;
    --bg-body: #F5F8FB;
    --bg-surface: #FFFFFF;
    --text-primary: #152233;
    --text-muted: #7A8796;
    --border-color: #E3E9EF;
    --success-green: #0AA65A;
    --warning-orange: #FF7A00;
    --radius-card: 16px;
    --radius-pill: 999px;
    --shadow-soft: 0 4px 20px rgba(21, 34, 51, 0.05);
    --transition-fast: 180ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.45;
    overflow-x: hidden;
    padding-bottom: 84px;
}

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

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Strip */
.top-strip {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}

.top-strip-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.btn-track-order {
    border: 1px solid #FF989B;
    color: var(--text-primary);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    background: #FFF9F9;
    transition: var(--transition-fast);
}

.btn-track-order:hover {
    background: var(--brand-red);
    color: #fff;
}

/* Main Header */
.site-header {
    background: var(--bg-surface);
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-categories {
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 22px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    min-width: 210px;
    justify-content: space-between;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--brand-red);
    letter-spacing: -0.8px;
}

.header-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1.5px solid #FF8A8E;
    border-radius: var(--radius-pill);
    padding-left: 16px;
    background: #fff;
    overflow: hidden;
    height: 46px;
}

.header-search-form input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.btn-search {
    background: var(--brand-red);
    color: #fff;
    border: none;
    height: 100%;
    padding: 0 26px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-pill);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
}

.cart-icon-wrap {
    position: relative;
    font-size: 18px;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--brand-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

/* Home Layout (Strict minmax(0, 1fr) prevents giant images from stretching grid) */
.home-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    margin-top: 22px;
    align-items: start;
}

.home-main-column {
    min-width: 0;
    width: 100%;
}

/* Category Sidebar */
.category-sidebar {
    background: var(--bg-surface);
    border-radius: var(--radius-card);
    padding: 10px;
    box-shadow: var(--shadow-soft);
    align-self: start;
}

.category-list {
    list-style: none;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.category-link:hover {
    background: #FFF2F2;
    color: var(--brand-red);
}

.cat-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F4F6F9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.cat-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

/* Hero Carousel */
.hero-carousel {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    min-height: 330px;
    background: #FBF2EB;
    box-shadow: var(--shadow-soft);
    width: 100%;
}

.hero-slide {
    min-height: 330px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 40px 56px;
}

.hero-content {
    max-width: 470px;
}

.hero-badge {
    display: inline-block;
    background: var(--success-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.text-brand {
    display: block;
    color: var(--brand-red);
}

.hero-subtitle {
    color: #5C6B7A;
    font-size: 15px;
    margin-bottom: 22px;
}

.btn-hero-cta {
    display: inline-flex;
    align-items: center;
    background: var(--brand-red);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 11px 24px;
    border-radius: var(--radius-pill);
}

/* Products Filter Bar */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 26px 0 18px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.filter-pills {
    display: flex;
    gap: 10px;
}

.filter-pill {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.filter-pill.active,
.filter-pill:hover {
    background: var(--brand-red);
    color: #fff;
    border-color: var(--brand-red);
}

/* Product Cards Grid — Strict 4 equal columns with auto-fit images */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}

.product-card {
    background: var(--bg-surface);
    border-radius: var(--radius-card);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #F4F6F8;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.product-media > a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
}

.stock-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    color: #fff;
    z-index: 2;
}

.stock-ready {
    background: var(--success-green);
}

.stock-preorder {
    background: var(--warning-orange);
}

.btn-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.sticker-badge {
    position: absolute;
    top: 44px;
    left: 10px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand-red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 2px dashed rgba(255,255,255,0.85);
    z-index: 2;
    line-height: 1.1;
}

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-red);
}

.price-compare,
.price-adv {
    font-size: 12.5px;
    color: var(--text-muted);
}

.product-stats {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-rating {
    color: #F59E0B;
}

.star-rating strong {
    color: var(--text-primary);
}

.product-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.seller-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-card-action {
    flex: 1;
    min-width: 0;
    text-align: center;
    background: var(--brand-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    transition: background var(--transition-fast);
}

.btn-card-action:hover {
    background: var(--brand-red-dark);
}

.mobile-only {
    display: none;
}

/* Tablet Breakpoint */
@media (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile Breakpoint */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex;
    }

    .header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }

    .mobile-menu-btn span {
        display: block;
        width: 24px;
        height: 3px;
        background: var(--brand-red);
        border-radius: 3px;
    }

    .mobile-profile-btn {
        font-size: 22px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1.5px solid var(--text-primary);
        align-items: center;
        justify-content: center;
    }

    .header-search-form {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
    }

    .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 300;
        border-radius: 0;
        overflow-y: auto;
        transition: left 220ms ease;
    }

    .category-sidebar.open {
        left: 0;
    }

    .drawer-header {
        justify-content: space-between;
        align-items: center;
        padding: 12px 10px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 8px;
    }

    .hero-carousel,
    .hero-slide {
        min-height: 200px;
        padding: 20px;
    }

    .hero-title {
        font-size: 24px;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        min-height: 38px;
        font-size: 13.5px;
    }

    .price-current {
        font-size: 17px;
    }

    .product-actions.has-badge {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-bottom-nav {
        position: fixed;
        bottom: 10px;
        left: 12px;
        right: 12px;
        height: 64px;
        background: linear-gradient(180deg, #2B3036 0%, #121518 100%);
        border-radius: 36px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 250;
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
        padding: 0 8px;
    }

    .mobile-bottom-nav .nav-item {
        color: #E3E9EF;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px;
        gap: 2px;
    }

    .mobile-bottom-nav .nav-item-home {
        position: relative;
        top: -12px;
    }

    .home-fab {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: #0D0F12;
        border: 2px solid var(--brand-red);
        box-shadow: 0 0 14px rgba(255, 48, 55, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}