/* =================================================
   HEADER GENERAL
   ================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: visible;
}

.nav-wrap {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

/* =================================================
   MARCA
   ================================================= */

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: var(--text-md);
    color: var(--text-main);
    flex-shrink: 0;
}

    .brand img {
        width: clamp(132px, 13vw, 166px);
        height: auto;
        max-height: 56px;
        object-fit: contain;
        border-radius: 0;
        flex-shrink: 0;
    }

    .brand span {
        letter-spacing: -0.02em;
    }

/* =================================================
   NAVEGACIÓN
   ================================================= */

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    flex-wrap: wrap;
    position: relative;
}

    .nav-links a,
    .nav-links button {
        font-size: var(--text-sm);
    }

    .nav-links a {
        color: var(--text-soft);
        font-weight: 500;
        position: relative;
        transition: color var(--transition-fast);
    }

        .nav-links a:hover,
        .nav-links a.active {
            color: var(--text-main);
        }

            .nav-links a.active::after,
            .nav-links a:hover::after {
                content: "";
                position: absolute;
                left: 0;
                bottom: -0.35rem;
                width: 100%;
                height: 2px;
                background: var(--accent);
                border-radius: 999px;
            }

.nav-overflow,
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-overflow {
    order: 4;
}

.nav-menu {
    order: 4;
}

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

/* slot auth */
#authSlot {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    order: 5;
}

/* =================================================
   HERO
   ================================================= */

.hero {
    position: relative;
    overflow: hidden;
}

    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top right, rgba(200, 164, 123, 0.12), transparent 28%), radial-gradient(circle at bottom left, rgba(200, 164, 123, 0.08), transparent 30%);
        pointer-events: none;
    }

    .hero .container {
        position: relative;
        z-index: 1;
    }

.hero-grid > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero .cluster {
    margin-top: var(--space-2);
}

.hero-card img {
    width: 100%;
    max-width: 340px;
}

.hero-card p {
    text-align: center;
}

/* =================================================
   KPI GRID
   ================================================= */

.kpis .card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =================================================
   SECCIONES DESTACADAS
   ================================================= */

.service-card,
.resource-card,
.photo-card,
.pet-card,
.request-card {
    height: 100%;
}

    .service-card h3,
    .resource-card h3,
    .photo-card h3,
    .pet-card h3,
    .request-card h3 {
        margin-top: var(--space-1);
        margin-bottom: var(--space-2);
    }

    .service-card p,
    .resource-card p,
    .photo-card p,
    .pet-card p,
    .request-card p {
        color: var(--text-soft);
    }

/* =================================================
   FOTOS DE ESPACIO
   ================================================= */

.photo-card {
    display: flex;
    flex-direction: column;
}

    .photo-card img {
        width: 100%;
        height: 240px;
        object-fit: cover;
        margin-bottom: var(--space-4);
    }

/* =================================================
   RECURSOS
   ================================================= */

.resource-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

    .resource-card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        border-radius: var(--radius-md);
    }

    .resource-card .notice {
        margin-top: auto;
    }

/* =================================================
   DASHBOARD INTERNO
   ================================================= */

.dashboard-grid {
    align-items: start;
}

    .dashboard-grid > section,
    .dashboard-grid > aside {
        min-width: 0;
    }

/* =================================================
   FORMULARIOS / AUTH
   ================================================= */

.auth-wrap {
    padding-block: var(--space-8);
}

    .auth-wrap .two-col {
        align-items: stretch;
    }

    .auth-wrap .card,
    .dashboard-grid .card {
        height: 100%;
    }

/* =================================================
   LISTAS DE MASCOTAS Y SOLICITUDES
   ================================================= */

.pet-card,
.request-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

    .pet-card .cluster {
        align-items: center;
    }

