/* =============== RESET & BASE =============== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --red: #ee4d2b;
    --red-dark: #c0392b;
    --red-light: #ff6b2b;
    --gold: #ffc107;
    --dark: #222;
    --border: #e0e0e0;
    --bg: #f0f0f0;
    --white: #fff;
    --text: #333;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =============== HEADER (matching product-detail.html) =============== */
.header {
    background: var(--red);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.header-top {
    background: var(--red-dark);
    padding: 5px 0;
    font-size: 12px;
    color: #fff;
}

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

.header-top-left { display: flex; align-items: center; gap: 8px; }
.header-top-left .sep { opacity: .5; }
.header-top-right { display: flex; gap: 12px; }
.htop-link { color: #fff; text-decoration: none; font-size: 12px; opacity: .9; transition: opacity .2s; }
.htop-link:hover { opacity: 1; text-decoration: underline; }

.header-main {
    background: var(--red);
    padding: 10px 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo h1 {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.search-box {
    flex: 1;
    display: flex;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    max-width: 560px;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.search-btn {
    background: #ff6b00;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    transition: background .2s;
}
.search-btn:hover { background: #e65000; }

.cart-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255,255,255,.15);
    padding: 8px 14px;
    border-radius: 4px;
    transition: background .2s;
}
.cart-link:hover { background: rgba(255,255,255,.25); }

/* =============== NAVBAR =============== */
.navbar {
    background: rgba(0,0,0,.15);
    border-top: 1px solid rgba(255,255,255,.1);
}

.nav-content {
    display: flex;
    align-items: stretch;
    gap: 0;
}

/* Category Menu with Dropdown */
.category-menu-wrap {
    position: relative;
}

.menu-toggle {
    background: rgba(0,0,0,.2);
    color: #fff;
    border: none;
    padding: 11px 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: background .2s;
    font-family: inherit;
}
.menu-toggle:hover { background: rgba(0,0,0,.3); }
.hamburger-icon { font-size: 16px; }

/* DROPDOWN */
.category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    list-style: none;
    min-width: 260px;
    max-width: 400px;
    z-index: 300;
    overflow: hidden;
}

.category-dropdown.open { display: block; }

.category-dropdown li { border-bottom: 1px solid #f5f5f5; }
.category-dropdown li:last-child { border-bottom: none; }

.category-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.category-dropdown a:hover { background: #fff5f2; color: var(--red); }
.category-dropdown a span { font-size: 18px; width: 24px; text-align: center; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 11px 18px;
    text-decoration: none;
    color: rgba(255,255,255,.9);
    font-size: 14px;
    font-weight: 500;
    transition: background .2s, color .2s;
}
.nav-links li a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* =============== HERO SLIDER =============== */
.hero-slider {
    position: relative;
    margin: 0;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 420px;
    background: var(--red);
    overflow: hidden;
}

.slider-item {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    animation: fadeIn .5s ease;
}
.slider-item.active { display: flex; align-items: center; justify-content: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slider-content {
    text-align: center;
    color: #fff;
    max-width: 640px;
    padding: 28px;
    z-index: 2;
}

.slider-content h2 {
    font-size: 36px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.slider-content h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gold);
}

.slider-content p {
    font-size: 16px;
    margin-bottom: 18px;
    opacity: .9;
}

.slider-promotions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.promo-tag {
    background: rgba(255,255,255,.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,.3);
    backdrop-filter: blur(4px);
}

.btn-primary {
    padding: 12px 28px;
    background: #fff;
    color: var(--red);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.btn-primary:hover { background: var(--gold); color: #333; transform: translateY(-2px); }

.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    font-size: 22px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: background .2s;
    z-index: 10;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.slider-prev { left: 16px; }
.slider-next { right: 16px; }
.slider-prev:hover, .slider-next:hover { background: rgba(255,255,255,.35); }

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    cursor: pointer;
    transition: all .3s;
}
.dot.active { background: #fff; transform: scale(1.3); }

/* =============== DISCOUNT BANNER =============== */
.discount-banner {
    background: linear-gradient(135deg, #fff5e0, #fff8e1);
    border-bottom: 2px solid var(--gold);
    padding: 8px 0;
}

.discount-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.disc-banner-label {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
}

.disc-codes-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.disc-code-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px dashed var(--red);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all .2s;
    background: #fff;
}
.disc-code-chip:hover { background: #fff5f2; border-style: solid; }
.disc-code-chip.copied { background: #e8f5e9; border-color: #27ae60; }

.disc-chip-code {
    font-weight: 800;
    font-size: 13px;
    color: var(--red);
    letter-spacing: .5px;
}

.disc-chip-label {
    font-size: 11px;
    color: #888;
    border-left: 1px solid #eee;
    padding-left: 6px;
}

/* =============== PRODUCTS SECTION =============== */
.products-section {
    margin: 20px 0;
    padding: 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* =============== FLASH SALE SECTION =============== */
#flashsale-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0000 50%, #1a1a1a 100%);
    padding: 18px 0;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--red);
}

.flashsale-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.flashsale-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-icon {
    font-size: 28px;
    animation: flashPulse 1s ease-in-out infinite alternate;
}

@keyframes flashPulse {
    from { filter: drop-shadow(0 0 4px #ff6b00); transform: scale(1); }
    to { filter: drop-shadow(0 0 12px #ffcc00); transform: scale(1.15); }
}

.flashsale-title h2 {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 3px;
    text-shadow: 0 0 16px rgba(255,100,0,.7);
    margin: 0;
}

.flashsale-countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
}

.countdown-boxes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cdbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 4px 10px;
    min-width: 44px;
}

.cdbox span {
    font-size: 20px;
    font-weight: 800;
    color: var(--red);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.cdbox label {
    font-size: 9px;
    color: #888;
    font-weight: 600;
    letter-spacing: 1px;
}

.cdsep {
    font-size: 20px;
    font-weight: 900;
    color: var(--red);
    margin: 0 2px;
    line-height: 1;
    padding-bottom: 12px;
}

#flashsale-section .view-more {
    margin-left: auto;
    color: #ffc107;
    font-size: 13px;
}
#flashsale-section .view-more:hover { color: #fff; }

#flashsale-section .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

#flashsale-section .product-card {
    background: #222;
    border-color: #333;
    color: #fff;
}
#flashsale-section .product-card h3 { color: #eee; }
#flashsale-section .product-card:hover { border-color: var(--red); }
#flashsale-section .discount-tag { background: #ff6b00; }

/* Category Filter Modal */
.cat-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 8000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px;
    overflow-y: auto;
}

.cat-filter-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 24px 80px rgba(0,0,0,.3);
    overflow: hidden;
    margin-top: 20px;
}

.cat-filter-modal-header {
    background: linear-gradient(135deg, var(--red), #ff6b2b);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-filter-modal-header h3 { margin: 0; font-size: 18px; }
.cat-filter-modal-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.cat-filter-modal-close:hover { background: rgba(255,255,255,.35); }

.cat-filter-modal-body {
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--red);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.view-more {
    color: var(--red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color .2s;
}
.view-more:hover { color: var(--red-dark); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    transition: all .25s;
    cursor: pointer;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-3px);
    border-color: #ddd;
}

.product-image {
    position: relative;
    width: 100%;
    height: 180px;
    background: #fafafa;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img {
    max-width: 90%; max-height: 90%;
    object-fit: contain;
    transition: transform .3s;
}
.product-card:hover .product-image img { transform: scale(1.05); }

.discount-tag {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--red);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.product-info { padding: 12px; }

.product-info h3 {
    font-size: 13px;
    margin-bottom: 8px;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    color: #333;
}

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

.price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
}

.price-old {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
}

.product-status { margin-bottom: 8px; }

.status-badge {
    display: inline-block;
    background: #f5f5f5;
    color: var(--red);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.btn-add-cart {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all .2s;
    font-family: inherit;
}
.btn-add-cart:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* =============== BLOG SECTION (Horizontal Scroll) =============== */
.blog-section {
    padding: 28px 0;
    background: #fff;
    margin: 20px 0;
}

.blog-scroll-wrap {
    position: relative;
    overflow: hidden;
}

.blog-scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--red) #f0f0f0;
}

.blog-scroll-container::-webkit-scrollbar { height: 5px; }
.blog-scroll-container::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 10px; }
.blog-scroll-container::-webkit-scrollbar-thumb { background: var(--red); border-radius: 10px; }

.blog-scroll-card {
    flex: 0 0 260px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: all .25s;
    cursor: pointer;
}
.blog-scroll-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-3px);
}

.blog-scroll-img {
    width: 100%;
    height: 155px;
    overflow: hidden;
    background: #f5f5f5;
}
.blog-scroll-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.blog-scroll-card:hover .blog-scroll-img img { transform: scale(1.06); }

.blog-scroll-body { padding: 14px; }

.blog-scroll-date {
    font-size: 11px;
    color: #aaa;
    display: block;
    margin-bottom: 5px;
}

.blog-scroll-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

.blog-scroll-excerpt {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.blog-scroll-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--red);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .2s;
}
.blog-scroll-link:hover { color: var(--red-dark); }

/* =============== FOOTER =============== */
.footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    margin-bottom: 28px;
}

.footer-section h3 {
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--gold);
    font-weight: 700;
}

.footer-section p {
    font-size: 13px;
    margin-bottom: 7px;
    color: #aaa;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 7px; }

.footer-section a {
    color: #aaa;
    text-decoration: none;
    font-size: 13px;
    transition: color .2s;
}
.footer-section a:hover { color: var(--gold); }

.social-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-icon {
    display: inline-block;
    padding: 6px 0;
    color: #aaa;
    text-decoration: none;
    font-size: 13px;
    transition: color .2s;
}
.social-icon:hover { color: var(--gold); }

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.footer-bottom p { margin: 6px 0; }

/* =============== ANIMATION =============== */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
    .header-top { display: none; }
    .logo h1 { font-size: 20px; }
    .search-box { max-width: 100%; }
    .slider-container { height: 300px; }
    .slider-content h2 { font-size: 24px; }
    .slider-content h3 { font-size: 18px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .nav-links { display: none; }
    .blog-scroll-card { flex: 0 0 220px; }
}

@media (max-width: 480px) {
    .header-main .container { flex-wrap: wrap; }
    .cart-link { order: 3; }
    .slider-container { height: 240px; }
    .slider-content h2 { font-size: 18px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .footer-content { grid-template-columns: 1fr 1fr; }
}
