/* ==========================================================================
   TIPOGRAFÍA GLOBAL NATIVA (Cero peticiones externas)
   ========================================================================== */
:root {
    /* Tipografía sin serifas (Para textos generales, precios, botones) */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    
    /* Tipografía con serifas (Opcional, para el título principal "Products" que vi en tu diseño) */
    --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

body {
    font-family: var(--font-sans) !important; /* El !important pisa cualquier estilo residual del tema Astra */
    color: #111111;
    -webkit-font-smoothing: antialiased; /* Suaviza las fuentes en Mac/iOS */
    -moz-osx-font-smoothing: grayscale;
}

/* Aplicar la fuente serif solo a los títulos principales si lo deseas */
h1, .clics-shop-title {
    font-family: var(--font-serif) !important;
}

/* ==========================================================================
   RESET DE CONTENEDORES ASTRA (Solo para la Home)
   ========================================================================== */

/* Rompemos la caja invisible que genera get_header() */
/* Afectamos SOLO al contenedor del contenido principal, salvando al header y footer */
.home .site-content,
.home .site-content .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Estilos para tu main personalizado */
.clics-home-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.fst-section-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px; /* Cambiado de 10px a 24px para unificar con Categorías */
    min-height: 80vh;
}

/* El fst-section-card queda igual, pero asegúrate de que tenga box-sizing */
.fst-section-card {
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    padding: 20px;
    flex: 1;
    height: 80vh;
    border-radius: 20px; /* Opcional: para que haga juego con el border-radius: 20px de los productos */
    box-sizing: border-box;
}

.fst-section-card:nth-child(1) {
    background-image: url('assets/images/phones-cover.png');
    background-size: cover;
    background-position: center;
}

.fst-section-card:nth-child(2) {
    background-image: url('assets/images/accesorio-cover-estilo-apple.png');
    background-size: cover;
    background-position: center;
}

/* ==========================================================================
   TIPOGRAFÍA DINÁMICA (Fluida)
   ========================================================================== */

/* 1. Títulos (H2) */
.fst-section-card h2 {
    color: #1A1A1A;
    /* Mínimo 32px (2rem), ideal 4% del ancho de pantalla, Máximo 72px (4.5rem) */
    font-size: clamp(2rem, 3vw, 4.5rem); 
}

/* 2. Párrafos (Subtítulos) */
.fst-section-card p {
    color: #333333;
    /* Mínimo 16px (1rem), ideal 1.5% del ancho de pantalla, Máximo 24px (1.5rem) */
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    max-width: 80%;
    text-align: center;
}

.fst-section-card .btn {
    /* Mínimo 14px (0.9rem), ideal 1.2% de la pantalla, Máximo 18px (1.1rem) */
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    background-color: #ffffff; /* fondo blanco por defecto */
    color: #000000; /* texto negro por defecto */
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Botones dentro de las tarjetas de producto: fondo blanco y texto negro por defecto */
.producto-card .btn,
.producto-card .button,
.producto-card a.button {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    background-color: #ffffff;
    color: #000000;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
}

/* Hover: fondo negro y texto blanco */
.fst-section-card .btn:hover,
.producto-card .btn:hover,
.producto-card .button:hover,
.producto-card a.button:hover {
    background-color: #000000;
    color: #ffffff;
    transform: translateY(-2px);
    text-decoration: none;
}

/* ==========================================================================
   SECCIÓN PRODUCTOS
   ========================================================================== */

.productos-titulo {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 400;
    color: #1D1D1F;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Card ── */
.producto-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
}

/* ── Imagen: el cuadro grande con bordes redondeados ── */
.producto-imagen {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* Llena el cuadro como en el Figma */
    display: block;
    transition: transform 0.4s ease;
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.03);
}

/* ── Info debajo de la imagen ── */
.producto-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
}

.producto-nombre {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    font-weight: 400;
    color: #1D1D1F;
    line-height: 1.4;
    margin: 0;
}

.producto-precio {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    font-weight: 700;
    color: #1D1D1F;
}

/* WooCommerce pone el precio dentro de <span class="woocommerce-Price-amount"> */
.producto-precio .woocommerce-Price-amount {
    color: #1D1D1F !important;
}

/* Contenedor principal de las tarjetas */
.categories-section {
    display: grid;
    /* Definimos exactamente 2 columnas del mismo ancho */
    grid-template-columns: repeat(2, 1fr); 
    gap: 24px;
    padding: 60px 20px;
    max-width: 1900px;
    margin: 0 auto;
}

/* La tarjeta individual */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el texto horizontalmente */
    text-align: center;
    overflow: hidden; /* Corta la imagen si sobresale abajo */
    background-color: #f5f5f7; /* Color de fondo base claro de Apple */
    height: 500px; /* Altura sugerida para que todas sean iguales */
    padding-top: 40px; /* Espacio desde arriba */
    position: relative;
    /* Si querés el fondo de colores de la imagen, acá iría un background-image o linear-gradient */
}

