:root {
    /* Light Theme Palette - PS5 Inspired */
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    /* Glass effect base */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-neon: #00d4ff;
    /* Cyber Cyan - Main Brand Color */
    --accent-purple: #6200ea;
    /* Secondary Brand Color */
    --danger: #ff3b30;
    --success: #34c759;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Shadows for depth in light mode */
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(98, 0, 234, 0.2);
}

* {
    box_sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f5f5f7;
    background-image: url('../images/bg-pattern.png');
    /* Static Pattern */
    background-repeat: repeat;
    background-size: 600px;
    /* Adjust size for pattern visibility */
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Removed JS Wallpaper Styles */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Subtle overlay to fade the pattern slightly */
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* === NEW HEADER LAYOUT === */

/* Hide old classes no longer used */
.mobile-controls,
.mobile-logo,
.desktop-logo {
    display: none !important;
}

/* Header Row 1: Hamburger | Logo | Nav */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0 0.2rem;
}

/* Hamburger toggle (always visible) */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.sidebar-toggle:hover span {
    background: var(--accent-purple);
}

/* Center Logo */
.header-logo {
    display: flex !important;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--text-primary);
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

.header-logo span {
    color: var(--accent-purple);
}

.header-row-1 {
    position: relative;
}

.logo-img {
    height: 36px;
    margin-right: 8px;
    width: auto;
}

/* Primary Nav (right side) */
.primary-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.primary-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.2s;
}

.primary-nav a:hover {
    color: var(--accent-purple);
}

.cart-badge {
    background: var(--accent-purple);
    color: #fff;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 0.75rem;
    vertical-align: top;
    margin-left: 2px;
}

/* Header Row 2: Search Bar */
.header-row-2 {
    padding: 0 0 0.35rem;
}

.header-search-bar {
    width: 100%;
    max-width: 600px;
}

.header-search-bar form {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 50px;
    padding: 1px 14px;
    border: 1px solid #e1e1e1;
    transition: all 0.3s ease;
}

.header-search-bar form:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(98, 0, 234, 0.1);
    background: #fff;
}

.header-search-bar input {
    border: none;
    background: transparent;
    padding: 5px 8px;
    font-size: 0.9rem;
    width: 100%;
    color: var(--text-primary);
    outline: none;
}

/* Mobile Cart Icon (hidden on desktop) */
.mobile-cart-icon {
    display: none;
    position: relative;
    color: var(--text-primary);
    text-decoration: none;
}

.mobile-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-purple);
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 0.65rem;
    font-weight: bold;
}

/* === SIDEBAR NAV === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    z-index: 1000;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-nav.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    padding: 4px;
}

.sidebar-close:hover {
    color: var(--accent-purple);
    transform: rotate(90deg);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0.8rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li {
    border-bottom: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1rem 1.8rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: rgba(98, 0, 234, 0.06);
    color: var(--accent-purple);
    padding-left: 2rem;
    border-left-color: var(--accent-purple);
}

.sidebar-divider {
    height: 0;
    border-bottom: 1px solid #eee;
    margin: 0.5rem 1.5rem;
}

/* Hide mobile-only sidebar items on desktop */
.sidebar-mobile-only {
    display: none !important;
}

/* Desktop-only sidebar items (hidden on mobile via media query below) */
.sidebar-desktop-only {
    display: block;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {

    /* Reduce header padding */
    header {
        padding: 0.3rem 0;
    }

    /* Force single row: hamburger | logo | cart */
    .header-top {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between;
        padding: 0.2rem 0;
    }

    /* Hide desktop primary nav */
    .primary-nav {
        display: none !important;
    }

    /* Hamburger - left */
    .sidebar-toggle {
        flex-shrink: 0;
        order: 1;
    }

    /* Logo - center */
    .header-logo {
        order: 2;
        flex: 1;
        justify-content: center;
        font-size: 1.4rem;
    }

    .header-logo .logo-img {
        height: 30px;
    }

    /* Cart icon - right */
    .mobile-cart-icon {
        display: flex !important;
        align-items: center;
        flex-shrink: 0;
        order: 3;
    }

    /* Search bar compact */
    .header-row-2 {
        padding: 0 0 0.3rem;
    }

    .header-search-bar {
        max-width: 100%;
    }

    /* Show mobile items in sidebar */
    .sidebar-mobile-only {
        display: block !important;
    }

    /* Hide desktop-only items on mobile */
    .sidebar-desktop-only {
        display: none !important;
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Particles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        radial-gradient(#00d4ff 1px, transparent 1px),
        radial-gradient(#6200ea 1px, transparent 1px);
    background-size: 50px 50px, 40px 40px;
    opacity: 0.3;
    animation: floatingParticles 40s linear infinite;
}

@keyframes floatingParticles {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100%);
    }
}

a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: var(--accent-neon);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: #000;
    /* Sharp Black for headings */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Floating Glass Bar */
header {
    background-color: rgba(255, 255, 255, 0.95);
    /* Crystal White */
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}


/* header .container is now handled by .header-top */

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-purple);
}

