/**
 * ============================================
 * ESTILOS PREMIUM PARA HEADER - ICONOS DE CUENTA Y CARRITO
 * ============================================
 * 
 * Estilos mejorados para iconos del header con:
 * - Espaciado optimizado entre elementos (24px)
 * - Efectos hover premium pero sutiles
 * - Áreas táctiles adecuadas (44px × 44px)
 * - Transiciones suaves y refinadas
 * 
 * @package KenkatsuTheme
 * @version 2.0
 */

/* ═══════════════════════════════════════════════════════════════════════════
   IDIOMA INGLÉS: ocultar solo la columna right_center (botón duplicado).
   NO ocultar el botón correcto que está en main right (debe verse como en ES).
   =========================================================================== */
body.kenkatsu-lang-en #main-header [class*="section-right-center"],
body.kenkatsu-lang-en #mobile-header [class*="section-right-center"] {
    display: none !important;
}
/* Solo ocultar el botón si está dentro de right_center (duplicado); el de main right se deja visible */
body.kenkatsu-lang-en [class*="section-right-center"] .site-header-item[data-section="kadence_customizer_header_button"],
body.kenkatsu-lang-en [class*="section-right-center"] .site-header-item[data-section="kadence_customizer_mobile_button"] {
    display: none !important;
}
/* Asegurar que el botón en main right sea visible (mismo orden que español) */
body.kenkatsu-lang-en #main-header .site-header-main-section-right .site-header-item[data-section="kadence_customizer_header_button"],
body.kenkatsu-lang-en #main-header .site-header-main-section-right .header-button-wrap {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* En móvil: botón visible en la sección derecha del header móvil */
body.kenkatsu-lang-en #mobile-header .site-header-section-right .site-header-item[data-section="kadence_customizer_mobile_button"],
body.kenkatsu-lang-en #mobile-header .site-header-section-right .header-button-wrap {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Inglés: botón "Book experience" con los MISMOS estilos que la versión española (RESERVAR TU EXPERIENCIA) */
body.kenkatsu-lang-en #main-header .site-header-main-section-right a.header-button,
body.kenkatsu-lang-en #main-header .site-header-main-section-right .header-button-wrap .header-button {
    font-size: 0.75rem !important;
    padding: 0.45rem 1rem !important;
    margin-left: 0.5rem !important;
    background-color: #0d9488 !important;
    color: #FFFFFF !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 6px !important;
    border: 0 !important;
}
body.kenkatsu-lang-en #masthead.scrolled #main-header .site-header-main-section-right a.header-button,
body.kenkatsu-lang-en #masthead.scrolled #main-header .site-header-main-section-right .header-button-wrap .header-button {
    font-size: 0.75rem !important;
    padding: 0.45rem 1rem !important;
    margin-left: 0.5rem !important;
    background-color: #0d9488 !important;
    color: #FFFFFF !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 6px !important;
    border: 0 !important;
}
body.kenkatsu-lang-en #main-header .site-header-main-section-right .header-button-inner-wrap,
body.kenkatsu-lang-en #masthead.scrolled #main-header .site-header-main-section-right .header-button-inner-wrap {
    display: inline-flex !important;
}

/* Ocultar el ítem del menú "BOOK YOUR EXPERIENCE" (reserva) en inglés — respaldo por si PHP no quita el ítem.
   Solo debe verse un botón: el del header (Book experience). Orden: logo → menú → iconos WooCommerce → botón. */
body.kenkatsu-lang-en .menu-reservar,
body.kenkatsu-lang-en #menu-item-430,
body.kenkatsu-lang-en li.menu-item a[href="#reservar"],
body.kenkatsu-lang-en #primary-menu .menu-reservar,
body.kenkatsu-lang-en #mobile-drawer .menu-reservar {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OPTIMIZACIÓN DE ESTRUCTURA DEL HEADER - FLEXBOX CON GAP
   =========================================================================== */

/* Contenedor principal del header - optimizado con gap */
.site-header-main-section-right,
.site-header-main-section-right-center {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 1.25rem !important;
    /* 20px - espaciado consistente entre todos los elementos */
    flex-wrap: nowrap !important;
}

