/*
Theme Name: U-TECH Base
Theme URI: https://fnat.site/
Description: Un tema completamente en blanco, construido desde cero para control total.
Author: FNAT & IA
Version: 2.7.0
Text Domain: utech-base
*/

/* ==========================================================================
   RESET CSS & TIPOGRAFÍA GLOBAL (Cero Negritas)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #fcfcfc; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333333;
    line-height: 1.5;
    font-weight: 400 !important; 
}

.utech-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   CABECERA PRINCIPAL
   ========================================================================== */

.header-top-bar {
    background-color: #e6e6e6;
    color: #333333;
    text-align: center;
    padding: 4px 0;
    font-size: 14px;
}
.header-top-bar p { margin: 0; line-height: 1.2; }

.header-main-bar {
    background-color: #1e293b; 
    padding: 12px 0; 
}

.header-main-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.header-logo { flex: 0 0 auto; }
.header-logo a { text-decoration: none; }
.logo-text { color: #ffffff; font-size: 32px; letter-spacing: -1px; }

.header-search { flex: 1 1 auto; max-width: 800px; }
.search-form { display: flex; background-color: #ffffff; border-radius: 4px; overflow: hidden; height: 42px; }
.search-field { flex: 1; border: none; padding: 0 20px; font-size: 15px; color: #333333; outline: none; }
.search-field::placeholder { color: #999999; }
.search-submit { background-color: #ffffff; border: none; padding: 0 20px; cursor: pointer; color: #1e293b; font-size: 18px; border-left: 1px solid #e0e0e0; }

.header-actions { display: flex; align-items: center; gap: 20px; color: #ffffff; }
.header-account { display: flex; align-items: center; gap: 10px; }
.header-account i { font-size: 22px; }
.account-text { display: flex; flex-direction: column; line-height: 1.2; }
.greeting { font-size: 12px; }
.login-link { color: #ffffff; text-decoration: none; font-size: 14px; }
.header-divider { width: 1px; height: 25px; background-color: rgba(255, 255, 255, 0.2); }
.header-cart a { color: #ffffff; text-decoration: none; display: flex; align-items: center; transition: opacity 0.2s; }
.header-cart a:hover { opacity: 0.8; }
.header-cart i { font-size: 22px; }

/* ==========================================================================
   BARRA INFERIOR DE MENÚ (Estilo Base Minimalista)
   ========================================================================== */
.header-bottom-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    padding: 4px 0; 
}

.primary-navigation .nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px; 
    margin: 0;
    padding: 0;
}

.primary-navigation .nav-item { position: relative; }

.primary-navigation .nav-btn {
    display: block;
    padding: 4px 10px; 
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    background-color: transparent; 
    border: 1px solid transparent;
    border-radius: 6px; 
    transition: all 0.2s ease;
}

.primary-navigation .nav-btn:hover {
    background-color: #f8f9fa;
    color: #1e293b;
}

.primary-navigation .sub-menu {
    display: none; 
    position: absolute;
    background-color: #ffffff;
    min-width: max-content;
    white-space: nowrap; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    border: 1px solid #f0f0f0;
    border-radius: 8px; 
    padding: 6px; 
    z-index: 100;
    flex-direction: column;
}

.primary-navigation .sub-item { position: relative; width: 100%; }

.primary-navigation .sub-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 8px 14px; 
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px; 
    transition: all 0.2s ease;
}

.primary-navigation .sub-link:hover,
.primary-navigation .sub-link:focus {
    background-color: #f8f9fa;
    color: #111827;
}

@media (min-width: 993px) {
    .primary-navigation .nav-item > .sub-menu { top: 100%; left: 0; margin-top: 8px; }
    .primary-navigation .nested-menu { top: 0; left: 100%; margin-top: -7px; margin-left: 4px; }

    @keyframes fadeInMenuDesktop {
        from { opacity: 0; transform: translateY(-5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .primary-navigation .nav-item:hover > .sub-menu,
    .primary-navigation .sub-item:hover > .sub-menu { display: flex; animation: fadeInMenuDesktop 0.2s ease; }

    .primary-navigation .nav-item > .sub-menu::before { content: ''; position: absolute; top: -10px; left: 0; width: 100%; height: 10px; }
    .primary-navigation .nested-menu::after { content: ''; position: absolute; top: -10px; bottom: -10px; left: -15px; width: 15px; z-index: -1; }
}

/* ==========================================================================
   DISEÑO DE PRODUCTO INDIVIDUAL WOOCOMMERCE (Estructura Fiel al Modelo)
   ========================================================================== */

.woocommerce div.product {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1300px; /* Un poco más ancho para las 3 columnas */
    margin: 40px auto 80px auto;
    gap: 30px;
}

/* COLUMNA 1: IMAGEN (Estilo Tarjeta Blanca) */
.woocommerce div.product div.images {
    width: 40%; /* Ancho fijo igual al modelo */
    background: #ffffff;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: none; 
}

.woocommerce div.product div.images img { 
    width: 100%; 
    height: auto; 
    max-height: 400px; /* Evita que crezca desproporcionadamente */
    object-fit: contain;
    display: block; 
    border-radius: 4px;
    border: none; 
}

/* Miniaturas Restringidas Estrictamente en Cuadrícula */
.woocommerce div.product div.images .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Fuerza 5 columnas exactas */
    gap: 10px;
    margin-top: 20px;
    padding: 0;
}
.woocommerce div.product div.images .flex-control-thumbs li {
    list-style: none;
    width: 100%; 
}
.woocommerce div.product div.images .flex-control-thumbs img {
    width: 100%;
    height: 60px !important; /* Altura fija para no desordenar la cuadrícula */
    object-fit: contain;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6; 
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    padding: 4px;
}
.woocommerce div.product div.images .flex-control-thumbs img:hover,
.woocommerce div.product div.images .flex-control-thumbs img.flex-active {
    opacity: 1;
    border-color: #111827; 
}

/* CONTENEDOR COLUMNAS 2 Y 3 (Info y Acción) */
.woocommerce div.product div.summary {
    width: calc(60% - 30px); /* Ocupa el resto del espacio */
    display: block;
    float: none;
}

.utech-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px; /* Info fluida, Acción fija (más estrecha como modelo) */
    gap: 20px;
    align-items: start; /* CRÍTICO: Evita que se estiren las tarjetas y queden vacías */
}

/* COLUMNA 2: INFORMACIÓN CENTRAL */
.utech-info-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.woocommerce div.product .product_title {
    font-size: 22px; /* Más proporcionado al modelo */
    font-weight: 600 !important;
    color: #111827; 
    margin-bottom: 12px;
    line-height: 1.3;
    text-transform: uppercase; /* Como en tu modelo de Samsung */
}

.woocommerce div.product .product_meta { 
    font-size: 13px; 
    color: #6b7280; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb; /* Línea separadora idéntica al modelo */
}
.woocommerce div.product .product_meta a { color: #374151; text-decoration: none; font-weight: 500 !important; }
.woocommerce div.product .product_meta span.sku_wrapper, 
.woocommerce div.product .product_meta span.posted_in { display: flex; gap: 5px; }

.woocommerce div.product p.price {
    font-size: 24px;
    color: #374151; 
    font-weight: 600 !important;
    margin-top: 0; 
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.utech-iva-text {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
}

/* COLUMNA 3: CAJA DE ACCIÓN / COTIZACIÓN */
.utech-action-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.woocommerce div.product .stock {
    color: #059669; 
    font-size: 14px;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 500 !important;
}

.woocommerce div.product form.cart {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
    border: none; 
}

/* Ajuste de cantidad estilo modelo */
.woocommerce div.product form.cart .quantity {
    display: flex;
    justify-content: space-between; /* Texto a la izq, caja a la der */
    align-items: center;
    width: 100%;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb; /* Separador antes del botón */
    margin-bottom: 5px;
}
.woocommerce div.product form.cart .quantity::before {
    content: 'Cantidad:';
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}
.woocommerce div.product form.cart .quantity input.qty {
    width: 70px;
    height: 40px; 
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
    color: #111827;
    background-color: #ffffff;
    outline: none;
}

.woocommerce div.product form.cart .button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px; 
    background-color: #374151; 
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500 !important;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.woocommerce div.product form.cart .button:hover {
    background-color: #111827; 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.woocommerce-product-gallery__trigger { display: none !important; }

/* ==========================================================================
   ALERTAS Y VALORACIONES
   ========================================================================== */

.woocommerce-message {
    background-color: #f0fdf4; 
    color: #166534;
    padding: 16px 24px;
    border-radius: 6px;
    margin-bottom: 30px;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.woocommerce-message a.button {
    background-color: #166534;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500 !important;
}

.woocommerce div.product .woocommerce-tabs { margin-top: 40px; border-top: 1px solid #eaeaea; padding-top: 40px; width: 100%; }
.woocommerce div.product .woocommerce-tabs ul.tabs { list-style: none; padding: 0; margin: 0 0 30px 0; display: flex; gap: 30px; border-bottom: 1px solid #f0f0f0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { padding-bottom: 15px; margin-bottom: -1px; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { border-bottom: 2px solid #111827; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { text-decoration: none; color: #6b7280; font-weight: 500; font-size: 16px; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: #111827; }

/* ==========================================================================
   7. CATÁLOGO / CUADRÍCULA DE PRODUCTOS (Página de Categorías)
   ========================================================================== */

.woocommerce-products-header {
    margin-bottom: 30px;
}
.woocommerce-products-header__title {
    font-size: 28px;
    font-weight: 500;
    color: #111827;
}

.woocommerce-result-count,
.woocommerce-ordering {
    display: none !important;
}

/* Estructura Grid de la Cuadrícula - Ajustada para woocommerce.php */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 25px !important; 
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* Contenedor de la Tarjeta del Producto */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important; 
    float: none !important; 
    margin: 0 !important;
    background-color: #ffffff;
    border: 1px solid #eaeaea; 
    border-radius: 12px; 
    padding: 20px;
    text-align: left;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.woocommerce ul.products li.product img {
    width: 100% !important;
    height: 180px !important; 
    object-fit: contain !important; 
    margin-bottom: 15px !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px; 
    line-height: 1.4;
    margin: 0 0 10px 0;
    padding: 0;
    color: #333333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woocommerce ul.products li.product .price {
    margin-top: auto; 
    font-size: 16px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.woocommerce ul.products li.product .button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    background-color: transparent;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #111827;
    color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE (Celulares y Tablets)
   ========================================================================== */
@media (max-width: 992px) {
    .header-main-grid { flex-wrap: wrap; gap: 15px; }
    .account-text { display: none; }
    .header-logo { order: 1; }
    .header-actions { order: 2; margin-left: auto; }
    .header-search { order: 3; flex: 1 1 100%; max-width: 100%; }
    
    .header-top-bar { font-size: 12px; padding: 6px 10px; }
    .header-bottom-bar { padding: 8px 0; }
    
    .primary-navigation .nav-menu { width: 100%; flex-wrap: wrap; justify-content: center; gap: 6px; }

    .primary-navigation .nav-item > .sub-menu { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; max-width: 90vw; }

    .primary-navigation .nested-menu { position: static; transform: none; box-shadow: none; border: none; border-top: 1px solid #eeeeee; border-radius: 0; margin: 4px 0 0 0; padding: 4px 0 0 15px; width: 100%; }

    @keyframes fadeInMenuMobile { from { opacity: 0; transform: translate(-50%, -3px); } to { opacity: 1; transform: translate(-50%, 0); } }
    @keyframes slideDownMobile { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

    .primary-navigation .nav-item.mobile-active > .sub-menu { display: flex; animation: fadeInMenuMobile 0.2s ease-in-out; }
    .primary-navigation .sub-item.mobile-active > .nested-menu { display: flex; animation: slideDownMobile 0.2s ease-in-out; }
    .primary-navigation .sub-item.mobile-active > .sub-link i { transform: rotate(90deg); transition: transform 0.2s ease; }
    
    /* Ajustes para la nueva página de producto en móviles */
    .woocommerce div.product { flex-direction: column; gap: 20px; margin-top: 20px; margin-bottom: 40px; }
    .woocommerce div.product div.images { width: 100%; padding: 20px; }
    .woocommerce div.product div.summary { width: 100%; }
    .utech-summary-grid { grid-template-columns: 1fr; gap: 20px; }
    .utech-info-box, .utech-action-box { padding: 20px; }
    
    .woocommerce div.product .product_title { font-size: 20px; }
    
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .woocommerce ul.products li.product {
        padding: 10px !important;
    }
    .woocommerce ul.products li.product img {
        height: 120px !important;
    }
}