/* Site header — shop & inner pages */
.close-container {
    padding: 14px clamp(16px, 4vw, 40px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: opacity 0.2s;
    pointer-events: auto;
}

.close-container.site-header {
    justify-content: stretch;
}

body.modal-open .close-container {
    z-index: 1 !important;
    pointer-events: none !important;
    opacity: 0;
}

.site-header-left {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(12px, 2.5vw, 24px);
    justify-self: start;
    min-width: 0;
}

.site-header-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-header-back {
    text-decoration: none;
    color: #444;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.site-header-back:hover {
    color: #111;
}

.site-header-brand {
    justify-self: center;
    text-decoration: none;
    color: #111;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.site-header-brand:hover {
    color: #555;
}

/* Legacy close button (pages not yet using site-header.js) */
.close-btn {
    text-decoration: none;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #888;
}

.auth-header-btns {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 10px 14px;
    justify-self: end;
    min-width: 0;
}

.auth-header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.auth-header-link:hover {
    color: #666;
}

.auth-header-link svg {
    flex-shrink: 0;
}

.auth-header-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #111;
}

.cart-header-link {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Offset page content below fixed header */
body.catalog-page,
body.obra-detail-page,
body.shop-page {
    padding-top: 72px;
}

@media (max-width: 720px) {
    body.catalog-page,
    body.obra-detail-page,
    body.shop-page {
        /* Two-row site header (back/auth + brand) */
        padding-top: 104px;
    }
}

@media (max-width: 900px) {
    .auth-header-link {
        font-size: 0;
        letter-spacing: 0;
        gap: 0;
        width: 38px;
        height: 38px;
        justify-content: center;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .auth-header-link svg {
        width: 18px;
        height: 18px;
    }

    .auth-header-btns {
        gap: 6px;
    }
}

@media (max-width: 720px) {
    .close-container {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "back auth"
            "brand brand";
        row-gap: 8px;
    }

    .site-header-left {
        grid-area: back;
        gap: 10px;
    }

    .site-header-back {
        font-size: 0.72rem;
    }

    .site-header-brand {
        grid-area: brand;
        justify-self: center;
        font-size: 1.05rem;
    }

    .auth-header-btns {
        grid-area: auth;
        gap: 8px;
    }
}

@keyframes pageEntrance {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body {
    animation: pageEntrance 0.35s ease-out;
}
