/* Shared header and footer used by every page. */

:root {
    --shell-brown: #6B4528;
    --shell-brown-dark: #603E24;
    --shell-sand: #C7A57A;
    --shell-bg: var(--bg, #F7F1EA);
    --shell-text: var(--text, #1C1713);
    --shell-surface: var(--surface, #fff);
    --shell-border: var(--border, rgba(28, 23, 19, 0.08));
}

.wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 26px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid var(--shell-sand);
    outline-offset: 3px;
}

.btn-primary {
    background: var(--shell-brown);
    color: #fff;
    box-shadow: 0 18px 26px rgba(107, 69, 40, .28);
}

.btn-primary:hover {
    background: var(--shell-brown-dark);
    color: #fff;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 100%);
    transition: background .25s ease, padding .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}

header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header.scrolled {
    background: rgba(18, 11, 9, .7);
    backdrop-filter: blur(14px);
    padding: 14px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    flex-shrink: 0;
}

.logo img {
    display: block;
    width: min(100%, 52px);
    max-height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .65));
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: .9;
    letter-spacing: .02em;
    transform: translateY(-1px);
}

.brand-text strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(.9rem, 1.3vw, 1.7rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}

.brand-text span {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(.62rem, .9vw, .95rem);
    font-weight: 600;
    letter-spacing: .2em;
    color: rgba(255, 255, 255, .8);
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}

nav.main-nav {
    display: flex;
    align-items: center;
    gap: 36px;
}

nav.main-nav a {
    position: relative;
    padding: 10px 0;
    color: rgb(255, 250, 250);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: color .2s ease;
}

nav.main-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
    background: var(--shell-sand);
    transition: transform .22s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
    color: #d8ae67;
}

nav.main-nav a:hover::after,
nav.main-nav a.active::after {
    transform: scaleX(1);
}

header .btn-primary {
    padding: 12px 22px;
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* === Switch idioma ES | EN === */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    margin-left: 12px;
}
.lang-switch button {
    min-width: 38px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    background: transparent;
    color: rgba(255,255,255,.85);
    transition: background .2s ease, color .2s ease;
}
.lang-switch button.is-active {
    background: #fff;
    color: #1B120F;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.lang-switch button:focus-visible {
    outline: 2px solid var(--shell-sand);
    outline-offset: 2px;
}
@media (max-width: 980px){
    .lang-switch { margin-left: auto; }
}

/* Acciones dentro del menú móvil */
.nav-actions--mobile { display: none; }

/* === Theme toggle === */
.theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
    flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible { outline: 2px solid var(--shell-sand); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }

@media (max-width: 980px) {
    header .wrap > .lang-switch,
    header .wrap > .theme-toggle,
    header .wrap > #themeToggle { display: none !important; }
    .nav-actions--mobile {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding-top: 14px;
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,.12);
        width: 100%;
    }
    .nav-actions--mobile .lang-switch {
        margin-left: 0;
        justify-content: center;
        align-self: center;
        background: rgba(255,255,255,.06);
        border-color: rgba(255,255,255,.12);
    }
    .nav-actions--mobile .lang-switch button {
        color: rgba(255,255,255,.82);
    }
    .nav-actions--mobile .lang-switch button.is-active {
        background: rgba(255,255,255,.96);
        color: #1B120F;
    }
    .nav-actions--mobile .theme-toggle {
        align-self: center;
        width: 42px;
        height: 42px;
        background: rgba(255,255,255,.06);
        border-color: rgba(255,255,255,.12);
    }
    .nav-actions--mobile .theme-toggle:hover {
        background: rgba(255,255,255,.12);
    }
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #fff;
}

.nav-toggle svg {
    width: 26px;
    height: 26px;
}

footer {
    background: linear-gradient(180deg, #120b09 0%, #080605 100%);
    color: rgba(255, 255, 255, .66);
    padding-top: 70px;
    font-family: 'Inter', sans-serif;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-grid h5 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.footer-grid ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-grid ul a,
.footer-grid .contact-item {
    font-size: .88rem;
    line-height: 1.55;
}

.footer-grid ul a {
    transition: color .2s ease;
}

.footer-grid ul a:hover {
    color: #fff;
}

.footer-grid .contact-item {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}

.footer-grid .contact-item svg,
.footer-grid .contact-item i {
    width: 15px;
    height: 15px;
    color: var(--shell-sand);
    flex-shrink: 0;
}

.footer-about p {
    font-size: .88rem;
    line-height: 1.7;
    max-width: 300px;
}

footer .logo .mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: var(--shell-sand);
    flex-shrink: 0;
}

footer .logo .mark svg {
    width: 42px;
    height: 42px;
}

footer .logo .word {
    display: flex;
    flex-direction: column;
    line-height: .9;
    transform: translateY(-1px);
}

footer .logo .word b,
footer .logo .word span {
    display: block;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

footer .logo .word b {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .08em;
}

footer .logo .word span {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .2em;
    color: rgba(255, 255, 255, .8);
}

.social-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.social-row a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}

.social-row a:hover {
    background: var(--shell-brown);
    transform: translateY(-2px);
}

.social-row a svg,
.social-row a i {
    width: 16px;
    height: 16px;
    color: #fff;
}

.footer-bottom {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 22px 0;
    text-align: center;
    color: rgba(255, 255, 255, .66);
    font-size: .8rem;
    letter-spacing: normal;
}

@media (max-width: 980px) {
    nav.main-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 20px;
        left: 20px;
        padding: 14px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: rgba(18, 11, 9, .96);
        border: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 18px 35px rgba(0, 0, 0, .2);
    }

    nav.main-nav.is-open {
        display: flex;
        padding-bottom: 18px;
    }

    nav.main-nav.is-open .nav-actions--mobile {
        width: 100%;
        margin-top: 12px;
        padding-top: 12px;
    }

    header .btn-primary {
        display: none;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 0 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================= */
/* =========== BOTÓN WHATSAPP FLOTANTE === */
/* ========================================= */
#back-to-top-btn { display: none !important; }
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
    z-index: 900;
    border: 0;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.whatsapp-float:hover { transform: translateY(-3px) scale(1.04); background: #1ebe5d; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.whatsapp-float:active { transform: translateY(0) scale(1); }
.whatsapp-float svg { width: 28px; height: 28px; }
.whatsapp-float:focus-visible { outline: 2px solid #25D366; outline-offset: 3px; }
body.project-modal-open .whatsapp-float { opacity: 0; visibility: hidden; pointer-events: none; }
.contact-page .whatsapp-float { display: none !important; }
body.project-modal-open #siteHeader { pointer-events: none; }