/* ═══════════════════════════════════════════
   includes.css — Header & Footer Styles
   ═══════════════════════════════════════════ */

/* ───── HEADER ───── */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: var(--header-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(232,234,237,0.5);
    z-index: 1000;
    transition: var(--transition);
}
.site-header.scrolled { background: rgba(255,255,255,0.97); box-shadow: 0 1px 20px rgba(0,0,0,0.04); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-img { height: 62px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-backdrop {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0,0,0,0.25);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nav-backdrop.open { opacity: 1; visibility: visible; }
.nav-item {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    padding: 20px 12px;
    cursor: pointer;
    background: none; border: none; font-family: inherit;
    min-height: auto; display: inline-flex; align-items: center; gap: 3px;
}
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 12px;
    width: calc(100% - 24px); height: 2.5px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 3px;
}
.nav-item:hover { color: var(--accent); }
.nav-item:hover::after { transform: scaleX(1); }
.nav-item.active { color: var(--accent); }
.nav-item.active::after { transform: scaleX(1); }
.dd-arrow { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s; }
.nav-dropdown.open .dd-arrow { transform: rotate(180deg); }
.nav-dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
    min-width: 170px;
    background: #fff; border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    opacity: 0;     visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.22,1,0.36,1), visibility 0.25s cubic-bezier(0.22,1,0.36,1);
    z-index: 1001;
}
.nav-dropdown.open .dropdown-menu,
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(4px); }
.dropdown-link {
    display: block; padding: 8px 14px;
    font-size: 0.8125rem; font-weight: 500;
    color: var(--text-secondary); border-radius: 8px;
    transition: background 0.2s, color 0.2s; text-decoration: none;
}
.dropdown-link:hover { background: var(--accent-subtle); color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; position: relative; z-index: 1001; }
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
}
.hamburger:active { background: rgba(0,0,0,0.05); }
.hamburger span {
    display: block;
    width: 22px; height: 2.5px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}
.btn-header-cta { padding: 6px 18px; font-size: 0.75rem; }
.btn-login {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 18px 6px 16px; border-radius: 999px; font-size: 0.75rem;
    font-weight: 600; font-family: var(--font-body);
    min-height: 44px; background: #000; color: #fff;
    border: none; cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.btn-login svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-menu-wide { min-width: 190px; }

@media (max-width: 1024px) {
    .nav-links {
        position: fixed;
        top: var(--header-h); left: 0; right: 0;
        width: 100%;
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px 20px;
        gap: 2px;
        border-bottom: 1px solid var(--border);
        display: none;
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        align-items: stretch;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 999;
    }
    .nav-links.open {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .nav-item { display: flex; justify-content: flex-start; min-height: 44px; padding: 10px 0; font-size: 0.9375rem; width: 100%; }
    .nav-item::after { display: none; }
    .nav-dropdown { width: 100%; }
    .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
    .dropdown-menu {
        position: static; transform: none !important;
        min-width: auto; width: 100%;
        border-radius: 10px; margin: 2px 0 4px;
        box-shadow: none; border: 1px solid var(--border-light);
        background: var(--bg-warm);
        display: none;
        opacity: 1; visibility: visible;
    }
    .nav-dropdown.open .dropdown-menu {
        display: block;
        transform: none !important;
        opacity: 1; visibility: visible;
    }
    .dropdown-link { padding: 10px 14px; font-size: 0.8125rem; }
    .hamburger { display: flex; }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    .header-actions .btn { display: none; }
    .site-header { z-index: 1000; }
    .header-actions { z-index: 1001; }
    .an-um-wrap { z-index: 1002; }
    .an-um-dropdown { min-width: 220px; }
    .an-um-toggle { min-height: 44px; min-width: 44px; padding: 6px; }
    .an-um-avatar { width: 32px; height: 32px; }
}

/* ───── FOOTER ───── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 72px 0 28px;
    background: #FAFBFC;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    max-width: 100%;
    box-sizing: border-box;
}
.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 18px;
}
.footer-col a {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding: 6px 0;
    transition: var(--transition);
}
.footer-col a:hover { color: var(--accent); transform: translateX(4px); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { color: var(--text-tertiary); transition: var(--transition); }
.footer-bottom-links a:hover { color: var(--accent); }
.footer-social {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}
.footer-brand-logo { display: inline-flex; margin-bottom: 18px; }
.footer-brand-img { height: 62px; width: auto; }
.footer-brand-text { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.8; max-width: 360px; }
.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: #6B7280;
    border-radius: 50%;
    background: #F3F4F6;
}
.social-link .social-icon {
    width: 16px;
    height: 16px;
}
.social-link .social-tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--brand);
    padding: 2px 9px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.social-link .social-tooltip::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 5px;
    height: 5px;
    background: var(--brand);
    border-radius: 1px;
}
.social-link:hover {
    color: #fff;
    background: var(--brand);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 35%, transparent);
}
.social-link:hover .social-icon { transform: scale(1.15); }
.social-link:hover .social-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.social-link:active { transform: translateY(-1px) scale(0.95); }
.footer-logo-link { display: inline-flex; margin-bottom: 18px; }

/* ── User Dropdown (Header) ── */
.an-um-wrap { position: relative; }
.an-um-toggle {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 6px 3px 3px; border-radius: 999px;
    background: transparent; border: 1.5px solid var(--border-color);
    cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
    min-height: auto; min-width: auto; font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.an-um-toggle:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,176,80,0.06); }
.an-um-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
}
.an-um-chevron { width: 14px; height: 14px; color: var(--text-tertiary); transition: transform 0.25s; }
.an-um-wrap.open .an-um-chevron { transform: rotate(180deg); }

