












/*! [SAHA] assets/css/components/header-extras.css | v2.6.3 | 2026-09-07 */
/* ===== Cart Badge Pulse Animation ===== */
@keyframes saha-badge-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.saha-badge-pulse {
    animation: saha-badge-pulse 0.5s ease;
    background: #28a745 !important;
    color: #fff !important;
}

/* ===== Toast Notification ===== */
.saha-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #28a745;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    max-width: 90vw;
    font-size: 13px;
}

.saha-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.saha-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.saha-toast-text {
    flex: 1;
}

.saha-toast-link {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
    font-size: 12px;
}

/* ===== Mobile Search Toggle Button ===== */
.saha-search-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: #333;
}

/* ===== Mobile Search Inline ===== */
.saha-mobile-search-inline {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

.saha-mobile-search-inline.saha-mobile-search-show {
    display: block;
}

.saha-mobile-search-form {
    display: flex;
    border: 2px solid #0073aa;
    border-radius: 24px;
    overflow: hidden;
}

.saha-mobile-search-form input[type="search"] {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.saha-mobile-search-form button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 16px;
}

.saha-mobile-search-form button:hover {
    background: #005a87;
}

/* ===== Mobile Header: Grid 4 columns ===== */
@media (max-width: 991px) {
    .saha-search-toggle {
        display: none !important;
    }

    /* Grid: logo | search (center) | cart | hamburger */
    .site-header-inner .container,
    .fixed-header .site-header-inner .container {
        display: grid !important;
        grid-template-columns: auto 1fr auto auto;
        align-items: center;
        padding: 0 10px !important;
        gap: 0;
        height: 50px;
    }

    /* Logo: col 1 */
    .site-header-inner .logo,
    .fixed-header .site-header-inner .logo {
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .site-header-inner .logo img,
    .fixed-header .site-header-inner .logo img {
        max-height: 34px;
        width: auto;
    }

    /* Search: col 2, centrado */
    .saha-mobile-search {
        display: flex;
        justify-content: center;
        padding: 0 8px;
    }
    .saha-mobile-search-wrap {
        display: flex;
        align-items: center;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 20px;
        overflow: hidden;
        height: 34px;
        width: 120px;
        transition: width 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }
    .saha-mobile-search-wrap:focus-within {
        width: 180px;
        border-color: #ca2e18;
        box-shadow: 0 2px 8px rgba(202,46,24,0.2);
    }
    .saha-mobile-search-wrap input[type="search"] {
        flex: 1;
        border: none;
        outline: none;
        padding: 0 0 0 12px;
        font-size: 12px;
        background: transparent;
        min-width: 0;
        color: #666;
    }
    .saha-mobile-search-wrap input[type="hidden"] {
        display: none;
    }
    .saha-mobile-search-wrap button {
        background: none;
        border: none;
        padding: 0 10px;
        color: #999;
        font-size: 14px;
        cursor: pointer;
    }

    /* Cart: col 3 */
    .saha-mobile-actions {
        display: flex;
        align-items: center;
        padding: 0 12px 0 0;
    }
    .saha-mobile-cart {
        position: relative;
        font-size: 20px;
        text-decoration: none;
        display: flex;
        align-items: center;
        line-height: 1;
        color: #333;
    }
    .saha-mobile-cart .cart-badge {
        background: #ff6b35;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: -4px;
        right: -8px;
    }

    /* Hamburger: col 4 */
    .saha-mobile-hamburger {
        display: flex;
        align-items: center;
    }
    .saha-mobile-hamburger a {
        font-size: 22px;
        color: #333;
        text-decoration: none;
        padding: 4px 2px;
        display: inline-block;
    }

    /* Hide desktop elements + old mobile-link in mobile */
    .site-header-inner .header-elements,
    .site-header-inner #header-search,
    .site-header-inner .menu-right,
    .site-header-inner .mobile-link,
    .fixed-header .header-elements,
    .fixed-header .mobile-link {
        display: none !important;
    }
}

/* ===== Desktop: hide mobile elements ===== */
@media (min-width: 992px) {
    .saha-mobile-search,
    .saha-mobile-actions,
    .saha-mobile-hamburger,
    .fixed-header .saha-mobile-search,
    .fixed-header .saha-mobile-actions {
        display: none !important;
    }
}

/* ===== Desktop: Expandable search - visible, expands on focus ===== */
@media (min-width: 992px) {
    .site-header .site-header-inner .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .site-header .site-header-inner .logo {
        flex-shrink: 0;
    }
    #header-search {
        float: none;
        flex: 1;
        display: flex;
        justify-content: center;
        padding: 0 20px;
    }
    #header-search #search-form {
        padding-left: 0;
        margin-top: 0;
        float: none;
    }
    #header-search #search-form form {
        display: flex;
        align-items: center;
        border: 1px solid #ddd;
        border-radius: 22px;
        overflow: hidden;
        background: #f5f5f5;
        height: 42px;
        width: 280px;
        transition: width 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    }
    #header-search #search-form form:focus-within {
        width: 440px;
        border-color: #ca2e18;
        box-shadow: 0 2px 8px rgba(202, 46, 24, 0.2);
        background: #fff;
    }
    #header-search #search-form input[type="search"] {
        min-width: 0;
        height: 38px;
        font-size: 13px;
        padding: 0 4px 0 14px;
        background: transparent;
        color: #555;
        border: 0;
        box-shadow: none;
        flex: 1;
    }
    #header-search #search-form input[type="search"]::placeholder {
        color: #999;
        font-style: italic;
    }
    #header-search #search-form button {
        width: 42px;
        height: 42px;
        font-size: 15px;
        padding: 0;
        background: transparent;
        color: #b5a582;
        border: 0;
        cursor: pointer;
        flex-shrink: 0;
        transition: color 0.3s ease;
    }
    #header-search #search-form button:hover,
    #header-search #search-form form:focus-within button {
        color: #ca2e18;
    }

    /* Override inline style="display: none" from WC variation JS when OOS */
    #header-search #search-form button {
        display: block !important;
    }
}

