/* ==========================================================================
   DISEÑO COSMIC GLASS - VARIABLES Y RESET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Paleta de Colores Cosmic */
    --primary-neon: #06b6d4;
    /* Cyan 500 */
    --secondary-neon: #a855f7;
    /* Purple 500 */
    --accent-gold: #f59e0b;
    /* Amber 500 */

    --bg-deep: #0f172a;
    /* Slate 900 */
    --bg-dark: #1e293b;
    /* Slate 800 */

    --text-main: #ffffff;
    /* White */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Espaciado y Bordes */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    overflow-x: hidden;
    padding-top: 80px;
    /* Espacio para el navbar fijo */
}

/* Fondo Vanta (Debe estar detrás de todo) */
#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-dark);
    border-radius: 5px;
    border: 1px solid var(--glass-border);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-neon);
}

/* Botones Neón */
.btn-neon {
    background: transparent;
    border: 1px solid var(--primary-neon);
    color: var(--primary-neon);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-neon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--primary-neon);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-neon:hover {
    color: #fff;
    box-shadow: 0 0 15px var(--primary-neon);
}

.btn-neon:hover::before {
    width: 100%;
}

.btn-neon-secondary {
    border-color: var(--secondary-neon);
    color: var(--secondary-neon);
}

.btn-neon-secondary::before {
    background: var(--secondary-neon);
}

.btn-neon-secondary:hover {
    box-shadow: 0 0 15px var(--secondary-neon);
}

/* Inputs Estilizados */
.form-control-glass {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.form-control-glass:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary-neon);
    color: var(--text-main);
    box-shadow: 0 0 0 0.25rem rgba(6, 182, 212, 0.25);
}

.form-control-glass::placeholder {
    color: var(--text-muted);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-neon);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Contador Carrito */
.badge-cart {
    background: var(--accent-gold);
    color: #000;
    font-weight: bold;
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
}

/* ==========================================================================
   HERO SECTION & CARRUSEL
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 2rem 0;
}

.carousel-item-custom {
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.carousel-item-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    /* Oscurecer imagen para que el texto resalte */
}

.carousel-caption-glass {
    position: absolute;
    bottom: 20%;
    left: 5%;
    right: auto;
    text-align: left;
    max-width: 500px;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-neon);
}

/* ==========================================================================
   TARJETAS DE PRODUCTO
   ========================================================================== */
.product-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(6, 182, 212, 0.15);
    border-color: var(--primary-neon);
}

.card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.1);
}

.card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge-custom {
    font-size: 0.7rem;
    padding: 0.4em 0.8em;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.badge-new {
    background: var(--primary-neon);
    color: #000;
}

.badge-offer {
    background: var(--accent-gold);
    color: #000;
}

.badge-hot {
    background: #ef4444;
    color: #fff;
}

.card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    /* Limitar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-neon);
}

.btn-add-cart {
    width: 100%;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-qty:hover {
    color: var(--primary-neon);
}

.summary-panel {
    position: sticky;
    top: 100px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    margin-top: 4rem;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary-neon);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .carousel-item-custom {
        height: 250px;
    }

    .carousel-caption-glass {
        padding: 1rem;
        width: 90%;
        bottom: 10px;
    }

    .carousel-caption-glass h2 {
        font-size: 1.2rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }
}

/* ==========================================================================
   OVERRIDES DE BOOTSTRAP PARA MODO OSCURO
   ========================================================================== */
.text-muted {
    color: var(--text-muted) !important;
}

.text-body {
    color: var(--text-main) !important;
}

/* Asegurar que los inputs tengan texto legible */
.form-control,
.form-select {
    color: var(--text-main) !important;
}

/* Placeholder color */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
}

/* ==========================================================================
   AJUSTES ADICIONALES (CARRITO Y NAVBAR)
   ========================================================================== */
.cart-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex-grow: 1;
    padding-left: 1rem;
}

.cart-item-info h6 {
    margin-bottom: 0.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.cart-item-info p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
}

.quantity-controls button:hover {
    background: #e2e6ea;
}

.quantity-controls span {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    color: #fff;
}

.cart-item-controls p.fw-bold {
    margin: 0 !important;
    font-size: 1.25rem;
    color: var(--primary-neon);
    min-width: 80px;
    text-align: right;
}

.navbar-brand {
    font-size: 2rem !important;
    font-weight: 800;
    letter-spacing: 1px;
}

.summary-panel {
    font-size: 1.2rem;
}

.summary-panel .fw-bold {
    font-size: 1.3rem;
}

.summary-panel .text-muted {
    font-size: 1.1rem;
}

/* ==========================================================================
   MODAL ESTILOS
   ========================================================================== */
.glass-modal {
    background: #000000 !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.glass-modal .modal-header,
.glass-modal .modal-footer {
    border-color: var(--glass-border);
}

.glass-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   CONFIRMATION PAGE ANIMATIONS
   ========================================================================== */
@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: pulse-success 2s infinite;
}