/* Asegurar alineación perfecta de elementos */
.site-header-item,
.kenkatsu-account-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

/* Espaciado adicional para el icono de cuenta (si gap no se aplica) */
.kenkatsu-account-icon-wrapper {
    margin-right: 0 !important;
    /* El gap del contenedor maneja el espaciado */
}

/* Espaciado entre iconos y botón CTA (si existe) */
.site-header-item[data-section="kadence_customizer_cart"] {
    margin-right: 0 !important;
    /* El gap del contenedor maneja el espaciado */
}

/* ============================================
   CARRITO - MANTENER VISIBLE
   (Restaurado según solicitud del usuario)
   ============================================ */

/* Asegurar que el carrito sea visible - ALTA ESPECIFICIDAD */
.site-header-item[data-section="kadence_customizer_cart"],
div[data-section="kadence_customizer_cart"],
.header-cart-wrap,
.cart-icon-wrapper,
.kadence-header-cart,
.woocommerce-cart-menu-item,
.header-cart,
#masthead .site-header-item[data-section="kadence_customizer_cart"],
#masthead div[data-section="kadence_customizer_cart"],
#masthead .header-cart-wrap,
#masthead .cart-icon-wrapper,
#masthead .kadence-header-cart,
.site-header-main-section-right .site-header-item[data-section="kadence_customizer_cart"],
.site-header-main-section-right-center .site-header-item[data-section="kadence_customizer_cart"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative !important;
    left: auto !important;
}

/* Asegurar que los enlaces del carrito sean visibles */
.site-header-item[data-section="kadence_customizer_cart"] a,
.header-cart-wrap a,
.cart-icon-wrapper a,
.kadence-header-cart a,
.woocommerce-cart-menu-item a,
.header-cart a {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Asegurar que los iconos SVG del carrito sean visibles */
.site-header-item[data-section="kadence_customizer_cart"] svg,
.header-cart-wrap svg,
.cart-icon-wrapper svg,
.kadence-header-cart svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
}

/* ============================================
   ESTILOS PARA ICONO DE CUENTA PERSONALIZADO
   ============================================ */

/* Contenedor del icono de cuenta personalizado */
.kenkatsu-account-icon-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* margin-right eliminado en favor de gap del contenedor */
}

/* Eliminar duplicados - solo mostrar el primero */
.kenkatsu-account-icon-wrapper~.kenkatsu-account-icon-wrapper,
.kenkatsu-account-icon-wrapper:not(:first-of-type),
.kenkatsu-account-icon-wrapper:nth-of-type(n+2) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Asegurar que solo haya uno visible en el header scrolled - eliminar el último */
#masthead.scrolled .kenkatsu-account-icon-wrapper~.kenkatsu-account-icon-wrapper,
#masthead.scrolled .kenkatsu-account-icon-wrapper:not(:first-of-type),
#masthead.scrolled .kenkatsu-account-icon-wrapper:last-of-type:not(:first-of-type) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Regla más específica: si hay dos, eliminar el último */
.site-header-item.kenkatsu-account-icon-wrapper:last-of-type:not(:only-of-type) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ESTILOS ICONO DE CUENTA - SOLO ICONO (SIN TEXTO)
   Dos variantes: Header transparente y Header scrolled
   ═══════════════════════════════════════════════════════════════════════════ */

/* Enlace del icono de cuenta - Base */
.kenkatsu-account-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    /* Premium easing */
    padding: 0 !important;
    border-radius: 50% !important;
    position: relative !important;
    width: 44px !important;
    /* Tamaño táctil óptimo */
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
}

/* Icono SVG - Base */
.kenkatsu-account-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.kenkatsu-account-icon svg,
.kenkatsu-account-link svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ocultar texto - solo mostrar icono */
.kenkatsu-account-text {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER TRANSPARENTE (Estado inicial - sobre hero)
   Mejor contraste: fondo oscuro sutil + sombra en iconos para cualquier imagen
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header transparente - Icono con buen contraste sobre hero (claro u oscuro) */
#masthead:not(.scrolled) .kenkatsu-account-link {
    color: #FFFFFF !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    /* Fondo oscuro sutil para leer bien sobre zonas claras del hero */
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8)) !important;
}

