/* ==========================================================================
   Variables de Sistema de Diseño (Clon Exacto Logitech G)
   ========================================================================== */
:root {
    /* Colores base */
    --color-corp-blue: #00b8fc;
    /* Cyan superior de empresa original */
    --color-bg-header: #000000;
    --color-bg-body: #f4f4f4;
    /* Fondo gris claro */

    --color-bg-card: #ffffff;
    --color-bg-card-hover: #fcfcfc;
    --color-hero-bg: #1a1a1a;

    --color-text-dark: #222222;
    --color-text-light: #ffffff;
    --color-text-muted: #666666;

    --color-border: #cccccc;

    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-body);
    color: var(--color-text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================================================
   Navegación Corporativa
   ========================================================================== */
.corp-nav {
    background-color: var(--color-corp-blue);
    height: 48px;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
}

.corp-nav-container {
    padding: 0 var(--spacing-xl);
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-xl);
}

.corp-links {
    display: flex;
    gap: 24px;
}

.corp-region a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.corp-links a:hover,
.corp-region a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Header Logitech G
   ========================================================================== */
.main-header {
    background-color: var(--color-bg-header);
    color: var(--color-text-light);
    height: 72px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    width: 100%;
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 28px;
    display: block;
}

.primary-nav {
    display: none;
}

@media (min-width: 1024px) {
    .primary-nav {
        display: block;
        flex: 1;
        margin-left: var(--spacing-xl);
    }
}

.nav-list {
    display: flex;
    gap: 28px;
}

.nav-list a {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.nav-list a:hover {
    color: var(--color-corp-blue);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #222;
    border-radius: 4px;
    padding: 4px 12px;
    border: 1px solid #444;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--color-corp-blue);
}

@media (min-width: 1024px) {
    .search-bar {
        min-width: 200px;
    }
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    outline: none;
}

.action-btn {
    font-size: 1.4rem;
    color: #fff;
}

.action-btn:hover {
    color: var(--color-corp-blue);
}

.menu-toggle {
    font-size: 1.8rem;
    color: #fff;
    display: block;
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   Contenido Principal
   ========================================================================== */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Breadcrumbs */
.breadcrumbs-container {
    margin-bottom: var(--spacing-lg);
}

.breadcrumbs {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
}

.breadcrumbs .current {
    color: var(--color-text-dark);
}

/* Barra de Filtros Horizontal */
.filters-container {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.btn-black {
    background-color: #000;
    color: #fff;
    border: 2px solid #000;
}

.btn-black:hover {
    background-color: #333;
    border-color: #333;
}

.filter-dropdowns {
    display: flex;
    gap: var(--spacing-md);
    overflow: visible;
    flex-wrap: wrap;
}

.filter-dropdown-wrapper {
    position: relative;
}

.filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background-color: #fff;
    min-width: 250px;
    border: 1px solid #ddd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: var(--spacing-md);
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.filter-menu.active {
    display: flex;
}

.cb-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--color-text-dark);
}

.cb-label input {
    display: none;
}

.custom-cb {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 3px;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
}

.cb-label input:checked+.custom-cb {
    background-color: var(--color-corp-blue);
    border-color: var(--color-corp-blue);
}

.cb-label input:checked+.custom-cb::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.select-like {
    border: 2px solid var(--color-border);
    background-color: #fff;
    color: #000;
    white-space: nowrap;
}

.select-like:hover {
    border-color: #000;
}

.product-count {
    margin-bottom: var(--spacing-xl);
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Grid y Layout
   ========================================================================== */
.home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    /* Ajuste de alineación para la grid parecida al hero */
}

@media (min-width: 768px) {
    .home-layout {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 16px;
    }
}

@media (min-width: 1200px) {
    .home-layout {
        grid-template-columns: repeat(3, 1fr);
        padding: 0;
    }
}

/* Tarjeta Hero */
.hero-card {
    background-color: var(--color-hero-bg);
    color: #fff;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    /* Hero ocupa 2 columnas en desktop para alinearse a la grid del sitio real */
    background-image: url('https://resource.logitechg.com/w_1600,c_limit,q_auto,f_auto,dpr_2.0/content/dam/gaming/en/products/g502x-plus/gallery/g502x-plus-gallery-2-black.png');
    background-position: calc(100% + 50px) center;
    background-repeat: no-repeat;
    background-size: contain;
}

@media (min-width: 768px) {
    .hero-card {
        grid-column: span 2;
    }
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
}

.hero-text p {
    font-size: 1.1rem;
    max-width: 90%;
    color: #ddd;
}

/* ==========================================================================
   Cuadrícula de Productos
   ========================================================================== */
.product-grid {
    display: contents;
    /* Usar la grid del parent */
}

/* Tarjetas */
.product-card {
    background-color: #fff;
    /* Fiel al screenshot light mode */
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 400px;
}

.product-card:hover {
    background-color: var(--color-bg-card-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-top-icons {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 2;
}

.badge {
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 8px;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
}

.btn-icon {
    font-size: 1.25rem;
    color: #000;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--color-corp-blue);
}

.product-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    position: relative;
}

.product-image {
    max-width: 80%;
    max-height: 200px;
    object-fit: contain;
}

.product-info {
    text-align: left;
    margin-top: auto;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: #000;
}

.product-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Página de Producto Individual (PDP)
   ========================================================================== */
.pdp-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-xl);
}

