/* Configuración General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #0a0e27;
    color: #e0e0e0;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* animaciones suaves para otros elementos cambiantes */
.main-header,
.banner,
.card,
.btn-add,
.newsletter-section,
.main-footer {
    transition: background 0.5s ease, border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

/* tipografía estilo arcade/gamer para el título principal */
h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    letter-spacing: 2px;
    color: #00ff41;
    text-shadow: 0 0 8px #00ff41;
    margin: 0;
}

/* color y estilo cuando el tema es claro */
body.light-theme h1 {
    color: #0066cc;
    text-shadow: 0 0 8px #0066cc;
}

/* estilo del subtítulo bajo el logo */
.logo span {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    color: #00d4ff;
    letter-spacing: 1px;
    display: block;
    margin-top: 5px;
}

body.light-theme .logo span {
    color: #004499;
}

/* 1. HEADER con Flexbox (Alineación horizontal) */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: #0f0f1e;
    border-bottom: 3px solid #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    flex-wrap: wrap; /* Importante para que baje en móviles */
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #00ff41;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00d4ff;
    text-shadow: 0 0 10px #00ff41;
}

.banner {
    background: linear-gradient(90deg, #1a1a2e 0%, #0f0f1e 50%, #1a1a2e 100%);
    color: #00ff41;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    border-top: 2px solid #00d4ff;
    border-bottom: 2px solid #ff006e;
    text-shadow: 0 0 10px #00ff41;
}

/* 2. GRID DE PRODUCTOS (Layout responsivo ARREGLADO) */
.product-grid {
    display: grid;
    /* La magia: auto-fit crea las columnas necesarias que tengan al menos 280px */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 5%;
}

/* 3. TARJETAS con Flexbox (Alineación vertical interna) */
.card {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    display: flex;
    flex-direction: column; /* Contenido en columna */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: #00ff41;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.4);
}

/* IMÁGENES ARREGLADAS para que no se recorten */
.card-img {
    background-color: #ffffff; /* Fondo blanco neutro para todos los productos */
    border-bottom: 2px solid #00d4ff;
}

.card-img img {
    width: 100%;
    height: 200px;
    object-fit: contain; /* Muestra el producto entero sin recortarlo */
    padding: 15px; /* Da un poco de aire (margen interno) a la imagen */
    box-sizing: border-box;
}

.card-content {
    padding: 20px;
    flex-grow: 1; /* Hace que el contenido ocupe el espacio disponible */
    display: flex;
    flex-direction: column;
    color: #e0e0e0;
}

.card-content h3 {
    color: #00ff41;
    margin-top: 0;
    margin-bottom: 10px;
}

.price {
    font-weight: bold;
    font-size: 1.2rem;
    margin: 10px 0;
    color: #00d4ff;
    text-shadow: 0 0 8px #00d4ff;
}

/* El botón siempre se queda abajo gracias a margin-top: auto */
.btn-add {
    margin-top: auto;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff41 100%);
    color: #0a0e27;
    border: 2px solid #00ff41;
    padding: 12px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-add:hover {
    background: linear-gradient(135deg, #00ff41 0%, #00d4ff 100%);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    transform: scale(1.05);
}

/* BOTÓN DE CAMBIO DE TEMA */
.theme-btn {
    background: none;
    border: 2px solid #00d4ff;
    color: #00ff41;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    transform: rotate(20deg);
}

/* SECCIÓN NEWSLETTER */
.newsletter-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    padding: 40px 5%;
    text-align: center;
    border-top: 2px solid #00d4ff;
    margin: 40px 0;
}

.newsletter-section h2 {
    color: #00ff41;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    text-shadow: 0 0 10px #00ff41;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #00d4ff;
    border-radius: 25px;
    background: #0a0e27;
    color: #00ff41;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.newsletter-form input::placeholder {
    color: #00d4ff;
    opacity: 0.6;
}

.btn-subscribe {
    padding: 12px 30px;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff41 100%);
    color: #0a0e27;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-subscribe:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
}