#masthead:not(.scrolled) .kenkatsu-account-link svg,
#masthead:not(.scrolled) .kenkatsu-account-icon svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)) !important;
}

/* Efecto hover premium sobre hero */
#masthead:not(.scrolled) .kenkatsu-account-link:hover {
    color: #FFFFFF !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

#masthead:not(.scrolled) .kenkatsu-account-link:hover .kenkatsu-account-icon svg {
    transform: none !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER SCROLLED (Después de hacer scroll - fondo blanco)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header scrolled - Icono oscuro */
#masthead.scrolled .kenkatsu-account-link {
    color: #1a1a1a !important;
}

#masthead.scrolled .kenkatsu-account-link:hover {
    color: var(--kenkatsu-primary) !important;
    /* Deep Teal */
    background-color: rgba(31, 94, 107, 0.08) !important;
    /* Fondo teal muy suave */
    transform: none !important;
    box-shadow: none !important;
    /* Diseño flat limpio */
}

#masthead.scrolled .kenkatsu-account-link:hover .kenkatsu-account-icon svg {
    transform: none !important;
    filter: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ESTILOS PREMIUM PARA ICONO DE CARRITO
   Mismos efectos que el icono de cuenta
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base para icono de carrito */
.site-header-item[data-section="kadence_customizer_cart"] a,
.header-cart-wrap a,
.cart-icon-wrapper a,
.kadence-header-cart a,
.woocommerce-cart-menu-item a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    /* Premium easing */
    padding: 0 !important;
    border-radius: 50% !important;
    position: relative !important;
    width: 44px !important;
    /* Tamaño táctil óptimo */
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
}

/* Header transparente - Carrito mismo tratamiento que cuenta (buen contraste sobre hero) */
#masthead:not(.scrolled) .site-header-item[data-section="kadence_customizer_cart"] a,
#masthead:not(.scrolled) .header-cart-wrap a,
#masthead:not(.scrolled) .cart-icon-wrapper a,
#masthead:not(.scrolled) .kadence-header-cart a {
    color: #FFFFFF !important;
    background-color: rgba(0, 0, 0, 0.35) !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8)) !important;
}

#masthead:not(.scrolled) .site-header-item[data-section="kadence_customizer_cart"] a svg,
#masthead:not(.scrolled) .cart-icon-wrapper svg,
#masthead:not(.scrolled) .kadence-header-cart svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)) !important;
}

/* Hover carrito en header transparente */
#masthead:not(.scrolled) .site-header-item[data-section="kadence_customizer_cart"] a:hover,
#masthead:not(.scrolled) .header-cart-wrap a:hover,
#masthead:not(.scrolled) .cart-icon-wrapper a:hover,
#masthead:not(.scrolled) .kadence-header-cart a:hover {
    color: #FFFFFF !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Icono SVG del carrito en hover - mantener sombra para contraste */
#masthead:not(.scrolled) .site-header-item[data-section="kadence_customizer_cart"] a:hover svg,
#masthead:not(.scrolled) .header-cart-wrap a:hover svg,
#masthead:not(.scrolled) .cart-icon-wrapper a:hover svg,
#masthead:not(.scrolled) .kadence-header-cart a:hover svg {
    transform: none !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)) !important;
}

/* Header scrolled - Carrito oscuro - USANDO VARIABLES */
#masthead.scrolled .site-header-item[data-section="kadence_customizer_cart"] a,
#masthead.scrolled .header-cart-wrap a,
#masthead.scrolled .cart-icon-wrapper a,
#masthead.scrolled .kadence-header-cart a {
    color: var(--kenkatsu-gray-900) !important;
}

