/*
Theme Name: Vive Madera
Theme URI: https://vivemadera.com
Description: Tema personalizado para el taller de mobiliario paramétrico.
Author: Cristian Restrepo
Template: storefront
Version: 1.0.0
*/

/* ==========================================================
   ÍNDICE
   1. Variables corporativas
   2. Botones (WooCommerce)
   3. Cabecera: contenedor, logo, menú y layout
   4. Cabecera: nombre + eslogan
   5. Cabecera: iconos (buscador, cuenta, carrito)
   6. Mini-carrito desplegable
   7. Pie de página
   8. Ajustes por página
   ========================================================== */


/* ==========================================================
   1. VARIABLES CORPORATIVAS
   ========================================================== */
:root {
    --naranja-vm: #FE904D;
    --naranja-vm-oscuro: #e57d3c;
    --crema-vm: #f9e0c9;
    --marron-vm: #6b3f1d;
}


/* ==========================================================
   2. BOTONES (WooCommerce) - naranja de la marca
   ========================================================== */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.added_to_cart {
    background-color: var(--naranja-vm) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
}

button:hover,
.button:hover,
.added_to_cart:hover {
    background-color: var(--naranja-vm-oscuro) !important;
}


/* ==========================================================
   3. CABECERA - Logo | Menú centrado | Iconos
   ========================================================== */
.site-header {
    background-color: var(--crema-vm) !important;
    border-bottom: 1px solid #eee !important;
    padding-top: 0.8em !important;
    padding-bottom: 0.8em !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.site-header .site-branding img,
.site-header .custom-logo-link img {
    max-height: 56px;
    width: auto;
}

/* Enlaces del menú */
.site-header a,
.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a {
    color: #333333;
}

.main-navigation ul.menu > li > a:hover,
.main-navigation ul.nav-menu > li > a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a {
    color: var(--naranja-vm) !important;
}

/* Layout en escritorio.
   En functions.php unificamos el header en UN solo .col-full (mismo ancho y
   margen lateral que el contenido y el footer). Aquí lo hacemos una fila flex.
   Orden: 1 logo + nombre, 2 menú, 3 buscador, 4 cuenta, 5 carrito. */
@media (min-width: 768px) {
    .site-header .col-full {
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap;
        gap: 1.4em;
    }
    .site-header .col-full::before,
    .site-header .col-full::after {
        display: none !important;
    }

    .site-header .site-branding {
        order: 1;
        float: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .site-header .custom-logo-link,
    .site-header .custom-logo-link img {
        margin: 0 !important;
        display: block;
    }
    .site-header .vm-brand-text {
        order: 1;
        margin-left: 0.2em;
    }

    .site-header .main-navigation {
        order: 2;
        flex: 1;
        width: auto !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
    }
    .main-navigation ul.menu,
    .main-navigation ul.nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-header .site-search     { order: 3; }
    .site-header .vm-account      { order: 4; }
    .site-header .site-header-cart { order: 5; }
}


/* ==========================================================
   4. CABECERA - Nombre del sitio + eslogan junto al logo
   ========================================================== */
.vm-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    line-height: 1.1;
}
.vm-brand-name {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--marron-vm);
    white-space: nowrap; /* nombre en una sola línea */
}
.vm-brand-slogan {
    font-size: 0.75em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a6a4f;
    margin-top: 0.4em;
}
@media (max-width: 767px) {
    .vm-brand-text { display: none; }
}


/* ==========================================================
   5. CABECERA - Iconos de la derecha
   ========================================================== */
.vm-account a,
.site-header-cart .cart-contents,
.site-search .widget_product_search form::before {
    color: #333333 !important;
}

/* --- Cuenta --- */
.vm-account a {
    display: flex;
    align-items: center;
}

/* --- Buscador: solo lupa; el campo se despliega debajo, a la derecha --- */
.site-search,
.site-search .widget,
.site-search .widget_product_search {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
}
.site-search .widget_product_search form {
    position: relative;
    margin: 0 !important;
    width: 22px;
    height: 22px;
}
.site-search .widget_product_search form::before {
    position: static !important;
    display: block;
    font-size: 1.2em;
    line-height: 22px;
    cursor: pointer;
    margin: 0 !important;
}
.site-search .widget_product_search form input[type="search"] {
    position: absolute;
    right: 0;
    top: 100%;
    width: 260px;
    padding: 0.7em 1em !important;
    opacity: 0;
    visibility: hidden;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease;
}
.site-search .widget_product_search form:hover input[type="search"],
.site-search .widget_product_search form:focus-within input[type="search"] {
    opacity: 1;
    visibility: visible;
    z-index: 50;
}

/* --- Carrito: solo icono + burbuja naranja con la cantidad --- */
.site-header-cart,
.site-header-cart li {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
}
.site-header-cart {
    position: relative;
}
.site-header-cart .cart-contents {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    padding: 0 !important;
    width: auto !important;
    line-height: 1;
}
.site-header-cart .cart-contents .amount {
    display: none;
}
.site-header-cart .cart-contents::after {
    position: static !important;
    float: none !important;
    margin: 0 !important;
    font-size: 1.3em;
    line-height: 1;
}

/* Burbuja con la cantidad.
   Storefront imprime "N productos"; mostramos solo el número: el resto del
   texto pasa a una 2.ª línea que queda oculta por la altura fija (18px). */
