﻿/* =============================================================================
   Teducas Header Widget â€” v2
   Fondo negro, logo izquierda, menÃº centrado, botones derecha.
   Dropdowns en desktop (hover) y acordeÃ³n en mobile (toggle JS).
   AnimaciÃ³n de cambio de acento cross-browser.
   ============================================================================= */

/* â”€â”€ CSS custom property animable (Chrome/Edge) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@property --tdh-accent {
    syntax: '<color>';
    inherits: true;
    initial-value: #fcb415;
}

/* â”€â”€ Flash animation al cambiar de secciÃ³n â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes tdh-flash {
    0%   { opacity: 0;    }
    25%  { opacity: 0.14; }
    100% { opacity: 0;    }
}

/* â”€â”€ Reset â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-header *,
.tdh-header *::before,
.tdh-header *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* â”€â”€ Header shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-header {
    --tdh-accent: #fcb415;
    position: relative;
    width: 100%;
    background: #000;
    font-family: 'Poppins', sans-serif;
    transition: --tdh-accent 0.45s ease;
}

.tdh-header--sticky {
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Flash overlay â€” JS appends/removes this element */
.tdh-theme-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    animation: tdh-flash 0.55s ease forwards;
}

/* â”€â”€ Inner wrapper â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-inner {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 72px;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* â”€â”€ Logo â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-logo-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.tdh-logo {
    height: 36px;
    width: auto;
    display: block;
    transition: opacity 0.28s ease;
}

.tdh-logo-text {
    color: var(--tdh-accent);
    font-family: 'Lora', serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.05em;
    transition: color 0.45s ease;
}

/* â”€â”€ Desktop nav â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.tdh-nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
}

.tdh-nav-item {
    position: relative;
}

/* Link + toggle button sit side by side */
.tdh-nav-link-wrap {
    display: flex;
    align-items: stretch;
}

/* â”€â”€ Top-level link â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-nav-link {
    display: inline-block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.35s ease;
    position: relative;
    border-radius: 4px;
}

.tdh-has-dropdown > .tdh-nav-link-wrap > .tdh-nav-link {
    padding-right: 2px;
}

/* Underline indicator */
.tdh-nav-link::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--tdh-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease, background-color 0.45s ease;
}

.tdh-nav-link:hover {
    color: var(--tdh-accent);
}

.tdh-nav-link.is-active {
    color: #fff !important;
}

.tdh-nav-link:hover::after,
.tdh-nav-link.is-active::after {
    transform: scaleX(1);
}

/* â”€â”€ Toggle button (chevron) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px 0 0;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    color: var(--tdh-accent);
    border-radius: 0 !important;
    transition: color 0.45s ease, transform 0.3s ease;
    flex-shrink: 0;
    line-height: 0;
    min-height: unset;
    min-width: unset;
    height: auto;
    width: auto;
}

.tdh-toggle-btn:hover,
.tdh-toggle-btn:focus {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--tdh-accent);
}

.tdh-toggle-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
    display: block;
    stroke: var(--tdh-accent);
}

.tdh-nav-item:hover > .tdh-nav-link-wrap .tdh-toggle-btn svg,
.tdh-nav-item.is-open > .tdh-nav-link-wrap .tdh-toggle-btn svg {
    transform: rotate(180deg);
}

/* â”€â”€ Dropdown panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 200px;
    background: #111;
    border-top: 2px solid var(--tdh-accent);
    border-radius: 0 4px 4px 4px;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s 0.22s,
        border-color 0.45s ease;
    z-index: 200;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.tdh-nav-item:hover > .tdh-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s 0s,
        border-color 0.45s ease;
}

/* â”€â”€ Dropdown items â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-dropdown-item {
    position: relative;
}

.tdh-dropdown-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #ccc;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.tdh-dropdown-link:hover,
.tdh-dropdown-link.is-active {
    color: var(--tdh-accent);
    background: rgba(255, 255, 255, 0.05);
}

.tdh-sub-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    opacity: 0.6;
    flex-shrink: 0;
}

.tdh-sub-arrow svg {
    width: 10px;
    height: 10px;
    transform: rotate(-90deg);
    display: block;
}

/* â”€â”€ Sub-sub dropdown (depth 2) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-dropdown--sub {
    top: -10px;
    left: 100%;
    border-top: none;
    border-left: 2px solid var(--tdh-accent);
    border-radius: 4px;
}

.tdh-dropdown-item:hover > .tdh-dropdown--sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s 0s,
        border-color 0.45s ease;
}

/* â”€â”€ Action buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tdh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: color 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, opacity 0.25s ease;
}

.tdh-btn--outline {
    color: #fff;
    background: transparent;
    border-color: #fff;
}

.tdh-btn--outline:hover {
    color: var(--tdh-accent);
    border-color: var(--tdh-accent);
}

.tdh-btn--filled {
    color: #000;
    background-color: var(--tdh-accent);
    border-color: var(--tdh-accent);
}

.tdh-btn--filled:hover {
    opacity: 0.85;
}

/* Relleno con color fijo (no cambia con el acento dinÃ¡mico) */
.tdh-btn--filled-static {
    /* colores definidos inline por PHP */
}