.mascot-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-soft);
}

    .mascot-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* =================================================
   STATUS BADGES
   ================================================= */

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid transparent;
}

    .status.pending {
        color: var(--warning);
        background: rgba(217, 181, 111, 0.12);
        border-color: rgba(217, 181, 111, 0.22);
    }

    .status.contacted,
    .status.confirmed {
        color: var(--success);
        background: rgba(143, 187, 145, 0.12);
        border-color: rgba(143, 187, 145, 0.22);
    }

    .status.cancelled {
        color: var(--danger);
        background: rgba(204, 127, 127, 0.12);
        border-color: rgba(204, 127, 127, 0.22);
    }

/* =================================================
   FOOTER
   ================================================= */

.site-footer {
    margin-top: var(--space-10);
    padding-block: var(--space-6);
    border-top: 1px solid var(--border-soft);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
        var(--nido-dark-canvas);
}

    .site-footer .container {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .site-footer .footer-content {
        flex-wrap: wrap;
        gap: var(--space-3) var(--space-5);
        text-align: center;
    }

    .site-footer p,
    .site-footer a {
        margin: 0;
        color: var(--text-soft);
        font-size: var(--text-sm);
        line-height: var(--line-normal);
        text-align: center;
    }

    .site-footer a {
        color: var(--accent-hover);
        font-weight: 700;
        text-decoration: none;
    }

        .site-footer a:hover,
        .site-footer a:focus-visible {
            color: var(--text-main);
            outline: none;
            text-decoration: underline;
            text-underline-offset: 0.25rem;
        }

    .site-footer .footer-credit {
        color: var(--text-muted);
    }

    .footer-social {
        display: inline-flex;
        align-items: center;
        gap: var(--space-3);
        padding: 0.35rem 0.45rem 0.35rem 0.75rem;
        border: 1px solid rgba(200, 164, 123, 0.12);
        border-radius: var(--radius-pill);
        background: rgba(255, 255, 255, 0.025);
    }

    .footer-social-title {
        color: var(--text-soft);
        font-size: var(--text-sm);
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
    }

    .footer-social-list {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
    }

    .site-footer .footer-social-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-grid;
        place-items: center;
        padding: 0.25rem;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        background: transparent;
        color: var(--text-main);
        transition:
            border-color var(--transition-fast),
            opacity var(--transition-fast),
            transform var(--transition-fast),
            box-shadow var(--transition-fast);
    }

        .site-footer .footer-social-link:hover,
        .site-footer .footer-social-link:focus-visible {
            border-color: rgba(200, 164, 123, 0.28);
            opacity: 1;
            outline: none;
            text-decoration: none;
            transform: translateY(-1px);
            box-shadow: var(--nido-focus-ring);
        }

    .footer-social-icon {
        width: 34px;
        height: 34px;
        display: block;
        object-fit: contain;
    }

/* =================================================
   RESPONSIVE
   ================================================= */

