/* DCloud Tailwind — cabecera, navegación y pie (independiente de Premium) */

.xt-container {
    width: min(100% - 2.5rem, var(--container));
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 0;
}

/* Cabecera y pie: ancho amplio (90 %) */
.xt-utilitybar .xt-container,
.xt-site-header .xt-container,
.xt-site-footer .xt-container {
    width: min(90%, 100% - 2.5rem);
    max-width: none;
}

@media (max-width: 640px) {
    .xt-container {
        width: min(100% - 1.25rem, var(--container));
    }

    .xt-utilitybar .xt-container,
    .xt-site-header .xt-container,
    .xt-site-footer .xt-container {
        width: min(90%, 100% - 1.25rem);
    }
}

.xt-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.xt-site-main {
    flex: 1 1 auto;
    min-height: 50vh;
}

/* ── Utility bar ── */

.xt-utilitybar {
    background: var(--menu-bg);
    color: var(--menu-text);
    font-size: 0.8125rem;
    border-bottom: 1px solid color-mix(in srgb, var(--menu-text) 12%, transparent);
}

.xt-utilitybar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    min-height: 2.5rem;
    padding: 0.4rem 0;
}

.xt-utilitybar-inner--split {
    justify-content: space-between;
}

.xt-utilitybar-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.xt-utilitybar-locale {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.xt-utilitybar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.xt-utilitybar-item a {
    color: inherit;
    text-decoration: none;
    opacity: 0.92;
    transition: opacity 0.2s ease;
}

.xt-utilitybar-item a:hover {
    opacity: 1;
}

.xt-utilitybar-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    opacity: 0.9;
}

.xt-utilitybar-icon svg {
    width: 100%;
    height: 100%;
}

/* ── Header ── */

.xt-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--white) 82%, transparent);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s var(--ease-out), background 0.3s ease;
}

.xt-site-header.is-scrolled {
    background: color-mix(in srgb, var(--white) 94%, transparent);
    box-shadow: var(--shadow-sm);
}

.xt-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: var(--header-h);
}

.xt-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.xt-site-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.xt-site-logo img {
    display: block;
    height: 2.75rem;
    width: auto;
    max-width: 13.75rem;
}

.xt-site-logo strong {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--heading);
}

/* ── Navigation (desktop) ── */

.xt-main-nav .nav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.xt-main-nav .nav-item {
    position: relative;
}

.xt-main-nav .nav-item > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--heading);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.xt-main-nav .nav-item > a:hover,
.xt-main-nav .nav-item > a:focus-visible {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.xt-main-nav .nav-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    flex-shrink: 0;
}

.xt-main-nav .nav-icon svg {
    width: 100%;
    height: 100%;
}

.xt-main-nav .nav-icon-accent {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--accent);
}

.xt-main-nav .nav-item.has-children > a::after {
    content: '';
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.15rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.xt-main-nav .nav-item.has-children:hover > a::after,
.xt-main-nav .nav-item.has-children:focus-within > a::after {
    transform: rotate(-135deg) translateY(1px);
}

.xt-main-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 15rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.35rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 60;
    box-shadow: var(--shadow-md);
}

.xt-main-nav .nav-item.has-children:hover > .sub-menu,
.xt-main-nav .nav-item.has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.xt-main-nav .sub-menu a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--heading);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.xt-main-nav .sub-menu a:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
}

/* ── Locale switcher ── */

.xt-theme .locale-switcher {
    position: relative;
    z-index: 120;
}

.xt-utilitybar .locale-switcher-trigger {
    border-color: color-mix(in srgb, var(--menu-text) 28%, transparent);
    background: color-mix(in srgb, var(--menu-text) 10%, transparent);
    color: var(--menu-text);
}

.xt-utilitybar .locale-switcher-trigger:hover,
.xt-utilitybar .locale-switcher.is-open .locale-switcher-trigger {
    background: color-mix(in srgb, var(--menu-text) 16%, transparent);
    border-color: color-mix(in srgb, var(--menu-text) 40%, transparent);
}

.locale-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--heading);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.locale-switcher-trigger:hover,
.locale-switcher.is-open .locale-switcher-trigger {
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.locale-switcher-trigger:focus {
    outline: none;
}

.locale-switcher-trigger:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.locale-switcher-globe {
    width: 0.95rem;
    height: 0.95rem;
    display: inline-flex;
    opacity: 0.85;
}

.locale-switcher-globe svg {
    width: 100%;
    height: 100%;
}

.locale-switcher-flag {
    font-size: 1rem;
    line-height: 1;
}

.locale-switcher-current {
    max-width: 8.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.locale-switcher-chevron {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.locale-switcher-chevron svg {
    width: 100%;
    height: 100%;
}

.locale-switcher.is-open .locale-switcher-chevron {
    transform: rotate(180deg);
}

.locale-switcher-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 11.5rem;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.locale-switcher.is-open .locale-switcher-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.locale-switcher-menu[hidden] {
    display: block;
}

.locale-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--heading);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.locale-switcher-option:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
}

.locale-switcher-option.is-active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

.locale-switcher-name {
    flex: 1 1 auto;
}

.locale-switcher-check {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    color: var(--accent);
    flex-shrink: 0;
}

.locale-switcher-check svg {
    width: 100%;
    height: 100%;
}

/* ── Mobile nav toggle ── */

.xt-nav-toggle {
    display: none;
}

/* ── Footer ── */

.xt-site-footer {
    margin-top: auto;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--border);
}