/* ==========================================================================
   MOBILE MENU STYLES
   ========================================================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #000 !important;
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

/* ==========================================================================
   VIDEO RESPONSIVO
   ========================================================================== */
.ratio {
    position: relative;
    width: 100%;
}

.ratio::before {
    display: block;
    padding-top: var(--bs-aspect-ratio);
    content: "";
}

.ratio-16x9 {
    --bs-aspect-ratio: 56.25%;
}

.ratio>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   RECOMMENDED PRODUCTS SECTION
   ========================================================================== */


.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex-grow: 1;
    padding-left: 1rem;
}

.cart-item-info h6 {
    margin-bottom: 0.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.cart-item-info p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
}

.quantity-controls button:hover {
    background: #e2e6ea;
}

.quantity-controls span {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    color: #fff;
}

.cart-item-controls p.fw-bold {
    margin: 0 !important;
    font-size: 1.25rem;
    color: var(--primary-neon);
    min-width: 80px;
    text-align: right;
}

.navbar-brand {
    font-size: 2rem !important;
    font-weight: 800;
    letter-spacing: 1px;
}

.summary-panel {
    font-size: 1.2rem;
}

.summary-panel .fw-bold {
    font-size: 1.3rem;
}

.summary-panel .text-muted {
    font-size: 1.1rem;
}

/* ==========================================================================
   MODAL ESTILOS
   ========================================================================== */
.glass-modal {
    background: #000000 !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.glass-modal .modal-header,
.glass-modal .modal-footer {
    border-color: var(--glass-border);
}

.glass-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   CONFIRMATION PAGE ANIMATIONS
   ========================================================================== */
@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: pulse-success 2s infinite;
}

/* ==========================================================================
   MOBILE MENU STYLES
   ========================================================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #000 !important;
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    /* Container adjustments for tablet/mobile */
    .container-fluid.px-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (max-width: 768px) {

    /* Top padding adjustment */
    body {
        padding-top: 70px;
    }

    /* Typography Scaling */
    h1,
    .display-5 {
        font-size: 2rem !important;
    }

    .display-6 {
        font-size: 1.5rem !important;
    }

    /* Carousel Height */
    .carousel-item-custom {
        height: 250px;
    }

    .carousel-caption-glass {
        padding: 1rem;
        width: 90%;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        border-left: none;
        border-bottom: 4px solid var(--primary-neon);
    }

    .carousel-caption-glass h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem !important;
    }

    .carousel-caption-glass p {
        display: none;
        /* Hide description on very small screens to save space */
    }

    /* Product Cards */
    .product-card {
        margin-bottom: 1rem;
    }

    /* Cart Items on Mobile */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        position: relative;
    }

    .cart-item>div.d-flex {
        width: 100%;
        margin-bottom: 1rem;
    }

    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .cart-img {
        width: 60px;
        height: 60px;
    }

    /* Filters Stacked Spacing */
    .glass-panel .col-md-3 {
        margin-bottom: 1rem;
    }

    .glass-panel .col-md-3:last-child {
        margin-bottom: 0;
    }

    /* Reduce padding on glass panels */
    .glass-panel {
        padding: 1.25rem !important;
    }
}

@media (max-width: 576px) {

    /* Mobile specific tweaks */
    #paginacion-contenedor .pagination {
        flex-wrap: wrap;
    }

    .navbar-brand {
        font-size: 1.5rem !important;
    }
}

/* ==========================================================================
   VIDEO RESPONSIVO
   ========================================================================== */
.ratio {
    position: relative;
    width: 100%;
}

.ratio::before {
    display: block;
    padding-top: var(--bs-aspect-ratio);
    content: "";
}

.ratio-16x9 {
    --bs-aspect-ratio: 56.25%;
}

.ratio>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   RECOMMENDED PRODUCTS SECTION
   ========================================================================== */
.recommended-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommended-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.2);
    border-color: var(--primary-neon) !important;
}

.recommended-card .card-img-top {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* ==========================================================================
   GOLDEN TICKET FEATURE
   ========================================================================== */
.badge-custom {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 4px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-new {
    background-color: var(--primary-neon);
}

.badge-offer {
    background-color: #ef4444;
}

/* ==========================================================================
   404 ERROR PAGE STYLES
   ========================================================================== */
.error-page {
    overflow: hidden;
}

.floating-astronaut {
    font-size: 8rem;
    animation: float 6s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.glitch-text {
    font-size: 10rem;
    position: relative;
    color: #fff;
    text-shadow: 2px 2px var(--primary-neon), -2px -2px var(--secondary-neon);
}

@media (max-width: 768px) {
    .glitch-text {
        font-size: 6rem;
    }

    .floating-astronaut {
        font-size: 5rem;
    }
}


/* Red 500 */
.badge-hot {
    background-color: #f97316;
}

/* Orange 500 */

.badge-golden {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    color: #000;
    animation: shine 3s infinite linear;
    border: 1px solid #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes shine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.golden-message {
    color: #FFD700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }

    100% {
        opacity: 0.8;
    }
}