/* Contenedor del texto y botón */
.card-content {
    z-index: 2; /* Mantiene el texto por encima del fondo */
    padding: 0 20px;
    max-width: 80%;
}

/* Estilo básico para asimilarse al texto de Apple */
.card-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-content p {
    font-size: 17px;
    margin-bottom: 16px;
    color: #1d1d1f;
}

/* El botón azul */
.btn {
    display: inline-block;
    background-color: #0071e3;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

/* Contenedor de la imagen convertido en capa de fondo */
.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Se queda por debajo de .card-content que tiene z-index: 2 */
}

/* La imagen llenando todo el espacio */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Hace que la imagen cubra todo el div sin achatarse ni estirarse */
    object-position: center bottom; /* Mantiene el reloj enfocado en la parte inferior si la tarjeta cambia de tamaño */
    display: block;
}

/* --- LA CLASE CLAVE QUE FALTABA PARA OCUPAR TODA LA FILA --- */
.full-row {
    grid-column: 1 / -1; 
}

/* --- Ajustes finos de posición de imágenes --- */

/* Bajamos un poco los parlantes y auriculares */
.card-parlantes .card-image img,
.card-auriculares .card-image img {
    /* Cambiar center bottom por un porcentaje. 
       Probá bajar o subir este número (ej: 20%, 50%, 0%) hasta que quede a tu gusto */
    object-position: center 70%; 
}

/* Bajamos el micrófono */
.card-microfonos .card-image img {
    object-position: center 30%;
}

/* --- Corrección de contraste para Micrófonos --- */
.card-microfonos .card-content h2,
.card-microfonos .card-content p {
    color: #ffffff; /* Texto blanco para que resalte en el fondo oscuro */
}

/* Si querés que el texto del botón también resalte más en el fondo oscuro */
.card-microfonos .btn {
    background-color: #ffffff;
    color: #000000;
}

/* ----------------------------------------- */
/* RESPONSIVE: Adaptación para Celulares     */
/* ----------------------------------------- */
@media (max-width: 768px) {
    .categories-section {
        /* En pantallas chicas, pasamos a 1 sola columna */
        grid-template-columns: 1fr; 
    }
    
    .full-row {
        /* Reseteamos el comportamiento para que no intente ocupar 2 columnas que ya no existen */
        grid-column: auto; 
    }
    
    /* Achicamos un poco el alto de las tarjetas en mobile */
    .category-card {
        height: 450px; 
    }
}

/* ==========================================================================
   TIENDA — LAYOUT
   ========================================================================== */

.woocommerce-page .site-content,
.woocommerce-page .ast-container,
.woocommerce .site-content,
.woocommerce .ast-container {
    max-width: 100% !important;
    padding: 0 40px !important;
    box-sizing: border-box !important;
}

/* El ast-container ya es flex por Astra — solo ajustamos el gap */
.ast-left-sidebar .ast-container {
    gap: 48px !important;
    align-items: flex-start !important;
}

/* Sidebar */
body.ast-left-sidebar #secondary {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    flex-shrink: 0 !important;
    border-right: 1px solid #E5E5EA !important;
    padding-right: 32px !important;
    margin: 40px 0 !important;
}

/* Área de productos — pisa el width: 70% de Astra */
body.ast-left-sidebar #primary {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-left: none !important;
    padding-left: 0 !important;
    margin: 40px 0 !important;
}

/* Eliminamos el flex que Astra pone en #primary incorrectamente */
body.ast-left-sidebar #primary.content-area {
    display: block !important;
}

/* ── Grid de productos ── */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
}

.woocommerce ul.products li.product a {
    text-decoration: none !important;
}

/* ── Cards ── */
.clics-card__imagen {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background-color: #F5F5F7;
    margin-bottom: 12px;
}

.clics-card__imagen img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

.woocommerce ul.products li.product:hover .clics-card__imagen img {
    transform: scale(1.03);
}

.clics-card__categoria {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #86868B;
    display: block;
    margin-bottom: 4px;
}

.clics-card__titulo {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: #1D1D1F !important;
    line-height: 1.4 !important;
    margin: 0 0 6px 0 !important;
}

.clics-card__precio {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1D1D1F;
    margin-bottom: 12px;
}

.clics-card__precio .woocommerce-Price-amount {
    color: #1D1D1F !important;
}

.clics-card__boton {
    display: inline-block !important;
    padding: 9px 20px !important;
    border-radius: 980px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    background-color: #1D1D1F !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;
}

.clics-card__boton:hover {
    opacity: 0.8 !important;
    color: #ffffff !important;
}

.clics-card__boton--consulta {
    background-color: #F5F5F7 !important;
    color: #1D1D1F !important;
}

/* ── Widget sidebar ── */
#secondary .widget-title,
#secondary h2 {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #1D1D1F !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #E5E5EA !important;
}

#secondary .widget_product_categories ul,
#secondary .wp-block-woocommerce-product-categories ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0
}

.fst-section-container,
.productos-section,
.categories-section {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 20px;
    box-sizing: border-box;
}