/* =============================================
   VARIABLES GLOBALES
   ============================================= */
:root {
    --rojo:        #e74c3c;
    --rojo-dark:   #c0392b;
    --azul-dark:   #0d003d;
    --azul-mid:    #1a0a3e;
    --azul-btn:    #2575fc;
    --verde-wa:    #25d366;
    --verde-wa-dk: #128c7e;
    --negro:       #0d0d0d;
    --gris-fondo:  #f4f4f4;
    --gris-card:   #f9f9f9;
    --texto:       #111;
    --texto-sub:   #666;
    --shadow-sm:   0 2px 10px rgba(0,0,0,0.08);
    --shadow-md:   0 6px 24px rgba(0,0,0,0.13);
    --shadow-lg:   0 14px 40px rgba(0,0,0,0.2);
    --radius:      12px;
    --transition:  0.28s cubic-bezier(0.4,0,0.2,1);
}

/* =============================================
   MENÚ CATEGORÍAS
   ============================================= */
.categorias-menu {
    background: #fff;
    padding: 14px 0;
    border-bottom: 2px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.categorias-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
}
.categorias-scroll::-webkit-scrollbar { display: none; }

.categoria-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #333;
    padding: 9px 20px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all var(--transition);
    cursor: pointer;
}

.categoria-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #000;
}

.categoria-btn.active {
    background: var(--negro);
    color: #fff;
    border-color: var(--negro);
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

.cat-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* =============================================
   SUBCATEGORÍAS
   ============================================= */
.subcategorias-menu {
    background: #1a1a1a;
    padding: 10px 0;
    border-bottom: 2px solid #333;
}

.subcategorias-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
}
.subcategorias-scroll::-webkit-scrollbar { display: none; }

.subcategoria-btn {
    background: #2a2a2a;
    color: #ccc;
    padding: 8px 18px;
    border: 1.5px solid #3a3a3a;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all var(--transition);
}

.subcategoria-btn:hover,
.subcategoria-btn.active {
    background: var(--azul-btn);
    color: #fff;
    border-color: var(--azul-btn);
    box-shadow: 0 3px 10px rgba(37,117,252,0.35);
}

/* =============================================
   BUSCADOR
   ============================================= */
.buscador-productos {
    background: linear-gradient(135deg, #1e0080 0%, #0d003d 100%);
    padding: 28px 0;
    position: relative;
    overflow: hidden;
}

/* Decoración de fondo */
.buscador-productos::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg, transparent, transparent 30px,
        rgba(255,255,255,0.015) 30px, rgba(255,255,255,0.015) 31px
    );
    pointer-events: none;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.search-wrapper {
    flex: 1;
    max-width: 540px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-left {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
    z-index: 2;
}

.input-buscar {
    width: 100%;
    padding: 14px 130px 14px 46px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50px;
    font-size: 15px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    transition: all var(--transition);
    backdrop-filter: blur(6px);
}

.input-buscar::placeholder { color: rgba(255,255,255,0.5); }

.input-buscar:focus {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.btn-clear-search {
    position: absolute;
    right: 110px;
    color: rgba(255,255,255,0.6);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    padding: 4px 8px;
    transition: color var(--transition);
}
.btn-clear-search:hover { color: #fff; }

.btn-search {
    position: absolute;
    right: 5px;
    background: var(--rojo);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 22px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.btn-search:hover {
    background: var(--rojo-dark);
    transform: scale(1.04);
}

.ps5-logo { flex-shrink: 0; }
.ps5-logo img { height: 46px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }

/* =============================================
   HEADER + FILTROS
   ============================================= */
.productos-header {
    padding: 32px 0 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.titulo-con-lineas {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
}

.linea-roja {
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rojo) 50%, transparent);
    border-radius: 2px;
}

.titulo-seccion {
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--texto);
    white-space: nowrap;
    letter-spacing: 1.5px;
    margin: 0;
}

/* Barra de filtros centrada */
.filtros-productos {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.filtro-btn {
    background-color: #fff;
    color: #000;
    padding: 10px 25px;
    border: 2px solid #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.filtro-btn:hover,
.filtro-btn.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* =============================================
   GRID DE PRODUCTOS
   ============================================= */
.productos-section {
    padding: 36px 0 64px;
    background: var(--gris-fondo);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
}

/* ── CARD ── */
.producto-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1.5px solid #eee;
    position: relative;
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
}

.producto-card:nth-child(1) { animation-delay: 0.05s; }
.producto-card:nth-child(2) { animation-delay: 0.10s; }
.producto-card:nth-child(3) { animation-delay: 0.15s; }
.producto-card:nth-child(4) { animation-delay: 0.20s; }
.producto-card:nth-child(5) { animation-delay: 0.25s; }
.producto-card:nth-child(6) { animation-delay: 0.30s; }
.producto-card:nth-child(7) { animation-delay: 0.35s; }
.producto-card:nth-child(8) { animation-delay: 0.40s; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border-color: #ddd;
}

/* ── IMAGEN ── */
.producto-img {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e4e4e4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

.producto-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
}

.producto-card:hover .producto-img img {
    transform: scale(1.08) rotate(2deg);
}

/* Precio badge circular */
.precio-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--negro);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    z-index: 5;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    line-height: 1.2;
}

/* Badge descuento */
.descuento-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--rojo);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 13px;
    z-index: 5;
    box-shadow: 0 3px 10px rgba(231,76,60,0.4);
    letter-spacing: 0.3px;
}

