/*
Theme Name: C4 Medios
Version: 2.1 (Earthy Palette & Clean Architecture)
Author: C4 Medios
*/

/* ==========================================================================
   1. GLOBAL LAYOUT & BASICS
   ========================================================================== */

body { 
    margin: 0; 
    /* Cambio: De blanco puro a un blanco hueso muy suave de la paleta */
    background-color: #f5f4f1; 
    color: #422e22; /* Texto base en café oscuro */
}

a {
    text-decoration: none;
}

/* Contenedor Principal Limitado */
.site-content-inner {
    width: 80%;            
    max-width: 1200px;    
    margin: 0 auto;        
}

/* Ajuste Global de Inputs */
input[type="text"], 
input[type="email"], 
textarea {
    margin: 3px !important;
    border-radius: 3px !important;
    /* Cambio: Fondo crema suave y borde beige */
    background-color: #f3f0e4 !important; 
    border: 1px solid #d6cabc !important; 
    font-size: 15px !important;
    padding: 12px;
    width: 90%;
    color: #422e22 !important; /* Texto input café oscuro */
}

/* Overflows permitidos para elementos flotantes (Header/VC) */
#c4-header-wrapper, 
.vc_row, 
.vc_column-inner { 
    overflow: visible !important; 
}

@media (max-width: 768px) {
    .site-content-inner {
        width: 90%;
    }
}
/* Esto tiene una prioridad extremadamente alta */
body .blanco.blanco {
    color: #ffffff !important;
}

/* ==========================================================================
   2. DESKTOP NAVIGATION
   ========================================================================== */

/* Contenedor del Menú */
.c4-navigation ul { 
    list-style: none; 
    display: flex; 
    gap: 25px; 
    padding: 0; 
	justify-content: center;
    margin: 0 auto;
}

.c4-navigation li { 
    position: relative; 
    display: flex;
    align-items: center;
}

/* Enlaces Principales */
.c4-navigation a { 
    text-decoration: none; 
    font-weight: bold !important; 
    padding: 15px 0;
    display: block;
    color: #ffffff !important; /* Mantenemos blanco para contraste sobre header oscuro */
}

.vc_col-has-fill>.vc_column-inner, .vc_row-has-fill+.vc_row-full-width+.vc_row>.vc_column_container>.vc_column-inner, .vc_row-has-fill+.vc_row>.vc_column_container>.vc_column-inner, .vc_row-has-fill>.vc_column_container>.vc_column-inner {
    padding-top: 10px;
}

/* --- SUBMENÚ (Nivel 2) --- */
.c4-navigation ul li ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
	   font-size: 18px;
    /* Cambio: Fondo crema (#f3f0e4) en lugar de gris */
    background-color: #f3f0e4; 
    min-width: 200px;
    box-shadow: 0 8px 15px rgba(66, 46, 34, 0.15); /* Sombra con tono café */
    border-radius: 4px;
    padding: 10px 0;
    display: none; 
    flex-direction: column;
    z-index: 9999;
    /* Cambio: Bordes en tono café medio */
    border-top: 1px solid #6b442d;
    border-bottom: 1px solid #6b442d;
}

/* Items del Submenú */
.c4-navigation ul li ul.sub-menu li {
    position: relative; 
    display: block;
    /* Cambio: Separador beige oscuro */
    border-bottom: 1px solid #d6cabc; 
}

.c4-navigation ul li ul.sub-menu li:last-child {
    border-bottom: none;
}

.c4-navigation ul li ul.sub-menu li a {
    /* Cambio: Texto café oscuro para legibilidad */
    color: #422e22 !important; 
    font-weight: bold !important; 
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.c4-navigation ul li ul.sub-menu li a:hover {
    /* Cambio: Hover en beige suave */
    background-color: #d6cabc; 
    color: #632805 !important; /* Texto cambia al rojo-café intenso */
}

/* Mostrar al hacer Hover (Nivel 2) */
.c4-navigation ul li:hover > ul.sub-menu {
    display: flex;
}

/* --- SUB-SUB MENÚ (Nivel 3) --- */
.c4-navigation ul li ul.sub-menu li ul.sub-menu {
    top: 0;             
    left: 80%;         
    margin-top: -1px;  
    background-color: #f3f0e4; 
}

/* Mostrar al hacer Hover (Nivel 3) */
.c4-navigation ul li ul.sub-menu li:hover > ul.sub-menu {
    display: flex;
}


/* ==========================================================================
   3. MOBILE NAVIGATION (FULLSCREEN OVERLAY)
   ========================================================================== */

/* Botón Trigger (Visible solo en móvil) */
#c4-trigger-btn {
    display: none; 
    cursor: pointer;
    align-items: center;
    gap: 8px;
    padding: 10px;
}