/* ==============================================
   FASE 1: UX Header Desktop
   ============================================== */

/* 1. Logo 15% más grande */
@media (min-width: 992px) {
    .site-header .site-header-inner .logo img {
        max-height: 65px !important;
        width: auto !important;
    }
}

/* 2. Espaciado header - más aire */
@media (min-width: 992px) {
    .site-header .site-header-inner {
        padding: 22px 0 !important;
    }
}

/* 3. Menú nav: texto blanco sobre naranja + subrayado animado hover */
@media (min-width: 992px) {
    #site-navigation-wrap {
        background-color: #fff !important;
        border-top: 1px solid #eee;
        border-bottom: 2px solid #dd9933;
    }
    .site-navigation .dropdown-menu > li > a {
        color: #333 !important;
        font-family: 'Poppins', 'Lato', sans-serif;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        font-weight: 500;
        position: relative;
        transition: color 0.3s ease;
    }
    .site-navigation .dropdown-menu > li > a .title {
        position: relative;
    }
    .site-navigation .dropdown-menu > li > a .title::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: #ca2e18;
        transition: width 0.3s ease;
    }
    .site-navigation .dropdown-menu > li > a:hover .title::after,
    .site-navigation .dropdown-menu > li.sfHover > a .title::after,
    .site-navigation .dropdown-menu > li.current-menu-item > a .title::after {
        width: 100%;
    }
    .site-navigation .dropdown-menu > li > a:hover,
    .site-navigation .dropdown-menu > li.sfHover > a,
    .site-navigation .dropdown-menu > li.current-menu-item > a {
        color: #ca2e18 !important;
    }
    /* Más espacio entre items del menú */
    .site-navigation .dropdown-menu > li {
        margin: 0 20px;
    }
}

/* 4. Sticky header compacto: solo logo + lupa + carrito */
@media (min-width: 992px) {
    .fixed-header {
        background-color: #fff !important;
        border-bottom: 2px solid #dd9933 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        opacity: 1 !important;
    }
    .fixed-header .site-navigation {
        display: none !important;
    }
    .fixed-header .site-header-inner {
        padding: 8px 0 !important;
    }
    .fixed-header .site-header-inner .logo img {
        max-height: 38px !important;
    }
    .fixed-header .header-elements > li > a {
        color: #ca2e18 !important;
        border-color: #ca2e18 !important;
        width: 36px;
        height: 36px;
        line-height: 34px;
    }
    .fixed-header .header-elements > li > a:hover {
        color: #dd9933 !important;
        border-color: #dd9933 !important;
    }
}

/* 5. Carrito más visible */
@media (min-width: 992px) {
    .menu-right .links i {
        font-size: 28px;
    }
    .menu-right > li.header-cart {
        position: relative;
    }
    .menu-right .count,
    .menu-right .cart-badge,
    .header-cart .count {
        background: #ca2e18 !important;
        color: #fff !important;
        font-size: 10px;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: -4px;
        right: -8px;
    }
}

