/* ==========================================================================
   VARIABLES Y ESTILOS BASE
   ========================================================================== */
:root {
    --fondo: #080b12;
    --panel: #111722;
    --panel-claro: #17202f;
    --borde: #263348;
    --texto: #f7f8fb;
    --muted: #aab3c2;
    --dorado: #d6b04c;
    --verde: #2fd37d;
    --rojo: #ff5d6c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(214, 176, 76, .14), transparent 30%),
        linear-gradient(180deg, #0a1020 0%, var(--fondo) 42%, #07090e 100%);
    color: var(--texto);
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden; /* Anti desborde horizontal general */
    width: 100%;
}

.iconos-categorias {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

a {
    color: inherit;
}

button, select, input {
    font: inherit;
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN
   ========================================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8, 11, 18, .88);
    border-bottom: 1px solid var(--borde);
    backdrop-filter: blur(14px);
}

.nav {
    max-width: 1180px;
    min-height: 78px;
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
    color: var(--dorado);
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(214, 176, 76, .45);
}

.menu, .acciones, .hero-acciones, .botones {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color .2s ease;
}

.menu a:hover {
    color: var(--texto);
}

.acciones select, .btn-header, .btn-carrito-nav {
    min-height: 40px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: var(--panel);
    color: var(--texto);
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: border-color .2s ease, background .2s ease;
}

.acciones select {
    cursor: default;
    outline: none;
}

.btn-header:hover, .btn-carrito-nav:hover {
    border-color: var(--dorado);
    background: var(--panel-claro);
}

#contador-cart {
    background: var(--dorado);
    color: #101010;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}

/* ==========================================================================
   HERO SECTION (PC)
   ========================================================================== */
.hero {
    min-height: 520px;
    display: grid;
    place-items: center;
    padding: 84px 22px 64px;
}

.hero-contenido {
    width: min(900px, 100%);
    text-align: center;
}

.etiqueta {
    color: var(--dorado);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(40px, 7vw, 78px);
    line-height: 1;
    color: var(--texto);
    margin-bottom: 20px;
}

.hero-texto {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.6;
}

.hero-texto strong {
    color: var(--texto);
}

.beneficios {
    max-width: 720px;
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.beneficios span {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: rgba(17, 23, 34, .82);
    color: var(--texto);
    font-weight: 700;
    line-height: 1.35;
}

.cierre-hero {
    margin-top: 24px;
    color: var(--muted);
    font-size: 18px;
}

.cierre-hero strong {
    color: var(--dorado);
}

.hero-acciones {
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 20px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-principal { background: var(--dorado); color: #101010; }
.btn-secundario { background: rgba(255, 255, 255, .05); color: var(--texto); border-color: var(--borde); }

/* ==========================================================================
   LAYOUT Y FILTROS (PC)
   ========================================================================== */
.layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 22px 70px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.filtros {
    position: sticky;
    top: 96px;
    padding: 18px;
    background: rgba(17, 23, 34, .82);
    border: 1px solid var(--borde);
    border-radius: 8px;
}

.filtros h2, .catalogo h2, .vender h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.filtros label, .label-grupo {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 14px 0 8px;
}

.filtros input, .filtros select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--borde);
    background: #0b1019;
    color: var(--texto);
    outline: none;
}

.filtros input:focus, .filtros select:focus {
    border-color: var(--dorado);
}

.desgaste {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.desgaste button {
    min-height: 38px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: #0b1019;
    color: var(--texto);
    cursor: pointer;
}

.desgaste button.activo {
    background: var(--dorado);
    color: #101010;
    border-color: var(--dorado);
    font-weight: 800;
}

/* ==========================================================================
   CATEGORÍAS Y PRODUCTOS (PC)
   ========================================================================== */
.catalogo-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.catalogo-header p:last-child {
    color: var(--muted);
}

.categorias {
    display: grid;
    /* Cambiamos auto-fill por 1fr para que las 9 columnas ocupen el 100% del largo de forma exacta */
    grid-template-columns: repeat(9, 1fr); 
    gap: 12px;
    margin-bottom: 25px;
    width: 100%; /* Forzamos a que use todo el espacio */
}

.categorias button {
    min-height: 98px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(24, 27, 35, .96), rgba(16, 18, 24, .98));
    color: var(--texto);
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.categorias button:hover, .categorias button.activo {
    transform: translateY(-2px);
    border-color: var(--dorado);
    background: linear-gradient(180deg, rgba(31, 35, 45, .98), rgba(17, 19, 26, .98));
}

.categoria-icono {
    width: 46px;
    height: 46px;
    object-fit: contain;
    display: block;
    transition: transform .2s ease, filter .2s ease;
}

.categorias button:hover .categoria-icono, .categorias button.activo .categoria-icono {
    transform: scale(1.08);
    filter: drop-shadow(0 0 8px rgba(214, 176, 76, .45));
}

.productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.card {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--borde);
    border-radius: 8px;
    overflow: hidden;
}

.card-imagen {
    height: 190px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, var(--panel-claro), #0e1420);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
}

.card-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.card h3 {
    min-height: 48px;
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 10px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.meta span {
    border: 1px solid var(--borde);
    border-radius: 999px;
    padding: 5px 8px;
}

.precio {
    margin-top: auto;
    font-size: 25px;
    font-weight: 900;
    color: var(--dorado);
}

.precio-usd {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 16px;
}

.agregar {
    width: 46px;
    min-width: 46px;
    height: 46px;
    background: var(--panel-claro);
    color: var(--texto);
    border: 1px solid var(--borde);
    font-size: 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.comprar {
    flex: 1;
    min-height: 46px;
    margin-left: 10px;
    background: var(--verde);
    color: #04100a;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.sin-resultados {
    grid-column: 1 / -1;
    padding: 36px;
    border: 1px dashed var(--borde);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

/* ==========================================================================
   SECCIONES SECUNDARIAS (VENDER, SECCIÓN RIFAS, FOOTER)
   ========================================================================== */
.vender {
    max-width: 1180px;
    margin: 0 auto 52px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    background: rgba(17, 23, 34, .82);
    border: 1px solid var(--borde);
    border-radius: 8px;
}

.vender p:last-child {
    max-width: 680px;
    color: var(--muted);
    line-height: 1.6;
}

#rifa-sorteo {
    background: #0b0b0e;
    padding: 35px 20px;
    margin: 40px auto;
    max-width: 700px;
    border-radius: 12px;
    border: 1px solid rgba(255, 153, 0, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    text-align: center;
}

#rifa-sorteo h2 {
    color: #ffffff;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 25px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-rifa-interior {
    background: linear-gradient(135deg, #131519 0%, #1c1f24 100%);
    border: 2px solid #ebc665;
    border-radius: 10px;
    padding: 35px 25px;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 0 20px rgba(235, 198, 101, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-rifa-interior:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 0 30px rgba(235, 198, 101, 0.35);
}

.card-rifa-interior h3 {
    color: #ebc665;
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-rifa-interior p {
    color: #b0b5c0;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 400;
}

.btn-rifa-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 14px 36px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(220, 39, 67, 0.3);
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.btn-rifa-instagram:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 39, 67, 0.6);
    filter: brightness(1.1);
}

#paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px auto;
    padding: 10px;
    width: 100%;
    max-width: 600px;
}

.btn-pag {
    background: rgba(30, 30, 30, 0.75) !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    user-select: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}

.btn-pag:hover {
    background: #ff9900 !important;
    color: #050505 !important;
    border-color: #ffaa22 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 12px rgba(255, 153, 0, 0.3) !important;
}

.btn-pag.activo {
    background: #ff9900 !important;
    color: #050505 !important;
    border-color: #ffaa22 !important;
    transform: none !important;
    cursor: default !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 153, 0, 0.5) !important;
    pointer-events: none !important;
}

.footer {
    border-top: 1px solid var(--borde);
    padding: 24px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    flex-wrap: wrap;
}

.footer p { color: var(--texto); font-weight: 800; }
.footer a { color: var(--dorado); text-decoration: none; }

/* ==========================================================================
   CARRITO DE COMPRAS PANEL
   ========================================================================== */
.cart-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: min(400px, 100vw);
    height: 100vh;
    background: var(--panel);
    border-left: 1px solid var(--borde);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
}

.cart-panel.open { right: 0 !important; }
.cart-header { padding: 20px; border-bottom: 1px solid var(--borde); display: flex; justify-content: space-between; align-items: center; background: var(--panel-claro); }
.cart-header h3 { font-size: 20px; color: var(--dorado); font-weight: 800; }
.close-cart { background: transparent; border: none; color: var(--muted); font-size: 32px; cursor: pointer; line-height: 1; }
.close-cart:hover { color: var(--rojo); }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.cart-item { display: flex; align-items: center; gap: 15px; padding: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--borde); border-radius: 8px; }
.cart-item img { width: 60px; height: 60px; object-fit: contain; background: var(--panel-claro); border-radius: 6px; padding: 4px; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; color: var(--texto); margin-bottom: 4px; }
.cart-item-info p { font-size: 15px; font-weight: 700; color: var(--dorado); }
.btn-remove-item { background: transparent; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.btn-remove-item:hover { color: var(--rojo); }
.cart-footer { padding: 20px; border-top: 1px solid var(--borde); background: var(--panel-claro); }
.trade-link-container { margin-bottom: 18px; }
.trade-link-container label { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.trade-link-container input { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--borde); background: #0b1019; color: var(--texto); outline: none; font-size: 13px; }
.trade-link-container input:focus { border-color: var(--dorado); }
.steam-helper-link { display: block; margin-top: 6px; font-size: 12px; color: var(--dorado); text-decoration: none; }
.steam-helper-link:hover { text-decoration: underline; }
.cart-total-box { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 800; margin-bottom: 5px; }
#cart-total-precio { color: var(--verde); font-size: 24px; }
.cart-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); z-index: 99; display: none; }
.cart-overlay.open { display: block !important; }

/* ==========================================================================
   BLINDAJE RESPONSIVO INTEGRAL (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 768px) {
    /* Forzado anti desborde en elementos chicos */
    *, *:before, *:after {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Reducción controlada del texto general de la web */
    .hero h1 { font-size: 32px !important; }
    .hero-texto { font-size: 15px !important; }
    .filtros h2, .catalogo h2, .vender h2 { font-size: 22px !important; }

    /* Modificación de la barra lateral de PC a bloque vertical móvil */
    .layout {
        display: flex !important;
        flex-direction: column !important;
        padding: 12px !important;
        gap: 16px !important;
    }

    /* Contenedor de filtros */
    .filtros {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    /* Botones de Categorías: Pasamos de grilla gigante a fila adaptable */
    /* Botones de Categorías en Celular: Se acomodan en filas fluidas */
    .categorias {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .categorias button {
        min-height: 75px !important;
        /* En celu se reparten el espacio para que entren de a 3 por fila prolijos */
        flex: 1 1 calc(33.33% - 8px) !important; 
        min-width: 85px !important;
        font-size: 12px !important;
        padding: 8px !important;
    }

    .categoria-icono {
        width: 32px !important;
        height: 32px !important;
    }

    /* Grilla de Armas/Skins: 2 perfectas por fila */
    .productos {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Encogemos las cards de skins */
    .card {
        min-height: 310px !important;
    }

    .card-imagen {
        height: 120px !important;
    }

    .card img {
        padding: 8px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    .card h3 {
        font-size: 14px !important;
        min-height: 36px !important;
        margin-bottom: 6px !important;
    }

    .meta {
        gap: 4px !important;
        margin-bottom: 10px !important;
    }

    .meta span {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }

    .precio {
        font-size: 18px !important;
    }

    .precio-usd {
        font-size: 11px !important;
        margin: 2px 0 10px !important;
    }

    .botones {
        gap: 6px !important;
    }

    .agregar, .comprar {
        min-height: 38px !important;
        height: 38px !important;
        font-size: 13px !important;
    }

    /* Bloque de Beneficios del Hero */
    .beneficios {
        grid-template-columns: 1fr !important; /* Uno abajo del otro */
        gap: 8px !important;
    }

    .beneficios span {
        min-height: 50px !important;
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* Nav bar ajustes móviles rápidos */
    .nav {
        padding: 10px 14px !important;
        min-height: 60px !important;
    }
    
    .menu {
        display: none !important; /* Escondemos links sueltos si molestan en celu */
    }

    /* Bloque de compra/vender general */
    .vender {
        flex-direction: column !important;
        text-align: center !important;
        padding: 16px !important;
    }

    /* Sección de sorteos */
    #rifa-sorteo {
        width: 100% !important;
        padding: 20px 12px !important;
    }
    
    .card-rifa-interior {
        padding: 20px 15px !important;
    }

    .card-rifa-interior h3 {
        font-size: 1.1rem !important;
    }

    .btn-rifa-instagram {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 0.85rem !important;
    }
}
/* ETIQUETA FLOTANTE DE TRADE LOCK */
.card-imagen {
    position: relative; /* Obligatorio para contener el tag absoluto */
}

.tradelock-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(22, 22, 31, 0.9); /* Gris oscuro opaco */
    color: #f1c40f; /* Amarillo vibrante para resaltar el candado */
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid rgba(241, 196, 15, 0.25);
    letter-spacing: 0.3px;
    z-index: 5;
    pointer-events: none; /* No interfiere al cliquear la card */
}