.form-message {
    display: block;
    width: 100%;
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-message.success {
    color: #00ff41;
    text-shadow: 0 0 8px #00ff41;
}

.form-message.error {
    color: #ff006e;
    text-shadow: 0 0 8px #ff006e;
}

/* FOOTER */
.main-footer {
    background: #0f0f1e;
    border-top: 3px solid #00d4ff;
    padding: 30px 5%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: #00d4ff;
    font-size: 0.9rem;
}

.copyright p {
    margin: 0;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: #00ff41;
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #00d4ff;
    border-radius: 50%;
}

.social-links a:hover {
    background: rgba(0, 255, 65, 0.1);
    color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
    transform: translateY(-5px);
}

/* =========================================================
   MEDIA QUERIES - REQUISITO DEL EJERCICIO (Responsividad)
   ========================================================= */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    h1 {
        font-size: 1.5rem;
    }

    .product-grid {
        padding: 20px 5%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* TEMA CLARO */
body.light-theme {
    background-color: #f5f5f5;
    color: #333;
}

body.light-theme .main-header {
    background: #ffffff;
    border-bottom-color: #0066cc;
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.2);
}

body.light-theme .nav-links a {
    color: #0066cc;
}

body.light-theme .nav-links a:hover {
    color: #004499;
    text-shadow: none;
}

body.light-theme .theme-btn {
    border-color: #0066cc;
    color: #0066cc;
}

body.light-theme .theme-btn:hover {
    background: rgba(0, 102, 204, 0.1);
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.3);
}

body.light-theme .banner {
    background: #e8f0ff;
    color: #0066cc;
    border-top-color: #0066cc;
    border-bottom-color: #ff6600;
    text-shadow: none;
}

body.light-theme .card {
    background: #ffffff;
    border-color: #0066cc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-theme .card:hover {
    border-color: #ff6600;
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.2);
}

body.light-theme .card-img {
    border-bottom-color: #0066cc;
}

body.light-theme .card-content h3 {
    color: #0066cc;
}

body.light-theme .price {
    color: #ff6600;
    text-shadow: none;
}

body.light-theme .btn-add {
    background: linear-gradient(135deg, #0066cc 0%, #ff6600 100%);
    color: #ffffff;
    border-color: #ff6600;
}

body.light-theme .btn-add:hover {
    background: linear-gradient(135deg, #ff6600 0%, #0066cc 100%);
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.4);
}

body.light-theme .newsletter-section {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f8ff 100%);
    border-top-color: #0066cc;
}

body.light-theme .newsletter-section h2 {
    color: #0066cc;
    text-shadow: none;
}

body.light-theme .newsletter-form input {
    border-color: #0066cc;
    background: #ffffff;
    color: #333;
}

body.light-theme .newsletter-form input:focus {
    border-color: #ff6600;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.3);
}

body.light-theme .newsletter-form input::placeholder {
    color: #0066cc;
}

body.light-theme .btn-subscribe {
    background: linear-gradient(135deg, #0066cc 0%, #ff6600 100%);
    color: #ffffff;
}

body.light-theme .form-message.success {
    color: #00aa00;
    text-shadow: none;
}

body.light-theme .form-message.error {
    color: #cc0000;
    text-shadow: none;
}

body.light-theme .main-footer {
    background: #ffffff;
    border-top-color: #0066cc;
}

body.light-theme .copyright {
    color: #0066cc;
}

body.light-theme .social-links a {
    color: #0066cc;
    border-color: #0066cc;
}

body.light-theme .social-links a:hover {
    background: rgba(0, 102, 204, 0.1);
    color: #ff6600;
    box-shadow: 0 0 15px rgba(0, 102, 204, 0.3);
}

/* 1. Nos aseguramos de que nada sobresalga del contenedor */
.paco {
    overflow: hidden;
    width: 100%;
    height: 200px;
    object-fit: cover !important;
    padding: 0 !important;
    
    /* ESTA ES LA LÍNEA MÁGICA QUE QUITA LA FRANJA BLANCA 👇 */
    display: block;
}

/* 2. Forzamos a la imagen de dentro a ocupar todo en modo 'cover' */
.paco img {
    width: 100%;
    height: 200px; /* Mantiene la misma altura que el resto de tu tienda */
    object-fit: cover !important; /* Rellena todo el espacio, recortando si es necesario */
    padding: 0 !important; /* Elimina el borde blanco (padding) que tienen las demás */
}


/* =========================================
   ESTILOS DE LA PÁGINA DEL CARRITO
   ========================================= */
.cart-container { padding: 40px 5%; min-height: 60vh; }
.cart-container h2 { color: #00ff41; text-shadow: 0 0 8px #00ff41; }
.cart-list { list-style: none; padding: 0; }
.cart-list li { margin: 10px 0; padding: 15px; background: #1a1a2e; border: 1px solid #00d4ff; border-radius: 6px; }
.empty { color: #ff006e; font-size: 1.2rem; margin-top: 20px;}
.back-home { color: #00ff41; text-decoration: none; font-weight: bold; display: inline-block; margin-top: 20px; }
.back-home:hover { text-shadow: 0 0 8px #00ff41; }

.btn-clear {
    background: linear-gradient(135deg, #ff006e 0%, #ff5e00 100%);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.btn-clear:hover {
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.6);
    transform: scale(1.05);
}