.logo-img {
    height: 40px;
    /* Fix desktop logo size */
    margin-right: 10px;
    width: auto;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

/* Typography - Header Specific */
header h3,
header .logo {
    color: var(--text-primary);
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

nav a:hover,
nav a.active {
    color: var(--accent-purple);
    transform: translateY(-2px);
    display: inline-block;
}

/* Footer */
footer {
    background-color: #ffffff;
    /* Crystal White */
    color: var(--text-secondary);
    padding: 3rem 0;
    margin-top: 5rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent-purple), #7c4dff);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 0, 234, 0.4);
    color: #fff;
}

.btn-neon {
    background: transparent;
    border: 2px solid var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: none;
}

.btn-neon:hover {
    background: var(--accent-purple);
    color: #fff;
    box-shadow: 0 0 20px rgba(98, 0, 234, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px;
    background-color: #fff;
    border: 2px solid #e1e1e1;
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(98, 0, 234, 0.1);
}

/* Cards - Glassmorphism Redesign */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy effect */
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-purple);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    /* Better for products */
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.card-body {
    padding: 1.8rem;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-purple);
    /* Price pop */
    margin: 0.5rem 0 1rem 0;
    display: block;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Spacing between rows */
    margin-top: 1.5rem;
    background-color: transparent;
}

th {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 1rem;
    border: none;
}

td {
    background: #fff;
    padding: 1.2rem;
    color: var(--text-primary);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

/* First/Last corners rounded for rows */
tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.alert-error {
    background-color: #fff2f2;
    border: 1px solid #ffcccc;
    color: var(--danger);
}

.alert-success {
    background-color: #f0fff4;
    border: 1px solid #ccebd6;
    color: var(--success);
}

/* === Mobile Responsiveness === */
.logo-img {
    height: 100px;
    vertical-align: middle;
    margin-right: 10px;
    transition: height 0.3s ease;
}

@media (max-width: 768px) {

    /* Header Stack */
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo-img {
        height: 60px;
        /* Smaller logo on mobile */
    }

    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 0.85rem;
    }

    /* Adjust Grid */
    .card-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    /* Tables Scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Hero Button Variant - White Default, Theme Hover */
.btn-white {
    background: #fff;
    color: var(--accent-purple);
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-white:hover {
    background: linear-gradient(135deg, var(--accent-purple), #7c4dff);
    color: #fff;
    border-color: transparent;
    /* Or var(--accent-purple) if gradient doesn't cover border area perfectly */
    box-shadow: 0 8px 25px rgba(98, 0, 234, 0.4);
}

/* === Product Carousel (Fixed & Overlay) === */
.carousel-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 3rem;
    padding: 0 10px;
    /* Slight padding so buttons don't clip */
}

.product-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 2rem;
    padding: 1rem 0.5rem 2rem 0.5rem;
    /* Padding for shadow */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.product-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    min-width: 280px;
    max-width: 280px;
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.carousel-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-purple);
}

.carousel-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.carousel-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Overlay Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    /* Darker background like reference */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 50px;
    /* Larger */
    height: 50px;
    border-radius: 50%;
    /* Rounded for cleaner look on glass, reference had rect but circle fits glass better */
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-btn:hover {
    background: var(--accent-purple);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 25px rgba(98, 0, 234, 0.5);
}

/* === News Grid === */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.news-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-purple);
}

.news-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #e0e0e0;
}

.news-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image-container img {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100% - 180px);
    /* Fill remaining height */
}

.news-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}

.read-more {
    font-size: 0.9rem;
    color: var(--accent-purple);
    font-weight: 600;
    margin-top: auto;
}

/* Warranty Badge */
.warranty-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 110px !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    z-index: 20;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Product Detail Page Layout */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}