.an-um-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 260px; background: #fff; border-radius: 14px;
    box-shadow: 0 16px 56px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
    opacity: 0; visibility: hidden; transform: translateY(8px) scale(0.97);
    transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
    z-index: 1001; transform-origin: top right;
}
.an-um-wrap.open .an-um-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.an-um-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 16px 14px; border-bottom: 1px solid var(--border-light);
}
.an-um-head-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--green-deep); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700;
    flex-shrink: 0;
}
.an-um-head-info { min-width: 0; }
.an-um-head-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-um-head-email { font-size: 0.6875rem; color: var(--text-tertiary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.an-um-body { padding: 6px; }
.an-um-foot { padding: 6px; border-top: 1px solid var(--border-light); }

.an-um-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary);
    transition: background 0.15s, color 0.15s; min-height: auto;
}
.an-um-item:hover { background: var(--bg-warm); color: var(--text-primary); }
.an-um-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-tertiary); transition: color 0.15s; }
.an-um-item:hover .an-um-icon { color: var(--accent); }
.an-um-item-danger { color: #E53935; }
.an-um-item-danger:hover { background: #fef2f2; color: #b91c1c; }
.an-um-item-danger:hover .an-um-icon { color: #E53935; }
.an-um-item-label { flex: 1; }

@media (max-width: 768px) {
    .logo-img { height: 42px; }
    .nav-item { font-size: 0.8125rem; padding: 14px 10px; }
    .an-um-toggle { min-height: 38px; min-width: 38px; }
    .an-um-avatar { width: 30px; height: 30px; }
    .btn-login { padding: 5px 14px 5px 12px; font-size: 0.6875rem; min-height: 38px; gap: 5px; }
    .btn-login svg { width: 13px; height: 13px; }
    .footer-top { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
    .logo-img { height: 36px; }
    .nav-item { font-size: 0.75rem; padding: 12px 8px; }
    .hamburger { padding: 3px; min-width: 32px; min-height: 32px; }
    .hamburger span { width: 18px; height: 2px; }
    .nav-links { padding: 14px 12px; gap: 1px; }
    .an-um-toggle { min-height: 32px; min-width: 32px; padding: 4px; }
    .an-um-avatar { width: 24px; height: 24px; }
    .btn-login { padding: 4px 10px 4px 8px; font-size: 0.625rem; min-height: 32px; gap: 4px; }
    .btn-login svg { width: 12px; height: 12px; }
    .footer-top { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 360px) {
    .logo-img { height: 36px; }
    .nav-item { font-size: 0.6875rem; padding: 10px 6px; }
    .hamburger { padding: 2px; min-width: 28px; min-height: 28px; }
    .hamburger span { width: 14px; height: 1.5px; }
    .nav-links { padding: 10px 8px; gap: 0; }
    .an-um-toggle { min-height: 28px; min-width: 28px; }
    .an-um-avatar { width: 22px; height: 22px; }
    .btn-login { padding: 3px 8px 3px 6px; font-size: 0.5625rem; min-height: 28px; gap: 3px; }
    .btn-login svg { width: 11px; height: 11px; }
    .footer-top { gap: 16px; }
    .footer-bottom { font-size: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
img, video, iframe, canvas { max-width: 100%; height: auto; }
table { overflow-x: auto; display: block; max-width: 100%; }