/* Badge stock bajo */
.stock-badge {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rojo);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 3px 8px rgba(231,76,60,0.45);
}

/* ── INFO ── */
.producto-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.producto-marca {
    font-size: 10px;
    color: var(--texto-sub);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.producto-nombre {
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--texto);
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.producto-precios {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.precio-anterior {
    color: #aaa;
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 500;
}

.precio-actual {
    color: #1a7a3a;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 20px;
}

/* Botón WhatsApp en card */
.btn-wa-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--verde-wa), var(--verde-wa-dk));
    color: #fff;
    padding: 9px 16px;
    border-radius: 7px;
    text-decoration: none;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-top: 6px;
    transition: all var(--transition);
    box-shadow: 0 3px 10px rgba(37,211,102,0.3);
}

.btn-wa-card:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 16px rgba(37,211,102,0.45);
}

.btn-wa-card svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── SIN PRODUCTOS ── */
.no-productos {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-productos-icon svg {
    width: 64px;
    height: 64px;
    color: #ccc;
}

.no-productos h3 {
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #444;
    margin: 0;
}

.no-productos p {
    color: #888;
    font-size: 15px;
    margin: 0;
}

.btn-ver-todos {
    background: var(--negro);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background var(--transition);
    margin-top: 8px;
}
.btn-ver-todos:hover { background: var(--rojo); }

/* =============================================
   MODAL
   ============================================= */
.modal-producto {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-producto.active {
    display: flex;
    animation: modalFadeIn 0.25s ease both;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-producto-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(4px);
}

.modal-producto-content {
    position: relative;
    background: linear-gradient(160deg, #1a0a3e 0%, #0a0520 100%);
    border-radius: 18px;
    max-width: 860px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: modalSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1);        opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 10;
}

.modal-close-btn svg { width: 18px; height: 18px; }

.modal-close-btn:hover {
    background: var(--rojo);
    border-color: var(--rojo);
    transform: rotate(90deg);
}

.modal-producto-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 40px;
}

/* ── Imagen ── */
.modal-producto-imagen {
    position: relative;
    background: linear-gradient(135deg, #2a1a5e, #1a0a3e);
    border-radius: 14px;
    padding: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 280px;
}

.badge-top-brand {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 80px;
    height: 80px;
    z-index: 5;
}

.badge-top-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-img-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img-wrap img {
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    filter: drop-shadow(0 12px 30px rgba(0,0,0,0.5));
    transition: transform 0.4s ease;
}

.modal-img-wrap img:hover { transform: scale(1.05); }

/* ── Info ── */
.modal-producto-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-producto-titulo {
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    line-height: 1.25;
    letter-spacing: 0.3px;
}

/* Banner descuento */
.descuento-banner {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    padding: 13px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(106,17,203,0.4);
}

.descuento-text {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    flex: 1;
}

.descuento-porcentaje {
    background: #fff;
    color: #6a11cb;
    padding: 6px 16px;
    border-radius: 20px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Descripción */
.modal-producto-descripcion {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px 18px;
}

.modal-producto-descripcion h3 {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.modal-producto-descripcion p {
    color: rgba(255,255,255,0.82);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Alerta stock */
.stock-alert {
    background: rgba(231,76,60,0.15);
    border: 1px solid rgba(231,76,60,0.4);
    padding: 11px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff8a80;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* Precio */
.modal-producto-precio {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.precios-wrapper {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 1;
}

.precio-tachado {
    color: rgba(255,255,255,0.4);
    font-size: 16px;
    text-decoration: line-through;
}

.precio-grande {
    color: #4cdb87;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.modal-pct-badge {
    background: var(--rojo);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 800;
}

/* Acciones */
.modal-acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-comprar-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--verde-wa), var(--verde-wa-dk));
    color: #fff;
    padding: 16px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-family: 'Barlow Condensed', 'Oswald', sans-serif;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.8px;
    transition: all var(--transition);
    box-shadow: 0 4px 18px rgba(37,211,102,0.35);
}

.btn-comprar-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37,211,102,0.5);
}

.btn-comprar-whatsapp svg { width: 22px; height: 22px; flex-shrink: 0; }

.btn-ver-completo {
    display: block;
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
}
.btn-ver-completo:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
    .productos-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
    .search-form { flex-direction: column; gap: 16px; }
    .search-wrapper { max-width: 100%; }
    .ps5-logo img { height: 38px; }
}

@media (max-width: 768px) {
    .titulo-seccion { font-size: 20px; }
    .filtro-btn { font-size: 11px; padding: 7px 14px; }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .producto-img { height: 180px; }
    .precio-badge { width: 48px; height: 48px; font-size: 11px; }
    .modal-producto-body { grid-template-columns: 1fr; gap: 20px; padding: 28px 20px; }
    .modal-producto-imagen { padding: 24px; min-height: 200px; }
    .modal-img-wrap img { max-height: 220px; }
    .precio-grande { font-size: 28px; }
    .modal-producto-titulo { font-size: 18px; }
    .badge-top-brand { width: 60px; height: 60px; top: -8px; right: -8px; }
}

@media (max-width: 480px) {
    .productos-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .producto-info { padding: 12px; }
    .producto-nombre { font-size: 13px; }
    .filtros-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .modal-producto-content { width: 96%; max-height: 94vh; }
    .precio-grande { font-size: 24px; }
}