#masthead.scrolled .site-header-item[data-section="kadence_customizer_cart"] a:hover,
#masthead.scrolled .header-cart-wrap a:hover,
#masthead.scrolled .cart-icon-wrapper a:hover,
#masthead.scrolled .kadence-header-cart a:hover {
    color: var(--kenkatsu-primary) !important;
    /* Deep Teal */
    background-color: rgba(31, 94, 107, 0.08) !important;
    /* Fondo teal suave */
    transform: none !important;
    /* Sin escala */
    box-shadow: none !important;
    /* Flat */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Icono SVG del carrito en hover - header scrolled */
#masthead.scrolled .site-header-item[data-section="kadence_customizer_cart"] a:hover svg,
#masthead.scrolled .header-cart-wrap a:hover svg,
#masthead.scrolled .cart-icon-wrapper a:hover svg,
#masthead.scrolled .kadence-header-cart a:hover svg {
    transform: none !important;
    filter: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGE CONTADOR DEL CARRITO
   ═══════════════════════════════════════════════════════════════════════════ */

/* Contenedor del badge del contador */
.cart-icon-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Badge del contador */
.cart-count-badge,
.site-header-item[data-section="kadence_customizer_cart"] .cart-count-badge,
.kadence-header-cart .cart-count-badge {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 2px 6px !important;
    background-color: var(--kenkatsu-error) !important;
    /* Rojo/naranja para destacar */
    color: var(--kenkatsu-bg-white) !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid var(--kenkatsu-bg-white) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Ajustes específicos para números de dos dígitos */
.cart-count-badge[style*="display: flex"] {
    min-width: 20px !important;
    padding: 2px 5px !important;
}

/* Header transparente - Badge con borde más visible */
#masthead:not(.scrolled) .cart-count-badge {
    border-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Header scrolled - Badge con borde más sutil */
#masthead.scrolled .cart-count-badge {
    border-color: #FFFFFF !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Mantener visible iconos de cuenta nativos de Kadence si existen */
.site-header-item[data-section*="account"],
.site-header-item[data-section*="my-account"],
.site-header-item[data-section="kadence_customizer_account"],
.site-header-item[data-section="kadence_customizer_my_account"],
.header-account,
.account-icon-wrapper,
.my-account-menu-item,
.mobile-account {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
}

/* ============================================
   FORZAR VISIBILIDAD DEL CARRITO - MÁXIMA ESPECIFICIDAD
   (Al final del archivo para sobrescribir cualquier otra regla)
   ============================================ */

/* Forzar visibilidad del carrito desktop con máxima especificidad */
#masthead .site-header-item[data-section="kadence_customizer_cart"],
#masthead div[data-section="kadence_customizer_cart"],
#masthead .header-cart-wrap,
#masthead .cart-icon-wrapper,
#masthead .kadence-header-cart,
#masthead .woocommerce-cart-menu-item,
#masthead .header-cart,
body #masthead .site-header-item[data-section="kadence_customizer_cart"],
body #masthead div[data-section="kadence_customizer_cart"],
html body #masthead .site-header-item[data-section="kadence_customizer_cart"],
html body #masthead div[data-section="kadence_customizer_cart"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
}

/* Forzar visibilidad de enlaces y SVG del carrito */
#masthead .site-header-item[data-section="kadence_customizer_cart"] a,
#masthead .header-cart-wrap a,
#masthead .cart-icon-wrapper a,
#masthead .kadence-header-cart a,
#masthead .site-header-item[data-section="kadence_customizer_cart"] svg,
#masthead .header-cart-wrap svg,
#masthead .cart-icon-wrapper svg,
#masthead .kadence-header-cart svg {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

    /* Asegurar ocultación en mobile también */
    .site-header-item[data-section="kadence_customizer_mobile_cart"],
    div[data-section="kadence_customizer_mobile_cart"] {
        display: none !important;
        visibility: hidden !important;
    }

    /* Mantener cuenta visible en mobile */
    .site-header-item[data-section*="account"],
    .mobile-account {
        display: block !important;
        visibility: visible !important;
    }

    /* Asegurar que el carrito desktop siga visible incluso en mobile si está en desktop */
    #masthead .site-header-item[data-section="kadence_customizer_cart"],
    #masthead div[data-section="kadence_customizer_cart"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}