.pdp-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .pdp-layout {
        grid-template-columns: 1fr 1fr;
        /* 50/50 Layout */
    }
}

/* --- Columna Izquierda: Galería --- */
.pdp-gallery-container {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    /* Apilado vertical para simular la web original */
    gap: var(--spacing-md);
    background-color: #fff;
    /* Que se funda transparente */
    min-height: 500px;
}

@media (min-width: 768px) {
    .pdp-gallery-container {
        flex-direction: column;
        /* Desktop también usa column */
    }
}

.pdp-thumbnails {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

@media (min-width: 768px) {
    .pdp-thumbnails {
        flex-direction: column;
    }
}

.pdp-thumb {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.pdp-thumb.active,
.pdp-thumb:hover {
    border-color: var(--color-corp-blue);
}

.pdp-thumb img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.pdp-main-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.pdp-main-image {
    max-width: 90%;
    max-height: 500px;
    object-fit: contain;
}

/* --- Columna Derecha: Información --- */
.pdp-info-container {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pdp-series {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-xs);
    display: block;
}

.pdp-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    line-height: 1.1;
}

.pdp-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.pdp-price {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xl);
}

.pdp-color-selection {
    margin-bottom: var(--spacing-xl);
}

.pdp-color-selection h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.pdp-color-options {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px #fff;
    transition: all 0.2s;
}

.color-btn.active {
    border-color: var(--color-corp-blue);
}

.pdp-color-name {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.pdp-actions {
    margin-bottom: var(--spacing-xl);
}

.pdp-availability {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.pdp-button-group {
    display: flex;
    gap: var(--spacing-md);
}

.btn-primary {
    background-color: var(--color-corp-blue);
    color: #000;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 40px;
    font-size: 1rem;
    flex: 1;
    /* Ocupa espacio disponible */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #00a0dc;
}

.btn-icon-large {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #000;
    transition: all 0.2s;
}

.btn-icon-large:hover {
    background-color: #000;
    color: #fff;
}

.pdp-details-section h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-md);
}

.pdp-details-section p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---------- BOTON OVERRIDES ---------- */
.cart-checkout-btn:hover {
    background-color: #000;
    color: #fff;
}

/* ---------- CART DRAWER ---------- */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: #fff;
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #eaeaea;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.close-cart-btn:hover {
    background: #f4f4f4;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-item {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #f4f4f4;
    border-radius: 4px;
    padding: 4px;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.95rem;
    line-height: 1.2;
}

.cart-item-price {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    background: #f4f4f4;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.qty-btn:hover {
    background: #e0e0e0;
}

.cart-item-remove {
    margin-left: auto;
    color: #000;
    font-size: 1.1rem;
    cursor: pointer;
    background: none;
    border: none;
    text-align: right;
}

.cart-item-remove:hover {
    color: #d00;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid #eaeaea;
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.cart-checkout-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 480px) {
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
}

/* ==========================================================================
   Mosaicos Promocionales (Racing Page)
   ========================================================================== */
.promo-tiles-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 1440px;
    margin: 32px auto 0;
    padding: 0;
}

@media (min-width: 768px) {
    .promo-tiles-row {
        grid-template-columns: 1fr 1fr;
    }
}

.promo-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 320px;
    padding: 32px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.promo-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}

.promo-tile:hover {
    transform: scale(1.01);
}

.promo-tile-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

.promo-tile-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.promo-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.promo-line {
    display: inline-block;
    width: 32px;
    height: 2px;
    background-color: var(--color-corp-blue);
    transition: width 0.3s ease;
}

.promo-tile:hover .promo-line {
    width: 48px;
}

/* ==========================================================================
   Banner TRUEFORCE (Racing Page)
   ========================================================================== */
.trueforce-banner {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 480px;
    max-width: 1440px;
    margin: 32px auto 0;
    overflow: hidden;
    background-color: #0a1628;
}

.trueforce-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: left center;
    z-index: 1;
}

.trueforce-banner-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 30%, rgba(10, 22, 40, 0.9) 60%, rgba(10, 22, 40, 1) 80%);
    z-index: 2;
}

.trueforce-banner-content {
    position: relative;
    z-index: 3;
    color: #fff;
    max-width: 480px;
    padding: 48px;
    margin-left: auto;
}

.trueforce-banner-content h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.trueforce-banner-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 28px;
}

.trueforce-banner-content em {
    color: #fff;
    font-style: italic;
}

.trueforce-btn {
    display: inline-block;
    padding: 14px 36px;
    background-color: var(--color-corp-blue);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 40px;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.trueforce-btn:hover {
    background-color: #00a0dc;
}

@media (max-width: 768px) {
    .trueforce-banner {
        flex-direction: column;
        min-height: auto;
    }

    .trueforce-banner-bg {
        position: relative;
        min-height: 250px;
    }

    .trueforce-banner-bg::after {
        background: linear-gradient(to bottom, transparent 50%, rgba(10, 22, 40, 1) 100%);
    }

    .trueforce-banner-content {
        margin-left: 0;
        padding: 24px;
    }

    .promo-tile-content h2 {
        font-size: 1.4rem;
    }
}