/* ===== Sticky: expandable search + account icon ===== */
@media (min-width: 992px) {
    .fixed-header .site-header-inner .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .fixed-header .site-header-inner .logo {
        flex-shrink: 0;
        padding: 0 20px 0 0;
        line-height: 1;
    }
    /* Hide old dropdown search icon */
    .fixed-header .header-elements li.header-search {
        display: none !important;
    }
    .fixed-header .header-elements {
        display: flex !important;
        align-items: center;
        gap: 12px;
        float: none;
        margin: 0;
        padding: 0;
        flex-shrink: 0;
        order: 3;
    }
    /* Sticky expandable search - same style as main header */
    .fixed-header #header-search {
        display: flex !important;
        flex: 1;
        justify-content: center;
        padding: 0 20px;
        margin: 0;
        float: none;
        order: 2;
    }
    .fixed-header #header-search #search-form {
        float: none;
        margin: 0;
        padding: 0;
    }
    .fixed-header #header-search #search-form form {
        display: flex;
        align-items: center;
        border: 1px solid #ddd;
        border-radius: 22px;
        background: #f5f5f5;
        height: 38px;
        width: 280px;
        transition: width 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    }
    .fixed-header #header-search #search-form form:focus-within {
        width: 440px;
        border-color: #ca2e18;
        box-shadow: 0 2px 8px rgba(202, 46, 24, 0.2);
        background: #fff;
    }
    .fixed-header #header-search #search-form input[type="search"] {
        height: 36px;
        font-size: 12px;
        padding: 0 4px 0 14px;
        border: 0;
        background: transparent;
        flex: 1;
        min-width: 0;
    }
    .fixed-header #header-search #search-form button {
        width: 38px;
        height: 38px;
        font-size: 14px;
        background: transparent;
        color: #999;
        border: 0;
        cursor: pointer;
        flex-shrink: 0;
    }
    .fixed-header #header-search #search-form form:focus-within button {
        color: #ca2e18;
    }
    /* Account + Cart icons - same visual style */
    .fixed-header .header-account-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid #ca2e18;
        color: #ca2e18;
        font-size: 14px;
        transition: all 0.3s ease;
        text-decoration: none;
    }
    .fixed-header .header-account-link:hover {
        background: #ca2e18;
        color: #fff;
    }
    .fixed-header .header-elements > li > a {
        width: 36px;
        height: 36px;
        line-height: 34px;
    }
    .fixed-header .header-elements > li.header-cart .text {
        display: none;
    }
}

/* ===== Fase 3: Tagline, Subtotal, Shake ===== */

/* Tagline bajo el logo */
@media (min-width: 992px) {
    .site-header .logo {
        display: flex;
        flex-direction: column;
    }
    .logo-tagline {
        font-size: 11px;
        color: #999;
        font-style: italic;
        margin-top: 2px;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }
    .fixed-header .logo-tagline {
        display: none;
    }
}

/* Subtotal carrito - vertical layout, vertically centered */
@media (min-width: 992px) {
    /* Align menu-right items vertically centered */
    .site-header .menu-right {
        display: flex;
        align-items: center;
        float: right;
        height: 100%;
    }
    .menu-right > li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    /* Force same icon size for both account and cart */
    .menu-right > li .links i {
        font-size: 24px !important;
        line-height: 1;
    }
    .menu-right > li.header-cart {
        border-right: none;
        margin-right: 0;
        padding-right: 0;
    }
    .menu-right > li.header-cart .links {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        line-height: 1.3;
    }
    /* Icon wrapper: icon + badge together */
    .menu-right > li.header-cart .links i {
        position: relative;
        font-size: 24px;
        padding-bottom: 0;
        margin-bottom: 1px;
    }
    /* Badge on top-right of icon */
    .menu-right > li.header-cart .links .count {
        position: absolute;
        top: -6px;
        right: -10px;
        background: #ca2e18;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }
    .menu-right > li.header-cart .links .text {
        display: block;
        font-size: 10px;
        color: #666;
        padding: 0;
        line-height: 1;
    }
    .menu-right .cart-subtotal {
        display: block;
        font-size: 10px;
        color: #ca2e18;
        font-weight: 600;
        white-space: nowrap;
        line-height: 1;
    }
    /* Hide mobile-count on desktop */
    .menu-right > li.header-cart .links .mobile-count {
        display: none;
    }
}

/* Shake animation */
@keyframes saha-cart-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}
.menu-right .header-cart.shake,
.fixed-header .header-cart.shake {
    animation: saha-cart-shake 0.5s ease;
}

/* ===== Glow animated border on search ===== */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(126, 200, 227, 0.3);
        border-color: #a8dce8;
    }
    50% {
        box-shadow: 0 0 14px rgba(126, 200, 227, 0.6);
        border-color: #7ec8e3;
    }
}

/* Desktop header search glow */
#header-search #search-form form.search-loading {
    animation: glow-pulse 1.5s ease-in-out infinite;
    background: #f0f9fc;
}

/* Sticky search glow */
.fixed-header #header-search #search-form form.search-loading {
    animation: glow-pulse 1.5s ease-in-out infinite;
    background: #f0f9fc;
}

/* Mobile search glow */
.saha-mobile-search-wrap.search-loading {
    animation: glow-pulse 1.5s ease-in-out infinite;
    background: #f0f9fc;
}
