/*
 * Hoja de Estilos Principal para sportshoes502.com
 * Enfoque: Minimalista, Ligero, Responsivo y con Animaciones sutiles.
 */

/* 1. Variables y Reseteo Básico */
:root {
    --color-primario: #0a0a0a; /* Negro/Carbón */
    --color-secundario: #f0f0f0; /* Gris claro */
    --color-acento: #007bff;   /* Azul para acentos */
    --color-error: #dc3545; /* Rojo para alertas */
    --fuente-principal: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --ancho-maximo: 1200px;
    --transition-default: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--fuente-principal);
    background-color: #ffffff;
    color: var(--color-primario);
    line-height: 1.6;
}

a {
    color: var(--color-primario);
    text-decoration: none;
    transition: var(--transition-default);
}
/* Quitar el subrayado de los enlaces de las tarjetas */
a.product-card-link,
a.product-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--ancho-maximo);
    margin: 0 auto;
    padding: 0 20px;
}

/* 1.5 Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.5s ease-out;
}


/* 2. Cabecera y Navegación */
.main-header {
    border-bottom: 1px solid var(--color-secundario);
    padding: 20px 0;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 25px;
}

.main-nav ul li a {
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--color-acento);
}

.header-cart .cart-icon {
    font-size: 1.4rem;
    position: relative;
    top: 2px;
}
.header-cart .cart-count {
    background: var(--color-acento);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    vertical-align: top;
    margin-left: -8px;
    font-weight: 700;
}

/* Menú Hamburguesa (Oculto por defecto) */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 110;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-primario);
    margin: 5px 0;
    transition: var(--transition-default);
}
/* Animación de la Hamburguesa a 'X' */
.hamburger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 3. Contenido Principal */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 4. Cuadrícula de Productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid var(--color-secundario);
    border-radius: 5px;
    overflow: hidden;
    transition: var(--transition-default);
    display: flex;
    flex-direction: column; /* Asegura que el info ocupe el espacio */
    background: #fff;
}

.product-card-link:hover .product-card {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 250px; /* Alto fijo para la imagen */
    object-fit: cover; /* Asegura que la imagen cubra el espacio */
    background-color: var(--color-secundario); /* Placeholder si no hay imagen */
    transition: transform 0.3s ease;
}
.product-card-link:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    flex-grow: 1; /* El info crece para llenar el card */
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 5px 0;
    flex-grow: 1; /* El nombre crece para alinear los botones */
}
.product-name a {
    color: inherit;
    text-decoration: none;
}
.product-name a:hover {
    color: var(--color-acento);
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-acento);
    margin-bottom: 15px;
}

/* 5. Sección "Acerca de" */
.about-us {
    background-color: var(--color-secundario);
    padding: 40px 0;
    margin-top: 40px;
}

.about-us .container {
    max-width: 800px; /* Más estrecho para legibilidad */
    text-align: center;
}

/* 6. Pie de Página */
.main-footer {
    border-top: 1px solid var(--color-secundario);
    padding: 30px 0;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* 7. Botones y Formularios */
.btn {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition-default);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-primary {
    background-color: var(--color-primario);
    color: #ffffff;
    width: 100%; /* Botones de ancho completo */
}
.btn-primary:hover {
    background-color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-secondary {
    background-color: var(--color-secundario);
    color: var(--color-primario);
}
.btn-secondary:hover {
    background-color: #ddd;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: inherit;
}
.form-control-small {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* 8. Catálogo y Filtros */
.catalog-container {
    display: flex;
    gap: 30px;
}

.filter-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.product-list {
    flex-grow: 1;
}

.filter-widget {
    margin-bottom: 30px;
}

.filter-widget h4 {
    border-bottom: 2px solid var(--color-secundario);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.filter-widget ul {
    list-style: none;
}

.filter-widget ul li a {
    display: block;
    padding: 5px 0;
    color: #555;
}

.filter-widget ul li a:hover,
.filter-widget ul li a.filtro-activo {
    color: var(--color-acento);
    font-weight: 500;
    transform: translateX(3px);
}

/* 9. Carrito de Compras */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    border-bottom: 1px solid var(--color-secundario);
    text-align: left;
    vertical-align: middle;
}

.cart-table th {
    background-color: #f9f9f9;
}

.cart-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info a {
    font-weight: 600;
    font-size: 1.1rem;
}
.cart-item-info span {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    display: block;
}

.btn-update {
    background: none;
    border: none;
    color: var(--color-acento);
    cursor: pointer;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
    padding: 0;
}

.btn-remove {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-error);
}
.btn-remove:hover {
    color: #a00;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: bold;
}

.cart-actions {
    display: flex;
    gap: 15px;
}

/* 10. PÁGINA DE PRODUCTO (NUEVO) */
.product-page-container {
    display: flex;
    gap: 40px;
}

.product-gallery {
    width: 50%;
    flex-shrink: 0;
}

.product-gallery-main img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--color-secundario);
    aspect-ratio: 1 / 1; /* Mantiene la imagen cuadrada */
}

.product-gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap; /* Permite que las miniaturas se ajusten */
}

.product-gallery-thumbnails .thumbnail-image {
    width: 80px;
    height: 80px;
    border: 2px solid var(--color-secundario);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-default);
}

.product-gallery-thumbnails .thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.product-gallery-thumbnails .thumbnail-image:hover {
    border-color: #aaa;
}
.product-gallery-thumbnails .thumbnail-image.active-thumbnail {
    border-color: var(--color-acento);
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

.product-details {
    width: 50%;
}

.product-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 5px 0 10px 0;
}

