/* ==========================================================================
   THEME 2: WEBSTORE UNI
   Design: Modern Slate Dark aesthetic matching default webstore.
   Features:
   - Simplified Navbar (Produk, Cek Invoice, Search Bar, Login/Register, Strip 3 Menu)
   - Strip 3 Menu contains (News, Cara Pesan, Leaderboard, Ulasan)
   - Promo / Flash Sale Horizontal Cards (as in Gambar 1)
   - Categorized Product Listing sorted alphabetically A-Z (as in Gambar 2)
   - Toolbar (Pilih Kategori, Search, Urutkan) hidden in Theme 2
   - 100% Isolated from Theme 1 (Default)
   ========================================================================== */

/* ── Base Variables & Page Resets for Theme 2 ── */
:root[data-theme="theme2"],
body.theme-theme2 {
    --t2-bg-main: #0b0f19;
    --t2-bg-surface: #111827;
    --t2-bg-card: #1e293b;
    --t2-bg-card-hover: #27354f;
    --t2-border: rgba(255, 255, 255, 0.08);
    --t2-border-hover: rgba(14, 165, 233, 0.45);
    --t2-primary: var(--primary, #0ea5e9);
    --t2-amber: #fbbf24;
    --t2-amber-dark: #f59e0b;
    --t2-text-white: #ffffff;
    --t2-text-main: #f1f5f9;
    --t2-text-muted: #94a3b8;
}

body.theme-theme2 {
    background-color: var(--t2-bg-main) !important;
    color: var(--t2-text-main) !important;
}

/* ── Hide Default Toolbar on Theme 2 ── */
body.theme-theme2 .toolbar-container {
    display: none !important;
}

/* ── 1. NAVBAR THEME 2 (WEBSTORE UNI) ── */
body.theme-theme2 .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0.75rem 1.5rem;
}

body.theme-theme2 .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Theme 2 Navbar Search Bar */
.t2-nav-search-wrap {
    display: none;
    position: relative;
    align-items: center;
    flex: 1;
    max-width: 320px;
    margin: 0 10px;
}

body.theme-theme2 .t2-nav-search-wrap {
    display: flex;
}

.t2-nav-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 9px 36px 9px 38px;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
}

.t2-nav-search-input:focus {
    background: rgba(15, 23, 42, 0.85);
    border-color: var(--t2-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.t2-nav-search-wrap .t2-search-icon {
    position: absolute;
    left: 13px;
    font-size: 0.88rem;
    color: #94a3b8;
    pointer-events: none;
}

.t2-nav-search-wrap .t2-search-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t2-nav-search-wrap .t2-search-clear-btn:hover {
    color: #ffffff;
}

/* Strip 3 Menu Button & Dropdown */
.t2-strip3-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.t2-strip3-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.t2-strip3-btn:hover,
.t2-strip3-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--t2-primary);
    color: var(--t2-primary);
}

.t2-strip3-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: t2DropdownFade 0.2s ease forwards;
}

@keyframes t2DropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.t2-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}

.t2-menu-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.18s ease;
}

.t2-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.t2-menu-item:hover i {
    color: var(--t2-primary);
}

/* ── 2. PROMO / FLASH SALE SECTION (GAMBAR 1) ── */
body.theme-theme2 .t2-fs-section {
    padding: 1.5rem 0 2.5rem 0;
}

.t2-fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--t2-border);
}

.t2-fs-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.t2-fs-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--t2-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.t2-fs-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.t2-fs-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
}

.t2-fs-timer-badge strong {
    color: #ffffff;
    font-family: monospace;
    font-size: 0.88rem;
}

/* Flash Sale Grid (4 columns desktop) */
.t2-fs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1024px) {
    .t2-fs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .t2-fs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .t2-fs-grid {
        grid-template-columns: 1fr;
    }
}

/* Horizontal Flash Sale Card */
.t2-fs-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--t2-bg-card);
    border: 1px solid var(--t2-border);
    border-radius: 14px;
    padding: 10px 12px;
    text-decoration: none;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.t2-fs-card:hover {
    transform: translateY(-2px);
    background: var(--t2-bg-card-hover);
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.t2-fs-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 10px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t2-fs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t2-fs-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.t2-fs-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t2-fs-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.t2-fs-price {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--t2-amber);
}

.t2-fs-orig-price {
    font-size: 0.72rem;
    color: var(--t2-text-muted);
    text-decoration: line-through;
}

.t2-fs-timer-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f87171;
}

/* ── 3. CATEGORIZED PRODUCT LISTING (GAMBAR 2) ── */
body.theme-theme2 .catalog-section {
    padding-top: 1rem;
}

.t2-products-container {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    width: 100%;
}

.t2-category-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.t2-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--t2-border);
}

.t2-cat-icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.t2-cat-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Horizontal Compact Cards Grid (PPOB, Voucher - Gambar 1 & Gambar 2) */
.t2-compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1024px) {
    .t2-compact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .t2-compact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .t2-compact-grid {
        grid-template-columns: 1fr;
    }
}

.t2-compact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--t2-bg-card);
    border: 1px solid var(--t2-border);
    border-radius: 12px;
    padding: 10px 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.t2-compact-card:hover {
    transform: translateY(-2px);
    background: var(--t2-bg-card-hover);
    border-color: var(--t2-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.t2-compact-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.t2-compact-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t2-compact-info {
    flex: 1;
    min-width: 0;
}

.t2-compact-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vertical Cards Grid (Games - Gambar 2) */
.t2-vertical-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

@media (max-width: 1024px) {
    .t2-vertical-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .t2-vertical-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .t2-vertical-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.t2-vertical-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    transition: all 0.22s ease;
    cursor: pointer;
}

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

.t2-vertical-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--t2-bg-card);
    border: 1px solid var(--t2-border);
    margin-bottom: 8px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t2-vertical-card:hover .t2-vertical-thumb {
    border-color: var(--t2-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.t2-vertical-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.t2-vertical-card:hover .t2-vertical-thumb img {
    transform: scale(1.06);
}

.t2-vertical-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.t2-vertical-card:hover .t2-vertical-title {
    color: #ffffff;
}

/* ── 4. TAMPILKAN LAINNYA BUTTON (GAMBAR 1) ── */
.t2-show-more-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.25rem;
    width: 100%;
}

.t2-btn-show-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--t2-amber);
    color: #1e1b4b;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 9px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.25);
    transition: all 0.2s ease;
}

.t2-btn-show-more:hover {
    background: var(--t2-amber-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.t2-btn-show-more i {
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

/* ── 5. MOBILE NAVIGATION SPECIFICS ── */
@media (max-width: 768px) {
    body.theme-theme2 .t2-nav-search-wrap {
        display: none; /* hidden on top row, will appear right below topbar or in drawer */
    }
    
    .t2-mobile-search-row {
        padding: 0.5rem 1rem 0.75rem 1rem;
        width: 100%;
    }
    
    .t2-mobile-search-row .t2-nav-search-wrap {
        display: flex;
        max-width: 100%;
        margin: 0;
    }
}
