/* --- CSS VARIABLES --- */
:root {
    --bg-dark: #05050a;
    --card-bg: #0c0e17;
    --cyber-yellow: #fcee0a;
    --cyber-cyan: #00f0ff;
    --cyber-magenta: #ff0055;
    --text-light: #ffffff;
    --text-gray: #888a9e;
}

/* --- GLOBAL STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rajdhani', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 15px;
    /* Prevents any accidental horizontal scrollbars globally */
    overflow-x: hidden; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

/* --- HEADER & NAVIGATION (Responsive stack-to-row) --- */
header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #1a1c2e;
    text-align: center;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--cyber-yellow);
    font-style: italic;
    letter-spacing: 2px;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    background: #0d111a;
    border: 1px solid var(--cyber-cyan);
    border-radius: 4px;
    color: white;
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

.nav-icons {
    display: flex;
    gap: 20px;
    font-size: 18px;
    align-items: center;
}

.icon-btn {
    position: relative;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--cyber-magenta);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Login Button style */
.login-trigger {
    cursor: pointer;
    font-weight: 600;
    color: var(--cyber-yellow);
    border: 1px dashed var(--cyber-yellow);
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.2s;
}
.login-trigger:hover {
    background: rgba(252, 238, 10, 0.1);
    box-shadow: 0 0 8px var(--cyber-yellow);
}

/* --- SUB NAVIGATION MENU (Centered on all devices) --- */
.sub-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centers the links */
    gap: 15px 25px;
    padding: 15px 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid #1a1c2e;
    margin-bottom: 20px;
}

.sub-nav a:hover, .sub-nav a.active {
    color: var(--cyber-yellow);
    border-bottom: 2px solid var(--cyber-yellow);
    padding-bottom: 2px;
}

/* --- HERO BANNER (Responsive Split) --- */
.hero {
    display: flex;
    flex-direction: column-reverse; /* Image on top, text on bottom on mobile */
    background: linear-gradient(135deg, #090a14 0%, #14051c 100%);
    border: 1px solid #2a1b40;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.hero-left {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-left h2 {
    color: var(--cyber-cyan);
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.hero-left h1 {
    font-size: 38px;
    color: var(--cyber-yellow);
    line-height: 1.1;
    margin-bottom: 10px;
    font-style: italic;
}

.hero-left p {
    color: var(--text-gray);
    margin-bottom: 20px;
    font-size: 16px;
}

.shop-btn {
    background: var(--cyber-yellow);
    color: #000;
    padding: 10px 25px;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    clip-path: polygon(0 0, 85% 0, 100% 100%, 0% 100%);
}

.hero-right {
    height: 200px;
    background: linear-gradient(to top, rgba(5,5,10,0.8), rgba(0,0,0,0)), url('https://via.placeholder.com/600x350/1d003a/ff0055?text=SAMURAI+JACKET') center/cover;
}

/* --- GRID HEADERS --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--cyber-yellow);
}

.view-all {
    color: var(--cyber-cyan);
    font-size: 13px;
}

/* --- CATEGORIES SECTION (Auto-adjusting grid, no scroll) --- */
.category-grid {
    display: grid;
    /* Creates as many columns as fit, minimum 100px wide */
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 35px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--cyber-cyan);
    padding: 15px 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.1);
}

.category-card:hover {
    background: rgba(0, 240, 255, 0.1);
}

.category-icon {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--cyber-cyan);
}

.category-card span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cyber-cyan);
}

/* --- PRODUCT GRID (2 columns on mobile, 4 on desktop) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 items side-by-side on mobile */
    gap: 15px;
    margin-bottom: 35px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid #1a1c2e;
    border-radius: 4px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flash-sale-section .product-card {
    border: 1px solid rgba(255, 0, 85, 0.4);
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--cyber-magenta);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    font-weight: 700;
    z-index: 2;
}