.site-header-cart .cart-contents .count {
    position: absolute;
    top: -10px;
    right: -12px;
    display: block;
    box-sizing: border-box;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    background: var(--naranja-vm);
    color: #ffffff;
    font-size: 11px;
    line-height: 18px !important;
    text-align: center;
    opacity: 1;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: keep-all;
}


/* ==========================================================
   6. MINI-CARRITO DESPLEGABLE
   Oculto por defecto; visible solo al pasar el cursor por el icono.
   ========================================================== */
.site-header .site-header-cart .widget_shopping_cart {
    display: none !important;
    width: 320px !important;
    max-width: 90vw;
    left: auto !important;
    right: -12px;
    top: 100%;
    margin-top: 14px;
    padding: 1.2em !important;
    box-sizing: border-box;
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.5;
}
.site-header .site-header-cart:hover .widget_shopping_cart,
.site-header .site-header-cart li:hover .widget_shopping_cart,
.site-header .site-header-cart li.focus .widget_shopping_cart,
.site-header .site-header-cart:focus-within .widget_shopping_cart {
    display: block !important;
    z-index: 9999;
}

/* Puente invisible: evita que se cierre al mover el cursor hacia el panel */
.site-header-cart .widget_shopping_cart::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

.site-header-cart .widget_shopping_cart p,
.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__empty-message {
    margin: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    color: #333333;
}
.site-header-cart .widget_shopping_cart a:not(.button) {
    color: #333333 !important;
}
.site-header-cart .widget_shopping_cart .buttons {
    display: flex;
    gap: 0.5em;
    margin: 1em 0 0;
}
.site-header-cart .widget_shopping_cart .buttons .button {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0.7em 0.5em;
}


/* ==========================================================
   7. PIE DE PÁGINA - oscuro, compacto y sin iconos en enlaces
   ========================================================== */
.site-footer {
    background-color: #2b2b2b !important;
    color: #cfcfcf !important;
    padding-top: 1em !important;
    padding-bottom: 1em !important;
}

/* Colores de texto y enlaces */
.site-footer a:not(.button),
.site-footer .widget a:not(.button) {
    color: #ffffff !important;
}
.site-footer a:not(.button):hover {
    color: var(--naranja-vm) !important;
}
.site-footer h1, .site-footer h2, .site-footer h3,
.site-footer h4, .site-footer h5, .site-footer h6,
.site-footer .widget-title {
    color: #ffffff !important;
}

/* Reducir espacio vertical sobrante */
.site-footer .col-full,
.site-footer .footer-widgets,
.site-footer .footer-widgets .block,
.site-footer .widget-area {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}
.site-footer .footer-widgets {
    margin-bottom: 0 !important;
    min-height: 0 !important;
}
.site-footer .footer-widgets > *,
.site-footer .widget:first-child,
.site-footer .widget > *:first-child {
    margin-top: 0 !important;
}
.site-footer .widget {
    margin-bottom: 1em !important;
}
.site-footer .widget:last-child,
.site-footer ul:last-child {
    margin-bottom: 0 !important;
}
.site-footer .widget ul,
.site-footer .widget ul li {
    margin-bottom: 0 !important;
}
.site-footer .widget ul li {
    padding: 0.25em 0 !important;
}
/* El primer y último elemento no suman espacio extra: la distancia al borde
   del footer queda exactamente en 1em arriba y abajo. */
.site-footer .widget ul li:first-child {
    padding-top: 0 !important;
}
.site-footer .widget ul li:last-child {
    padding-bottom: 0 !important;
}
.site-footer .widget ul li a {
    padding-left: 0 !important;
}

/* Elementos vacíos o espaciadores que empujan el contenido */
.site-footer .widget-title:empty,
.site-footer .widget:empty,
.site-footer .wp-block-spacer,
.site-footer .wp-block-separator {
    display: none !important;
}

/* Sin iconos en los enlaces */
.site-footer .widget ul li::before,
.site-footer .widget ul li a::before,
.site-footer .menu li::before,
.site-footer .menu li a::before {
    display: none !important;
    content: none !important;
}

/* Iconos de redes sociales: mantener forma redonda
   (debe ir DESPUÉS de las reglas generales de listas del footer) */
.site-footer .wp-block-social-links {
    gap: 0.5em;
}
.site-footer .wp-block-social-links li,
.site-footer .wp-block-social-links .wp-social-link {
    padding: 0 !important;
    margin: 0 !important;
}
.site-footer .wp-block-social-links .wp-social-link {
    border-radius: 9999px;
}
.site-footer .wp-block-social-links .wp-social-link a {
    padding: 0.25em !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Franja inferior (copyright): siempre visible.
   Sin padding inferior: los 1em de abajo los aporta .site-footer. */
.site-footer .site-info {
    display: block !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.8em 0 0 !important;
    margin-top: 0.8em !important;
    color: #9a9a9a;
}
/* Solo el copyright: ocultar cualquier enlace o separador dentro de .site-info */
.site-footer .site-info a,
.site-footer .site-info [role="separator"] {
    display: none !important;
}


/* ==========================================================
   8. AJUSTES POR PÁGINA
   ========================================================== */
/* Ocultar el título en la página Oportunidades */
.page-id-59 .entry-header {
    display: none;
}