#c4-trigger-btn .c4-hamburger {
    font-size: 28px;
    line-height: 1;
    color: #fff; 
}

#c4-trigger-btn .c4-label {
    font-weight: 700;
    color: #fff;
    font-family: sans-serif;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

/* El Overlay Fullscreen */
#c4-overlay-menu {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Cambio: Fondo Café muy oscuro con opacidad, en lugar de negro puro */
    background-color: rgba(66, 46, 34, 0.97); 
    z-index: 999999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Botón Cerrar (X) */
#c4-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 40px;
    color: #f3f0e4; /* Crema para contraste */
    cursor: pointer;
    font-weight: 300;
}

/* Estilos para el Shortcode dentro del Overlay */
.c4-menu-container {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.c4-menu-container ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.c4-menu-container li {
    margin: 20px 0;
    display: block;
}

.c4-menu-container a {
    color: #f5f4f1 !important; /* Blanco hueso */
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
}

.c4-menu-container a:hover {
    color: #bf9773 !important; /* Hover al tono Tan/Dorado suave */
}

/* Media Query para activar lógica Móvil */
@media (max-width: 768px) {
    .c4-navigation { display: none !important; }
    #c4-trigger-btn { display: flex; }
}


/* ==========================================================================
   4. WOOCOMMERCE - SINGLE PRODUCT
   ========================================================================== */

/* Contenedor */
.c4-single-container {
    width: 80%;
    margin: 50px auto;
}

/* Layout Flex (2 Columnas) */
.c4-single-container .product {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 20px !important;
}

.c4-single-container .woocommerce-product-gallery,
.c4-single-container .summary {
    width: calc(50% - 10px) !important;
    float: none !important;
    margin: 0 !important;
}

/* Galería de Imágenes */
.woocommerce-product-gallery__wrapper {
    background-color: #fff; /* Mantenemos blanco puro solo detrás de imágenes para fidelidad */
    border-radius: 20px !important;
    overflow: hidden;
    aspect-ratio: 1 / 1; 
    border: 1px solid #d6cabc; /* Borde beige */
    box-shadow: 0 0 20px rgba(66, 46, 34, 0.05); /* Sombra cálida muy sutil */
    display: flex !important;
    align-items: center !important; 
    justify-content: center !important;
}

.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Título de Producto */
.woocommerce div.product .product_title {
    clear: none;
    margin-top: 0;
    padding: 0;
    color: #422e22; /* Título café oscuro */
    border-bottom: 2px solid #bf9773; /* Subrayado en tono Tan */
}

/* Meta Data (SKU, Categorías) */
.product_meta {
    color: #6b442d !important; /* Café medio */
    font-size: 12px !important;
    font-weight: bold !important;
    text-transform: uppercase;
    margin-top: 20px;
}

.product_meta span {
    margin-bottom: 5px;
    display: block; 
}

/* Categoría (Enlaces Meta) */
.product_meta a {
    /* Cambio: Terracota anaranjado (#a8603a) para destacar enlaces */
    color: #a8603a !important; 
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.product_meta a:hover { opacity: 0.7; }

/* Descripción Corta */
.woocommerce-product-details__short-description {
    /* Gradiente sutil entre crema y blanco hueso */
    background: linear-gradient(to bottom, #f3f0e4 0%, #f5f4f1 100%) !important;
    border-radius: 15px !important;
    padding: 20px !important;
    margin-bottom: 25px !important;
    border: 1px solid #d6cabc;
    color: #422e22;
}

/* --- Productos Relacionados --- */
.c4-related-wrapper {
    margin-top: 50px;
    padding-top: 20px;
}

/* Cards de Relacionados */
.c4-related-wrapper ul.products li.product {
    background: #fff;
    border-radius: 20px !important;
    box-shadow: 0 4px 15px rgba(66, 46, 34, 0.08) !important; /* Sombra cálida */
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid #f3f0e4;
}

.c4-related-wrapper ul.products li.product:hover {
    transform: translateY(-5px);
    border-color: #bf9773; /* Borde se oscurece al hover */
}

.c4-related-wrapper ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    margin-bottom: 15px !important;
    background-color: #fff; 
}

/* Títulos Relacionados */
.c4-related-wrapper .c4-product-title, 
.c4-related-wrapper h2.woocommerce-loop-product__title {
    font-size: 16px !important;
    text-align: center !important;
    display: block;
    margin: 10px 0;
    color: #422e22;
}

.c4-related-wrapper .c4-ver-mas {
    width: 100%;
    display: block;
    /* Cambio: Rojo-Café Intenso (#632805) */
    background-color: #632805; 
    color: #f3f0e4;
    padding: 10px;
    font-size: 13px !important;
    text-align: center;
    border-radius: 20px !important; 
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.c4-related-wrapper .c4-ver-mas:hover {
    background-color: #422e22; /* Oscurece al hover */
}

/* Responsive Single Product */
@media (max-width: 768px) {
    .c4-single-container { width: 95%; }
    
    .c4-single-container .product {
        flex-direction: column !important;
    }
    
    .c4-single-container .woocommerce-product-gallery,
    .c4-single-container .summary {
        width: 100% !important;
    }
}


/* ==========================================================================
   5. WOOCOMMERCE - ARCHIVE (CATALOG)
   ========================================================================== */

/* Contenedor Principal */
.c4-catalog-container {
    width: 80%;
    margin: 40px auto;
}

/* Header de Categoría */
.woocommerce-products-header {
    margin-bottom: 40px;
    text-align: center;
}

.woocommerce-products-header__title {
    font-size: 24px;
    font-weight: bold;
    color: #422e22; /* Título principal oscuro */
    margin-bottom: 15px;
}

.c4-category-description {
    max-width: 800px;
    margin: 0 auto;
    color: #6b442d; /* Descripción en café medio */
    line-height: 1.6;
}

/* Grid System */
.c4-product-grid ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.c4-product-grid ul.products:before,
.c4-product-grid ul.products:after {
    display: none !important; 
}

/* Tarjeta de Producto (Catálogo) */
.c4-product-grid ul.products li.product {
    background: #fff;
    border-radius: 20px !important;
    box-shadow: 0 4px 15px rgba(66, 46, 34, 0.08) !important;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #f3f0e4;
}

.c4-product-grid ul.products li.product:hover {
    transform: translateY(-5px);
    border-color: #bf9773;
}

/* Imágenes Catálogo */
.c4-product-grid ul.products li.product img {
    height: 250px !important;
    width: 100% !important;
    object-fit: contain !important;
    margin-bottom: 15px !important;
    display: block;
}

/* Títulos Catálogo */
.c4-product-grid .c4-product-title,
.c4-product-grid h2.woocommerce-loop-product__title {
    font-size: 16px !important;
    color: #422e22;
    text-align: center !important;
    margin: 10px 0 15px 0;
    min-height: 40px; 
}

/* Botón Ver Más (Catálogo) */
.c4-product-grid .c4-ver-mas,
.c4-product-grid .button {
    width: 100%;
    display: block;
    /* Cambio: Rojo-Café Intenso (#632805) */
    background-color: #632805 !important;
    color: #f3f0e4 !important;
    padding: 10px;
    font-size: 13px !important;
    text-align: center;
    border-radius: 20px !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-top: auto;
    transition: background-color 0.3s;
}

.c4-product-grid .c4-ver-mas:hover {
    /* Cambio: Hover al café oscuro #422e22 */
    background-color: #422e22 !important;
}

/* Responsive Catálogo (2 Columnas) */
@media (max-width: 768px) {
    .c4-catalog-container {
        width: 95%;
    }

    .c4-product-grid ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .c4-product-grid ul.products li.product img {
        height: 180px !important; 
    }
}