.product-price-detail {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--color-acento);
    display: block;
    margin-bottom: 20px;
}

.product-description {
    margin-bottom: 25px;
}
.product-description h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-secundario);
    padding-bottom: 5px;
}
.product-description p {
    color: #333;
    line-height: 1.7;
}

.product-form-add {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}

.btn-add-to-cart {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
}

.stock-info {
    display: block;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #28a745; /* Verde para disponible */
}
.stock-info.stock-out {
    color: var(--color-error); /* Rojo para agotado */
}


/* 11. --- MEDIA QUERIES RESPONSIVAS --- */

/* Tabletas y Menús (max-width: 992px) */
@media (max-width: 992px) {
    /* Mostrar Menú Hamburguesa */
    .hamburger {
        display: block;
    }
    
    /* Ocultar navegación principal y prepararla para móvil */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 105;
        
        display: flex;
        justify-content: center;
        align-items: center;

        /* Oculto por defecto */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: all 0.3s ease-in-out;
    }

    /* Estilo del menú cuando está activo */
    .main-nav.nav-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav ul li {
        margin: 20px 0;
    }
    
    .main-nav ul li a {
        font-size: 1.5rem;
    }
    
    /* Ajuste del carrito (para que no se mueva por la hamburguesa) */
    .header-cart {
        order: 2; /* Pone el carrito antes de la nav (que está oculta) */
    }
    .main-nav {
        order: 3;
    }
    .hamburger {
        order: 4;
    }
    
    /* Página de Catálogo */
    .catalog-container {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
    }
    
    /* Página de Producto */
    .product-page-container {
        flex-direction: column;
    }
    .product-gallery,
    .product-details {
        width: 100%;
    }
}

/* Móviles (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .section-title {
        font-size: 1.5rem;
    }
    
    /* Tabla de Carrito Responsiva */
    .cart-table thead {
        display: none; /* Ocultar cabecera */
    }
    
    .cart-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid var(--color-secundario);
        border-radius: 5px;
        overflow: hidden;
    }
    
    .cart-table td {
        display: block;
        text-align: right; /* Alinea el contenido a la derecha */
        position: relative;
        padding-left: 50%; /* Espacio para la etiqueta */
        border: none;
        border-bottom: 1px dashed var(--color-secundario);
    }
    
    .cart-table td:last-child {
        border-bottom: none;
    }
    
    /* Añadir etiquetas a las celdas usando 'data-label' (requiere JS o CSS 'content') */
    .cart-table td:before {
        content: attr(data-label); /* Necesitamos añadir data-label="" en el HTML o ser más creativos */
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
    }
    
    /* (Corrección) Añadamos las etiquetas directamente aquí */
    .cart-table td.cart-item-image { padding: 10px; } /* Imagen no necesita etiqueta */
    .cart-table td.cart-item-info { text-align: left; padding: 10px; }
    
    .cart-table td.cart-item-info:before { content: ''; }
    .cart-table td.cart-item-image:before { content: ''; }
    
    .cart-table td:nth-of-type(3):before { content: 'Precio'; }
    .cart-table td:nth-of-type(4):before { content: 'Cantidad'; }
    .cart-table td:nth-of-type(5):before { content: 'Subtotal'; }
    .cart-table td:nth-of-type(6):before { content: 'Quitar'; }
    
    .cart-item-quantity {
        text-align: right;
    }
    
    .cart-summary {
        flex-direction: column;
        gap: 20px;
    }
    .cart-actions {
        width: 100%;
        flex-direction: column;
    }
}
/*
 * 12. ESTILOS DE CHECKOUT Y PÁGINA DE GRACIAS
 */

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.checkout-container {
    display: flex;
    gap: 40px;
}
.checkout-form {
    flex: 2; /* 2/3 del espacio */
}
.checkout-summary {
    flex: 1; /* 1/3 del espacio */
    background: #f9f9f9;
    padding: 25px;
    border-radius: 5px;
    position: sticky; /* Se queda fijo al hacer scroll */
    top: 100px;
}

.checkout-summary h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 20px 0;
}
.summary-total .total-price {
    font-size: 1.5rem;
    color: var(--color-acento);
}

.payment-options h4 {
    margin-bottom: 15px;
}
.payment-option {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition-default);
}
.payment-option:has(input:checked) {
    border-color: var(--color-acento);
    background-color: #f0f7ff;
    box-shadow: 0 0 10px rgba(0,123,255,0.1);
}
.payment-option input[type="radio"] {
    margin-right: 10px;
    vertical-align: top;
}
.payment-option label {
    cursor: pointer;
    display: inline-block;
    width: 90%;
}
.payment-option label strong {
    display: block;
}
.payment-option label span {
    font-size: 0.9rem;
    color: #555;
}

/* 13. PÁGINA DE GRACIAS */
.thank-you-page {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.order-number {
    font-size: 1.3rem;
    margin-bottom: 30px;
}
.order-number strong {
    color: var(--color-acento);
}

.payment-instructions {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    text-align: left;
    border: 1px solid var(--color-secundario);
}
.payment-instructions h3 {
    margin-top: 0;
}
.bank-details {
    list-style: none;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px dashed #ccc;
}
.bank-details li {
    margin-bottom: 10px;
}
.payment-important {
    color: var(--color-primario);
    font-weight: 500;
    margin-top: 20px;
}

/* 14. RESPONSIVE CHECKOUT */
@media (max-width: 992px) {
    .checkout-container {
        flex-direction: column;
    }
    .checkout-summary {
        position: static; /* Quitar sticky en móvil */
        order: -1; /* Mover el resumen arriba en móvil */
    }
}