@media (max-width: 980px) {
    .site-header {
        display: block;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .nav-wrap {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: var(--space-2);
        padding-block: 0.6rem 0.55rem;
    }

    .nav-links {
        display: grid;
        grid-template-columns: auto auto auto minmax(4.6rem, 1fr) 40px;
        align-items: center;
        width: 100%;
        gap: 0.25rem;
        overflow: visible;
        isolation: isolate;
    }

        .nav-links a,
        .nav-links button {
            min-height: 40px;
            border-radius: var(--radius-pill);
            -webkit-tap-highlight-color: transparent;
        }

        .nav-links > a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
            padding: 0.62rem 0.42rem;
            color: var(--text-soft);
            font-size: clamp(0.68rem, 2.6vw, 0.82rem);
            font-weight: 700;
            line-height: 1.1;
            text-align: center;
            white-space: nowrap;
            border: 1px solid transparent;
        }

            .nav-links > a.active,
            .nav-links > a:hover {
                border-color: rgba(200, 164, 123, 0.18);
                background: rgba(200, 164, 123, 0.08);
            }

            .nav-links > a.active::after,
            .nav-links > a:hover::after {
                display: none;
            }

    .nav-overflow {
        position: relative;
        justify-self: end;
        z-index: 5;
        order: 5;
    }

    .nav-menu-toggle {
        width: 40px;
        height: 40px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        border: 1px solid rgba(200, 164, 123, 0.2);
        background: rgba(200, 164, 123, 0.08);
        color: var(--text-main);
        cursor: pointer;
        transition:
            background var(--transition-fast),
            border-color var(--transition-fast),
            box-shadow var(--transition-fast);
    }

        .nav-menu-toggle span {
            width: 17px;
            height: 2px;
            border-radius: 999px;
            background: currentColor;
            transition:
                transform var(--transition-fast),
                opacity var(--transition-fast);
        }

        .nav-menu-toggle:hover,
        .nav-menu-toggle:focus-visible {
            border-color: rgba(200, 164, 123, 0.42);
            background: rgba(200, 164, 123, 0.14);
            outline: none;
            box-shadow: var(--nido-focus-ring);
        }

        .nav-menu-toggle[aria-expanded="true"] span:nth-child(1) {
            transform: translateY(6px) rotate(45deg);
        }

        .nav-menu-toggle[aria-expanded="true"] span:nth-child(2) {
            opacity: 0;
        }

        .nav-menu-toggle[aria-expanded="true"] span:nth-child(3) {
            transform: translateY(-6px) rotate(-45deg);
        }

    .nav-menu {
        position: absolute;
        top: calc(100% + 0.55rem);
        right: 0;
        width: min(13rem, calc(100vw - 1.25rem));
        display: grid;
        gap: 0.35rem;
        padding: var(--space-3);
        border: 1px solid rgba(200, 164, 123, 0.2);
        border-radius: var(--radius-lg);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
            var(--nido-dark-elevated);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        pointer-events: none;
        transition:
            opacity var(--transition-fast),
            transform var(--transition-fast),
            visibility var(--transition-fast);
    }

        .nav-overflow.is-open .nav-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            pointer-events: auto;
        }

        .nav-menu a,
        .nav-menu button,
        .nav-menu #authSlot a,
        .nav-menu #authSlot button {
            width: 100%;
            min-height: 44px;
            justify-content: flex-start;
            padding: 0.72rem 0.85rem;
            border-radius: var(--radius-md);
            font-size: var(--text-sm);
            line-height: 1.2;
        }

        .nav-menu a.active,
        .nav-menu a:hover,
        .nav-menu a:focus-visible,
        .nav-menu button:hover,
        .nav-menu button:focus-visible {
            color: var(--text-main);
            background: rgba(200, 164, 123, 0.1);
            outline: none;
        }

            .nav-menu a.active::after,
            .nav-menu a:hover::after {
                display: none;
            }

        .nav-menu #authSlot {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0.35rem;
        }

    #authSlot {
        min-width: 0;
        justify-content: flex-start;
        order: 4;
    }

        #authSlot .btn {
            min-height: 40px;
            max-width: 100%;
            padding: 0.62rem 0.54rem;
            font-size: clamp(0.68rem, 2.6vw, 0.82rem);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #authSlot .btn-ghost {
            display: none;
        }

    .hero-card {
        max-width: 100%;
    }
}

@media (max-width: 760px) {
    .site-header {
        position: sticky;
        align-items: flex-start;
    }

    .nav-wrap {
        gap: var(--space-2);
        padding-top: 0.6rem;
        padding-bottom: 0.52rem;
    }

    .brand {
        font-size: var(--text-base);
        min-height: 42px;
    }

        .brand img {
            width: min(140px, 48vw);
            height: auto;
            max-height: 44px;
        }

    .nav-links {
        gap: 0.22rem;
    }

        .nav-links > a {
            padding-inline: 0.28rem;
        }

    .photo-card img {
        height: 210px;
    }

    .resource-card img {
        height: 170px;
    }

    .hero-card p {
        text-align: left;
    }

    #authSlot {
        width: auto;
    }

    .footer-social-title {
        width: 100%;
        text-align: center;
    }

    .footer-social {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        border-radius: var(--radius-lg);
        padding: var(--space-3);
    }
}