.tdh-btn--filled-static:hover {
    opacity: 0.85;
}

/* â”€â”€ Mobile burger â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-burger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.tdh-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.25s ease;
}

/* â”€â”€ Mobile nav drawer â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-mobile-nav {
    display: none;
    background: #111;
    border-top: 2px solid var(--tdh-accent);
    padding: 8px 20px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 72px);
    transition: border-color 0.45s ease;
}

.tdh-mobile-nav.is-open {
    display: block !important;
}

.tdh-mobile-nav > .tdh-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.tdh-mobile-nav .tdh-nav-item {
    width: 100%;
}

.tdh-mobile-nav .tdh-nav-link-wrap {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tdh-mobile-nav .tdh-nav-link {
    font-size: 15px;
    padding: 12px 4px;
    width: 100%;
    border-radius: 0;
}

.tdh-mobile-nav .tdh-has-dropdown > .tdh-nav-link-wrap > .tdh-nav-link {
    border-radius: 0;
    padding-right: 4px;
}

.tdh-mobile-nav .tdh-toggle-btn {
    padding: 12px 10px;
    border-radius: 0;
    margin-left: auto;
}

/* Mobile dropdown: accordion (JS toggles .is-open) */
.tdh-mobile-nav .tdh-dropdown {
    position: static;
    opacity: 1;
    visibility: hidden;
    transform: none;
    border-top: none;
    border-left: 2px solid var(--tdh-accent);
    border-radius: 0;
    box-shadow: none;
    padding: 2px 0;
    margin: 0 0 2px 12px;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition:
        max-height 0.32s ease,
        visibility 0s 0.32s,
        border-color 0.45s ease;
}

.tdh-mobile-nav .tdh-nav-item.is-open > .tdh-dropdown {
    visibility: visible;
    max-height: 1200px;
    pointer-events: auto;
    transition:
        max-height 0.35s ease,
        visibility 0s 0s,
        border-color 0.45s ease;
}

/* â”€â”€ Botones en el cajÃ³n mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tdh-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 4px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 6px;
}

.tdh-mobile-actions .tdh-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
}

/* â”€â”€ Responsive: breakpoint mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 900px) {

    /* Altura y padding compacto */
    .tdh-inner {
        height: 60px;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Ocultar nav y botones de escritorio */
    .tdh-nav,
    .tdh-actions {
        display: none;
    }

    /* Mostrar hamburguesa */
    .tdh-burger {
        display: flex;
        margin-left: auto;
    }

    /* Toggle chevron: Ã¡rea de toque mÃ­nima 44Ã—44 px */
    .tdh-mobile-nav .tdh-toggle-btn {
        padding: 12px 14px;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        color: var(--tdh-accent);
    }

    .tdh-mobile-nav .tdh-toggle-btn svg {
        width: 14px;
        height: 14px;
        stroke: var(--tdh-accent);
    }

    /* SubmenÃº con sangrÃ­a adicional */
    .tdh-mobile-nav .tdh-dropdown--sub {
        margin-left: 12px;
    }
}

@media (max-width: 480px) {
    .tdh-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tdh-mobile-nav {
        padding: 6px 14px 20px;
    }
}

.tdh-mobile-nav .tdh-dropdown-link {
    padding: 9px 14px;
    font-size: 14px;
    color: #bbb;
}

/* Sub-sub in mobile: always visible inline */
.tdh-mobile-nav .tdh-dropdown--sub {
    position: static;
    opacity: 1;
    visibility: visible;
    max-height: none;
    pointer-events: auto;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-radius: 0;
    margin-left: 12px;
    padding: 2px 0;
    box-shadow: none;
    transform: none;
}

.tdh-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tdh-mobile-actions .tdh-btn {
    width: 100%;
    justify-content: center;
}

/* â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 980px) {
    .tdh-nav,
    .tdh-actions {
        display: none;
    }

    .tdh-burger {
        display: flex;
    }

    .tdh-inner {
        height: 60px;
        padding: 0 20px;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .tdh-logo {
        height: 28px;
    }

    .tdh-inner {
        padding: 0 16px;
    }
}

/* ── Touch fix: evita doble disparo en dispositivos táctiles ──────────────── */
.tdh-burger {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Botón de carrito WooCommerce ─────────────────────────────────────────── */
.tdh-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    flex-shrink: 0;
}

.tdh-cart-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--tdh-accent);
    color: var(--tdh-accent);
}

.tdh-cart-btn svg {
    display: block;
    flex-shrink: 0;
}

/* Badge contador */
.tdh-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--tdh-accent);
    color: #000;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.tdh-cart-count.is-empty {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

/* En mobile actions: ancho automático y estilo inline */
.tdh-mobile-actions .tdh-cart-btn {
    width: auto;
    height: auto;
    border-radius: 6px;
    padding: 12px 20px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    justify-content: flex-start;
}

.tdh-mobile-actions .tdh-cart-btn::after {
    content: 'Ver carrito';
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.tdh-mobile-actions .tdh-cart-count {
    position: static;
    margin-left: auto;
    opacity: 1;
    transform: scale(1);
}

.tdh-mobile-actions .tdh-cart-count.is-empty {
    display: none;
}