.product-img {
    width: 100%;
    height: 120px;
    background: #141622;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 13px;
    text-align: center;
    padding: 5px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.old-price {
    color: var(--text-gray);
    text-decoration: line-through;
    font-size: 12px;
}

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

.recommended-section .product-card {
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.recommended-section .current-price {
    color: var(--cyber-yellow);
}

.rating {
    color: var(--cyber-yellow);
    font-size: 12px;
    margin-bottom: 4px;
}

/* --- BENEFITS BAR --- */
.benefits-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: #090a12;
    border: 1px solid #16192b;
    padding: 20px;
    margin-top: 30px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.benefit-icon {
    font-size: 24px;
    color: var(--cyber-cyan);
}

.benefit-text h4 {
    font-size: 15px;
    color: var(--text-light);
}

.benefit-text p {
    font-size: 12px;
    color: var(--text-gray);
}

/* ====================================================
   MODAL SIGN-IN/UP POP-UP COMPONENT (Mobile Ready)
   ==================================================== */
#auth-toggle, .tab-radio {
    display: none;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

#auth-toggle:checked ~ .modal-overlay {
    display: flex;
}

.auth-box {
    background: #0a0d16;
    border: 2px solid var(--cyber-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    width: 100%;
    max-width: 400px;
    padding: 25px;
    position: relative;
    border-radius: 4px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 22px;
    color: var(--text-gray);
    cursor: pointer;
}
.close-modal:hover {
    color: var(--cyber-magenta);
}

.auth-tabs-headers {
    display: flex;
    border-bottom: 2px solid #1a1c2e;
    margin-bottom: 20px;
}

.auth-tabs-headers label {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-gray);
    letter-spacing: 1px;
}

#login-radio:checked ~ .auth-tabs-headers label[for="login-radio"],
#register-radio:checked ~ .auth-tabs-headers label[for="register-radio"] {
    color: var(--cyber-cyan);
    border-bottom: 2px solid var(--cyber-cyan);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

.auth-form {
    display: none;
}

#login-radio:checked ~ .auth-form.login-form,
#register-radio:checked ~ .auth-form.register-form {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--text-gray);
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background: #111424;
    border: 1px solid #22263f;
    color: #fff;
    border-radius: 4px;
    font-size: 15px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--cyber-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ROLE SELECTOR STYLES (Cyberpunk Radio Buttons) */
.role-options {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

/* Hide the default tiny standard system radio dots */
.role-options input[type="radio"] {
    display: none;
}

/* Custom Styled Toggle Blocks */
.role-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid #22263f;
    background: #111424;
    color: var(--text-gray);
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

/* Highlight states for active toggles dynamically based on form type */
#login-buyer:checked + label.role-btn,
#reg-buyer:checked + label.role-btn {
    border-color: var(--cyber-cyan);
    color: #000;
    background: var(--cyber-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

#login-seller:checked + label.role-btn {
    border-color: var(--cyber-yellow);
    color: #000;
    background: var(--cyber-yellow);
    box-shadow: 0 0 8px rgba(252, 238, 10, 0.4);
}

#reg-seller:checked + label.role-btn {
    border-color: var(--cyber-magenta);
    color: #fff;
    background: var(--cyber-magenta);
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
}

.auth-btn {
    width: 100%;
    background: var(--cyber-cyan);
    color: #000;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    clip-path: polygon(0 0, 92% 0, 100% 100%, 0% 100%);
}

.auth-btn.reg-btn {
    background: var(--cyber-magenta);
    color: #fff;
}

.form-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-gray);
}

.form-footer label {
    color: var(--cyber-cyan);
    cursor: pointer;
    text-decoration: underline;
}


/* ====================================================
   💻 MEDIA QUERIES (Adjusts to Desktop Screen sizes)
   ==================================================== */
@media (min-width: 768px) {
    body {
        padding: 25px;
    }

    /* Header aligns side-by-side on larger screens */
    header {
        flex-direction: row;
        justify-content: space-between;
        padding: 20px 0;
    }

    .search-bar {
        flex: 0 1 450px;
    }

    /* Sub Navigation menu - Centered on desktop */
    .sub-nav {
        justify-content: center; /* Forced center on larger screens */
        font-size: 16px;
    }

    /* Hero split-screen layout */
    .hero {
        flex-direction: row;
        min-height: 350px;
    }

    .hero-left {
        flex: 1;
        padding: 60px;
    }

    .hero-left h1 {
        font-size: 56px;
    }

    .hero-right {
        flex: 1;
        height: auto;
        background: linear-gradient(to left, rgba(0,0,0,0), var(--bg-dark)), url('https://via.placeholder.com/600x350/1d003a/ff0055?text=SAMURAI+JACKET') center/cover;
    }

    /* Grids scale to a full 4-column layout */
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .product-img {
        height: 150px;
    }

    .product-title {
        font-size: 16px;
    }

    /* Benefits Row Layout */
    .benefits-bar {
        grid-template-columns: repeat(4, 1fr);
    }
  }
