@font-face {
    font-family: 'Barlow';
    src: url('fonts/Barlow-Regular.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

:root {
    --bg-color: #12161a;
    --card-bg: #1e252b;
    --text-color: #ffffff;
    --vbucks-color: #ffd700;
    --fondo-secundario: #191821;
}

body {
    background-color: #000000;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* --- Header --- */
.shop-header {
    width: 100%;
    min-height: 70px; /* Reducido al 70% de los 100px anteriores */
    display: flex;
    justify-content: center; /* Centrado horizontal perfecto */
    align-items: center;     /* Centrado vertical perfecto */
    background-color: #15171C;
    padding: 0; /* Sin padding para que no se estire innecesariamente */
}

#shop-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

#shop-date {
    margin: 0px 0;
}

/* --- Contenedor principal --- */
.main-content-wrapper {
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tab-content {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

#shop-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex-grow: 1;
}

/* --- Secciones y Grid --- */
.shop-section {
    margin-bottom: 50px;
    scroll-margin-top: 160px;
}

.section-title {
    color: #ffffff !important;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* --- Tarjetas de items --- */
.item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--fondo-secundario) !important;
    border: none !important;
}

@media (hover: hover) and (pointer: fine) {
    .item-card:hover {
        transform: translateY(-5px);
    }
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
}

.api-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    background-color: transparent !important;
    transition: opacity 0.5s ease-in-out;
}

.item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 12px 12px 10px 12px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    z-index: 5;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), 0px 0px 8px rgba(0, 0, 0, 0.7), 0px 2px 4px rgba(0, 0, 0, 0.5);
}

.item-rarity {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(30, 37, 43, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    z-index: 4;
    letter-spacing: 1px;
    pointer-events: none;
}

.item-countdown {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.85rem;
    color: #ffffff;
    z-index: 4;
    pointer-events: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9), 0px 0px 2px rgba(0, 0, 0, 0.9);
    font-family: 'Barlow', sans-serif !important;
    font-weight: 500 !important;
}

.item-countdown.urgent {
    color: #FFEA00 !important;
}

.item-new-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #faff00;
    color: #000000;
    font-size: 0.85rem;
    font-weight: 900;
    font-style: italic;
    padding: 3px 10px;
    border-radius: 6px;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.item-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    padding: 15px;
    background-color: var(--fondo-secundario) !important;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.item-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 5px;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color) !important;
    font-size: 1.05rem;
    white-space: nowrap;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
}

.item-price-soles {
    font-size: 1.1rem;
    color: #ffffff !important;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
}

.vbucks-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    border: 2px solid #5ce1e6;
    background: #0055cc;
    box-shadow: inset 0 0 4px #00ffff, 0 0 6px rgba(0, 119, 255, 0.8);
    box-sizing: border-box;
}

.vbucks-icon::before {
    content: "V";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -51%);
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 11px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

.btn-anadir-carrito {
    width: 100%;
    background-color: #4E5466;
    color: #ffffff;
    border: none;
    padding: 8px 0;
    margin-top: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

@media (hover: hover) and (pointer: fine) {
    .btn-anadir-carrito:hover {
        background-color: #ff9800;
    }
}

.btn-anadir-carrito:active {
    transform: scale(0.96);
}

.btn-anadir-carrito .cart-icon {
    fill: #ffffff;
    width: 18px;
    height: 18px;
}

.item-card.seleccionado {
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 15px #ff9800, 0 0 20px rgba(255, 152, 0, 0.4) !important;
    transform: scale(0.98);
    transition: all 0.2s ease;
}

/* --- Filtros laterales --- */
.sidebar-wrapper {
    position: fixed;
    top: 50%;
    left: 15px;
    z-index: 9999;
    width: 276px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(-50%);
    pointer-events: none;
}

.filters-header {
    background-color: #d1d5db;
    color: #111827;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    width: max-content;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
    pointer-events: auto;
}

.filters-header:hover {
    background-color: #e5e7eb;
}

.shop-sidebar-filters {
    background: rgba(15, 15, 15, 0.85) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 0;
    color: white;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: none;
    pointer-events: auto;
}

.shop-sidebar-filters::-webkit-scrollbar { width: 6px; }
.shop-sidebar-filters::-webkit-scrollbar-track { background: transparent; margin-top: 5px; margin-bottom: 5px; }
.shop-sidebar-filters::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 10px; }
.shop-sidebar-filters::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

.filter-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    text-align: left;
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    line-height: 1.2;
}

.filter-btn:hover { background-color: rgba(255, 255, 255, 0.1); }
.filter-btn.active { background-color: rgba(255, 255, 255, 0.15); color: #ffffff !important; }

/* --- Buscador --- */
.search-container {
    background-color: #13131a;
    border: 1px solid #2a2a35;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    box-sizing: border-box;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: #6c6c7d;
    margin-right: 12px;
}

.search-input {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 100%;
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: #6c6c7d;
}

/* --- WhatsApp flotante --- */
.whatsapp-float {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #32f072;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0px 4px 15px rgba(37, 211, 102, 0.6);
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

.whatsapp-float::before {
    content: "Contactar por WhatsApp";
    position: absolute;
    right: 75px;
    background-color: #1e252b;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(10px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.whatsapp-float:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.latido-activo {
    animation: latido-corazon 1.5s infinite;
    background-color: #32f072 !important;
}

@keyframes latido-corazon {
    0% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.8);
    }
    50% {
        transform: translateY(-50%) scale(1.15);
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* --- Total flotante --- */
.floating-total {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #0b0f12;
    border-radius: 8px;
    padding: 8px 16px;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 0px;
    z-index: 9998;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.floating-total.activo {
    display: flex;
    animation: deslizarArriba 0.3s ease-out;
}

@keyframes deslizarArriba {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.total-label {
    color: #8a9a86;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.soles-highlight {
    color: #ff7b00;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    letter-spacing: 0.5px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.activo {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #1C1C1C;
    border: 2px solid #ff7b00;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 15px 30px rgba(255, 123, 0, 0.15);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-overlay.activo .modal-content {
    transform: translateY(0);
}

.icono-advertencia {
    width: 55px;
    height: 55px;
    margin-bottom: 15px;
}

.modal-content p {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    margin: 15px 0 20px 0;
    color: #ffffff;
}

#btn-cerrar-modal {
    background-color: #ff7b00;
    color: #ffffff;
    border: none;
    padding: 12px 0;
    width: 100%;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#btn-cerrar-modal:hover {
    background-color: #e56f00;
}

#btn-cerrar-modal:active {
    transform: scale(0.96);
}

/* --- Footer --- */
.legal-footer {
    background-color: #111418;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    box-sizing: border-box;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: -30px;
}

.footer-brand {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.footer-copy {
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.footer-disclaimer {
    color: #4a5568;
    font-size: 0.75rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
}

/* --- Responsivo --- */
@media (max-width: 1100px) {
    .sidebar-wrapper { left: 10px; }
    .section-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 650px) {
    .sidebar-wrapper { left: 5px; }
    .section-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; padding: 5px; }
    .item-info { padding: 10px; }
    .item-name { font-size: 0.85rem; min-height: 2.1rem; }
    .item-price { font-size: 0.85rem; }
    .item-price-soles { font-size: 0.9rem; }
    .item-rarity, .item-countdown { font-size: 0.65rem; padding: 3px 6px; top: 8px; }
    .item-countdown { right: 8px; }
    .item-rarity { left: 8px; }
    .whatsapp-float { width: 50px; height: 50px; }
    .whatsapp-icon { width: 28px; height: 28px; }
}