.xt-footer-widgets {
    padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
}

.xt-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
}

.xt-footer-widget .widget-title {
    margin: 0 0 1.125rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--heading);
}

.xt-footer-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xt-footer-widget li + li {
    margin-top: 0.55rem;
}

.xt-footer-widget a {
    color: var(--footer-text);
    text-decoration: none;
    opacity: 0.9;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.xt-footer-widget a:hover {
    opacity: 1;
    color: var(--accent);
}

.xt-footer-links,
.xt-country-list {
    margin: 0;
    padding: 0;
}

.xt-footer-links {
    list-style: none;
    padding: 0;
}

.xt-country-list {
    list-style: none;
}

.xt-footer-links a,
.xt-country-list a {
    font-size: 0.9375rem;
    line-height: 1.55;
}

.xt-footer-link-text {
    color: var(--footer-text);
    opacity: 0.9;
    line-height: 1.55;
}

.xt-country-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.xt-country-list img {
    width: 1.625rem;
    height: 1.0625rem;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.12);
}

.xt-footer-nav {
    margin: 0;
    padding: 0;
    list-style: none;
}

.xt-footer-nav-item + .xt-footer-nav-item {
    margin-top: 0.5rem;
}

.xt-footer-nav-item a {
    display: block;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.xt-site-info {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0 1.75rem;
}

.xt-site-info-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--footer-text) 88%, var(--heading));
}

.xt-site-info p {
    margin: 0;
}

.xt-cms-credits {
    font-size: 0.8125rem;
    opacity: 0.8;
}

.xt-cms-credits a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.xt-cms-credits a:hover {
    color: var(--accent);
    opacity: 1;
}

/* ── Scroll reveal (bloques de contenido) ── */

.xt-reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.xt-reveal.xt-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */

@media (max-width: 1100px) {
    .xt-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .xt-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--white);
        color: var(--heading);
        cursor: pointer;
        flex-shrink: 0;
        transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .xt-nav-toggle:hover,
    .xt-nav-toggle:focus-visible {
        border-color: color-mix(in srgb, var(--accent) 30%, transparent);
        box-shadow: var(--shadow-sm);
    }

    .xt-nav-toggle:focus {
        outline: none;
    }

    .xt-nav-toggle:focus-visible {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
    }

    .xt-nav-toggle-icon {
        width: 1.35rem;
        height: 1.35rem;
        display: inline-flex;
    }

    .xt-nav-toggle-icon svg {
        width: 100%;
        height: 100%;
    }

    .xt-nav-toggle-icon--close {
        display: none;
    }

    .xt-site-header.is-nav-open .xt-nav-toggle-icon--open {
        display: none;
    }

    .xt-site-header.is-nav-open .xt-nav-toggle-icon--close {
        display: inline-flex;
    }

    .xt-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.85rem 0;
        min-height: auto;
    }

    .xt-main-nav {
        display: none;
        width: 100%;
        margin-top: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--white);
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: var(--shadow-sm);
    }

    .xt-site-header.is-nav-open .xt-main-nav {
        display: block;
    }

    .xt-main-nav .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.125rem;
        width: 100%;
    }

    .xt-main-nav .nav-item {
        width: 100%;
    }

    .xt-main-nav .nav-item > a {
        width: 100%;
        justify-content: space-between;
        padding: 0.65rem 0.5rem;
    }

    .xt-main-nav .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        min-width: 0;
        margin: 0.15rem 0 0.35rem;
        padding: 0.25rem 0 0.35rem 0.75rem;
        border-left: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
        border-radius: 0;
        background: transparent;
        display: none;
    }

    .xt-main-nav .nav-item.has-children.is-submenu-open > .sub-menu {
        display: block;
    }
}

@media (max-width: 640px) {
    .xt-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .xt-utilitybar-inner {
        justify-content: center;
        text-align: center;
    }

    .xt-utilitybar-inner--split {
        flex-direction: column;
        align-items: center;
    }

    .xt-utilitybar-locale {
        margin-left: 0;
    }
}

/* ─── Scroll to top ─── */
.xt-scroll-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.xt-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.xt-scroll-top:hover {
    background: var(--accent-hover);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 45%, transparent);
}

.xt-scroll-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.xt-scroll-top__icon {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
}

.xt-scroll-top__icon svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 640px) {
    .xt-scroll-top {
        right: 1rem;
        bottom: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}
