/**
 * Header Component Styles
 * Dedicated styles for header/navigation
 */

/* ===========================================
   Base Header
   =========================================== */
.csm-header {
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inner flex container */
.csm-header > .wp-block-group {
    width: 100%;
}

/* ===========================================
   Logo
   =========================================== */
.csm-logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Logo image - Inherit size from HTML */
.csm-logo-image,
.csm-logo-image.wp-block-image,
figure.csm-logo-image,
figure.wp-block-image.csm-logo-image,
figure.wp-block-image.is-resized.csm-logo-image {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    flex-shrink: 0 !important;
}

.csm-logo-image img,
figure.csm-logo-image img,
figure.wp-block-image.csm-logo-image img,
.csm-logo-image.is-resized img {
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    display: block !important;
}

/* Logo text */
.csm-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.csm-site-title-text {
    line-height: 1;
}

.csm-logo-subtitle {
    line-height: 1;
}

/* ===========================================
   Navigation
   =========================================== */
.csm-nav-desktop {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.csm-nav-links {
    display: flex;
    align-items: center;
}

/* Underline hover only for nav links, NOT the button */
.csm-nav-links a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.csm-nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.csm-nav-links a:hover::after {
    width: 100%;
}

/* Reservar button - no underline, proper hover */
.csm-btn-reservar .wp-block-button__link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.csm-btn-reservar .wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 102, 0.3);
}

.csm-btn-reservar .wp-block-button__link::after {
    display: none !important;
}

/* Mobile navigation toggle - hidden by default on desktop */
.csm-nav-mobile {
    display: none !important;
}

.csm-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--csm-primary, #006666);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 1023px) {
    .csm-nav-desktop {
        display: none !important;
    }
    .csm-nav-mobile {
        display: block !important;
    }

    .csm-header {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .csm-logo-image img {
        width: 44px !important;
        height: 44px !important;
    }

    .csm-site-title-text {
        font-size: 1.125rem !important;
    }

    .csm-logo-subtitle {
        font-size: 0.5rem !important;
    }
}

/* ===========================================
   Mobile Menu — Left slide drawer
   =========================================== */

/* Backdrop */
.csm-mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: pointer;
}

.csm-mobile-menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.csm-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    background: var(--csm-primary, #006666);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.csm-mobile-menu.is-open {
    transform: translateX(0);
}

/* Header — logo + close button */
.csm-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.csm-mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease 0.2s, transform 0.35s ease 0.2s;
}

.csm-mobile-menu.is-open .csm-mobile-menu-logo {
    opacity: 1;
    transform: translateX(0);
}

.csm-mobile-menu-logo img {
    width: 52px;
    height: 52px;
}

.csm-mobile-menu-wordmark {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1;
}

.csm-mobile-menu-title {
    color: #ffffff;
    font-family: 'BenchNine', sans-serif;
    font-size: 1.375rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1;
}

.csm-mobile-menu-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--wp--preset--font-family--sans);
    font-size: 0.625rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    line-height: 1;
    margin-top: 0.25em;
}

.csm-mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.csm-mobile-menu-close:hover,
.csm-mobile-menu-close:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Navigation links — centradas para full-screen */
.csm-mobile-menu-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    flex: 1;
}

.csm-mobile-menu-nav a {
    display: block;
    width: 100%;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-family: var(--wp--preset--font-family--sans);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    padding: 1rem 2rem;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.35s ease, transform 0.35s ease, color 0.2s ease, background 0.2s ease;
}

.csm-mobile-menu.is-open .csm-mobile-menu-nav a {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered entrance — slides from left, one by one */
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(1) { transition-delay: 0.12s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(2) { transition-delay: 0.18s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(3) { transition-delay: 0.24s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(4) { transition-delay: 0.30s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(5) { transition-delay: 0.36s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(6) { transition-delay: 0.42s; }
.csm-mobile-menu.is-open .csm-mobile-menu-nav a:nth-child(7) { transition-delay: 0.48s; }

.csm-mobile-menu-nav a::after {
    content: '';
    position: absolute;
    left: 2.5rem;
    right: 2.5rem;
    bottom: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.csm-mobile-menu-nav a:last-child::after {
    display: none;
}

.csm-mobile-menu-nav a:hover,
.csm-mobile-menu-nav a:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.csm-mobile-menu-nav a.is-active {
    color: var(--csm-accent, #DFAD2B);
}

.csm-mobile-menu-nav a.csm-mobile-menu-reservar {
    color: var(--csm-accent, #DFAD2B);
    margin-top: 0.5rem;
}

/* Footer — bottom of panel */
.csm-mobile-menu-footer {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease 0.45s;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.csm-mobile-menu.is-open .csm-mobile-menu-footer {
    opacity: 1;
}

.csm-mobile-menu-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: background 0.2s ease;
}

.csm-mobile-menu-cta:hover {
    background: rgba(255, 255, 255, 0.2);
}

.csm-mobile-menu-phone {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.csm-mobile-menu-phone:hover {
    color: #ffffff;
}
