/* ============================================
   Site chrome — header & footer (marketplace)
   Load after components.css
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Top bar ----- */
.header-top {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    color: var(--text-inverse);
    padding: 0.4rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-top-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.82);
    opacity: 1;
    padding: 0.2rem 0;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.header-top-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.header-top-links a i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.header-top-links--left {
    gap: 1rem;
}

.header-top-links--right {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (min-width: 769px) {
    .header-top-links--left li + li::before,
    .header-top-links--right .header-top-muted + li::before {
        content: "";
        display: none;
    }

    .header-top-links--left li + li {
        padding-left: 0.75rem;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
    }
}

.header-top-em {
    font-weight: 600;
    color: #a7f3d0 !important;
}

.header-top-em:hover {
    color: #d1fae5 !important;
}

.header-top-muted {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.625rem;
    align-self: center;
}

/* ----- Main header ----- */
.header {
    background: var(--bg-primary);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
    border-bottom: none;
}

.header-main {
    padding: 0.85rem 0 0.65rem;
}

.logo-img {
    height: 46px;
}

.search-container {
    max-width: none;
}

.search-form {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.search-form:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15), 0 4px 12px -4px rgba(5, 150, 105, 0.25);
}

.search-category {
    border-right-color: var(--border-light);
    font-weight: 500;
}

.search-input {
    background: transparent;
}

.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    padding-inline: 1.35rem;
}

/* Actions */
.action-btn {
    border-radius: var(--radius-md);
    padding: 0.4rem 0.65rem;
    min-width: 3rem;
}

.action-btn:hover {
    background: var(--gray-50);
}

.action-btn-icon {
    font-size: 1.15rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--primary-dark);
}

.action-btn:hover .action-btn-icon {
    background: var(--primary-50);
}

.action-badge {
    top: -2px;
    right: -2px;
    width: 1.125rem;
    height: 1.125rem;
    font-size: 0.5625rem;
}

/* ----- Primary nav ----- */
.nav-menu {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    /* Let category mega-menu paint outside the bar (see .nav-menu-content below). */
    overflow: visible;
}

.nav-menu .container {
    overflow: visible;
}

.nav-menu-content {
    gap: 0.15rem;
    row-gap: 0.35rem;
    /* overflow-x: auto clips overflow-y in browsers, which hid the mega-menu entirely. */
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    padding: 0.15rem 0;
}

.nav-menu-link {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.nav-menu-link:hover {
    background: rgba(5, 150, 105, 0.08);
    color: var(--primary-dark);
}

.nav-menu-highlight {
    color: var(--error) !important;
}

.nav-menu-highlight:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

.nav-menu-link.has-dropdown::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.5rem;
    margin-left: 0.35rem;
    opacity: 0.5;
}

.nav-menu-badge {
    display: inline-flex;
    margin-left: 0.35rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

.nav-menu-badge--accent {
    background: rgba(5, 150, 105, 0.15);
    color: var(--primary-dark);
}

@media (max-width: 480px) {
    .search-button-text {
        clip: rect(0, 0, 0, 0);
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
    }

    .search-button {
        padding-inline: 1rem;
        min-width: 3rem;
    }
}

.mega-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    margin-top: 0;
    top: calc(100% - 6px);
    padding-top: 0.5rem;
    box-shadow: var(--shadow-xl);
}

.mega-menu-title {
    font-family: var(--font-display);
    font-size: 0.8125rem;
}

/* ----- Site footer ----- */
.site-footer {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    background: #0f172a;
    color: rgba(255, 255, 255, 0.88);
}

.site-footer--grow {
    margin-top: auto;
}

.site-footer-trust {
    background: linear-gradient(90deg, #059669 0%, #047857 50%, #0f766e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer-trust-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.site-footer-trust-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    text-decoration: none;
}

.site-footer-trust-item i {
    font-size: 1.25rem;
    opacity: 0.95;
}

.site-footer-trust-item small {
    display: block;
    font-weight: 400;
    font-size: 0.6875rem;
    opacity: 0.88;
    margin-top: 0.1rem;
}

.site-footer-main {
    padding: 2.75rem 0 2rem;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1.15fr repeat(4, 1fr);
    gap: 2rem 1.5rem;
}

.site-footer-brand {
    padding-right: 1rem;
}

.site-footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.site-footer-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.site-footer-tagline {
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1.25rem;
}

.site-footer-newsletter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 22rem;
}

.site-footer-newsletter input {
    flex: 1 1 140px;
    min-width: 0;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.8125rem;
}

.site-footer-newsletter input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.site-footer-newsletter .btn {
    flex-shrink: 0;
}

.site-footer-col h3 {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 1rem;
}

.site-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-footer-col a {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color var(--transition-base);
}

.site-footer-col a:hover {
    color: #fff;
}

.site-footer-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.site-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9rem;
}

.site-footer-social a:hover {
    background: var(--primary);
    color: #fff;
}

.site-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0 1.5rem;
    background: #020617;
}

.site-footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.48);
}

.site-footer-bottom-inner strong {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-legal a {
    color: rgba(255, 255, 255, 0.48);
    text-decoration: none;
}

.site-footer-legal a:hover {
    color: #fff;
}

/* ----- Responsive header ----- */
@media (max-width: 1024px) {
    .site-footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer-brand {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .site-footer-trust-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .header-top-links--left,
    .header-top-links--right {
        justify-content: center;
        gap: 0.5rem 0.75rem;
    }

    .header-top-links--left li {
        border-left: none !important;
        padding-left: 0 !important;
    }

    .header-main-content {
        flex-wrap: wrap;
        row-gap: 0.75rem;
    }

    .header-main-content > .logo {
        order: 1;
    }

    .header-main-content > .header-actions {
        order: 2;
        margin-left: auto;
    }

    .header-main-content > .search-container {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .action-btn span:not(.action-btn-icon):not(.action-badge) {
        display: none;
    }

    .action-btn {
        min-width: auto;
    }

    .site-footer-trust-inner {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .site-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    .site-footer-legal {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-top-muted {
        width: 100%;
        text-align: center;
    }
}
