:root{
    --color-gold-ink: #876529;
    --focus-color: #876529;
}

html{ scroll-padding-top: 110px; }
section[id]{ scroll-margin-top: 110px; }
main{ min-width: 0; }
button,
input,
select,
textarea{ font: inherit; }
button,
a{ touch-action: manipulation; }

.sr-only{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link{
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20000;
    padding: 12px 18px;
    color: #fff;
    background: #1a1a1a;
    transform: translateY(-200%);
}
.skip-link:focus{ transform: translateY(0); }
body :is(a, button, input, select, textarea, [tabindex]):focus-visible{
    outline: 3px solid var(--focus-color) !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 6px #fff;
}
main:focus{ outline: none; }

.lang-item{
    appearance: none;
    border: 0;
    background: transparent;
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}
.lang-item.active,
.header.scrolled .lang-item.active{ color: var(--color-gold-ink); }
.header:not(.scrolled) .lang-item{ color: #fff; opacity: 1; }
.header:not(.scrolled) .lang-item.active{ color: #e9cc95; }
.nav a:not(.btn):hover{ color: var(--color-gold-ink) !important; }
.btn-solid:hover{ background: var(--color-gold-ink); }

.newsletter-field-label{
    display: block;
    margin: 0 0 6px;
    color: #333;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
}
.newsletter-field-label{ margin-bottom: 10px; }
.input-text-area{ min-width: 0; flex: 1; }
.footer-input-group input{ min-width: 0; width: 100%; }
.ai-close-btn,
.footer-input-group button,
.loc-slider-arrows button{
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-window{ height: min(560px, calc(100dvh - 130px)); }
.ai-widget:has(.ai-chat-window.active){ z-index: 11001; }
.ai-chat-messages{ min-height: 0; overscroll-behavior: contain; }
.ai-chat-input input{ font-size: 1rem; }
.ai-chat-input button{ width: 44px; height: 44px; }
.ai-msg-content{ overflow-wrap: anywhere; }
.loc-slider-arrows{ gap: 8px; }
.loc-slider-arrows button{ color: #555; }
.footer-social-icons a{ min-width: 44px; min-height: 44px; }
.hero{
    height: auto;
    min-height: max(650px, 100svh);
    padding: 150px 0 110px;
}
.hero-motion-toggle{
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(18, 18, 18, 0.75);
    color: #fff;
    cursor: pointer;
    font-size: 0.875rem;
}
.hero-motion-toggle[hidden]{ display: none; }
body.has-dialog{ overflow: hidden; }

@media (min-width: 1281px){
    .header{ padding-inline: 3%; }
    .nav{ gap: 0.8rem; margin-right: 1rem; }
    .header-actions{ gap: 1rem; }
}

@media (max-width: 1280px){
    .header,
.header.scrolled{ padding: 12px 24px; gap: 12px; }
    .logo-img{ height: 60px; }
    .header.scrolled .logo-img{ height: 48px; }
    .header-actions{ margin-left: auto; gap: 12px; }
    .mobile-only{ display: block !important; }
    .mobile-menu-btn{
        display: block;
        position: relative;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        z-index: 1002;
    }
    .mobile-menu-btn span{
        position: absolute !important;
        left: 8px !important;
        width: 28px !important;
        height: 1px !important;
        margin: 0 !important;
        bottom: auto !important;
        transform: none !important;
    }
    .mobile-menu-btn span:nth-child(1){ top: 14px !important; }
    .mobile-menu-btn span:nth-child(2){ top: 22px !important; }
    .mobile-menu-btn span:nth-child(3){ top: 30px !important; }
    .mobile-menu-btn.active span{ background: #1a1a1a !important; }
    .mobile-menu-btn.active span:nth-child(1){ top: 22px !important; transform: rotate(45deg) !important; }
    .mobile-menu-btn.active span:nth-child(2){ opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3){ top: 22px !important; transform: rotate(-45deg) !important; }
    .nav{
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: max(96px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)) !important;
        background: #fff !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        z-index: 1001 !important;
        transform: translateX(100%) !important;
        visibility: hidden;
    }
    .nav.active{ transform: none !important; visibility: visible; }
    .nav a{
        display: flex;
        align-items: center !important;
        justify-content: space-between;
        color: #1a1a1a !important;
        font-size: 0.95rem !important;
        min-height: 52px;
        padding: 12px 0 !important;
        border-bottom: 1px solid #eee;
        animation: none !important;
    }
    .nav a::after{ display: none; }
    .nav .mobile-search-wrapper{ margin-bottom: 20px; }
    .mobile-search-box{ display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid #ddd; }
    .mobile-search-box input{ width: 100%; min-width: 0; border: 0; font-size: 1rem; }
    .nav-arrow{ margin-left: auto; }
    body.nav-open{ overflow: hidden; }
}

@media (max-width: 900px){
    .scroll-reveal.right:not(.visible){ transform: translateY(60px); }
}

@media (max-width: 768px){
    .container{ padding-inline: 0; }
    .section{ padding: 64px 24px; }
    .footer .container{ padding-inline: 24px; }
    .hero{ min-height: 100svh; padding: 140px 0 105px; }
    .hero-content{ padding-inline: 24px; }
    .hero-content h1{ font-size: clamp(2.1rem, 7.6vw, 3.4rem); }
    .hero .subtitle{ letter-spacing: 3px; }
    .contact-form{ padding: 28px 20px; }
    .grid-2-sm{ gap: 20px; }
    .loc-grid-container{ min-width: 0; }
    .locaciones-editorial{ padding-inline: 0; }
    .loc-name{ flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
    .floating-actions{ right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
    .ai-chat-header{ padding-top: max(16px, env(safe-area-inset-top)); }
    .ai-chat-input{ padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .ai-title{ font-size: 0.875rem; }
}

@media (max-width: 480px){
    .header,
.header.scrolled{ padding-inline: 16px; gap: 8px; }
    .header-actions > .btn{ display: none; }
    .lang-switcher{ gap: 4px; }
    .lang-item .flag-icon{ margin-right: 0; }
    .ai-chat-window{ height: 100dvh; }
    .loc-thumb{ width: 64px; flex-shrink: 0; margin-right: 12px; }
    .loc-num{ width: 26px; flex-shrink: 0; }
    .loc-name{ letter-spacing: 1px; }
}

@media (prefers-reduced-motion: reduce){
    .scroll-reveal,
.fade-in{ opacity: 1 !important; transform: none !important; }
    .gold-dust-container{ display: none; }
}
