/* =========================================================
   Certiva Services: header dropdown (site-wide) + /services page
   Brand: charcoal #07070a, orange #e8942e / #f0a84a, text #f4efe6
   ========================================================= */

/* ---------- Site-wide mobile fixes ---------- */
/* The off-canvas menu sits past the right edge and made every page ~750px wide on phones */
html,
body {
    overflow-x: clip;
}

/* Header and footer had no side padding below ~1250px, so the logo and footer text touched the screen edge */
.site-header .container.nav-shell,
.site-footer .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

/* Phones: "Customer login" is in the menu drawer, so drop it from the bar to stop it overlapping the logo */
@media (max-width: 560px) {
    .site-header .nav-actions__customer {
        display: none;
    }

    .site-header .nav-actions {
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .site-header .nav-actions .button-primary {
        padding-left: 14px;
        padding-right: 14px;
        font-size: 13px;
    }
}

/* ---------- Header: Services link + dropdown toggle ---------- */
.nav-svc {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: var(--radius-pill, 999px);
}

.nav-links .nav-svc > a.nav-svc__link {
    padding-right: 6px;
}

.nav-svc__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    margin-left: -2px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: transparent;
    color: var(--text-secondary, #c9c2b6);
    cursor: pointer;
}

.nav-svc__toggle:hover,
.nav-svc__toggle[aria-expanded="true"] {
    color: var(--accent-bright, #f0a84a);
    background: rgba(255, 255, 255, 0.05);
}

.nav-svc__toggle:focus-visible {
    outline: 2px solid var(--accent, #e8942e);
    outline-offset: 2px;
}

.nav-svc__toggle svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.nav-svc__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Panel lives in .site-header (outside the scrolling nav) so it is never clipped */
.nav-svc-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 60;
    width: min(400px, calc(100vw - 32px));
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.12));
    background: #0c0c12;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 148, 46, 0.06);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-svc-panel[hidden] {
    display: none;
}

.nav-svc-panel.is-open {
    opacity: 1;
    transform: translateY(0);
}

.nav-svc-panel__item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    color: var(--text, #f4efe6);
    text-decoration: none;
}

.nav-svc-panel__item:hover,
.nav-svc-panel__item:focus-visible {
    background: rgba(232, 148, 46, 0.08);
    outline: none;
}

.nav-svc-panel__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(232, 148, 46, 0.14);
    border: 1px solid rgba(232, 148, 46, 0.25);
    color: var(--accent-bright, #f0a84a);
}

.nav-svc-panel__icon svg {
    width: 20px;
    height: 20px;
}

.nav-svc-panel__copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.nav-svc-panel__name {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.nav-svc-panel__line {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted, #9a9288);
}

.nav-svc-panel__all {
    display: block;
    margin-top: 4px;
    padding: 12px;
    border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-bright, #f0a84a);
    text-decoration: none;
}

.nav-svc-panel__all:hover {
    color: var(--text, #f4efe6);
}

/* Mobile drawer: keep links in one column (the drawer scrolls) and show service sub-links */
.nav-drawer .nav-links {
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.nav-drawer__sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: -2px 0 6px 14px;
    padding-left: 12px;
    border-left: 1px solid rgba(232, 148, 46, 0.25);
}

.nav-drawer .nav-links .nav-drawer__sub a {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-secondary, #c9c2b6);
}

/* ---------- /services page ---------- */

.module-services-catalog {
    padding-top: clamp(40px, 7vw, 88px);
    padding-bottom: clamp(56px, 8vw, 96px);
}

.svc-page {
    display: flex;
    flex-direction: column;
}

.svc-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 820px;
    margin: 0 auto clamp(36px, 6vw, 56px);
    text-align: center;
}

.svc-hero__title {
    margin: 0;
    font-size: clamp(2.1rem, 5.2vw, 3.75rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 700;
    color: var(--text, #f4efe6);
    text-wrap: balance;
}

.svc-hero__title span {
    color: var(--accent-bright, #f0a84a);
}

.svc-hero__lead {
    margin: 0;
    max-width: 620px;
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    line-height: 1.62;
    color: var(--text-secondary, #c9c2b6);
}

.svc-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

/* Tabs */
.svc-tabs-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: clamp(28px, 5vw, 48px);
    scroll-margin-top: 110px;
}

.svc-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.025);
    max-width: 100%;
}

.svc-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-secondary, #c9c2b6);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.svc-tab:hover {
    color: var(--text, #f4efe6);
    background: rgba(255, 255, 255, 0.05);
}

.svc-tab.is-active,
.svc-tab[aria-selected="true"] {
    background: var(--accent, #e8942e);
    color: #07070a;
    font-weight: 700;
}

.svc-tab:focus-visible {
    outline: 2px solid var(--accent-bright, #f0a84a);
    outline-offset: 2px;
}

/* Panels: without JS all panels show stacked; with JS only the active one */
.svc-panel {
    scroll-margin-top: 110px;
    outline: none;
}

.svc-panel + .svc-panel {
    margin-top: 64px;
}

.svc-page.is-tabbed .svc-panel + .svc-panel {
    margin-top: 0;
}

.svc-panel[hidden] {
    display: none;
}

.svc-panel__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.svc-panel__title {
    margin: 0;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text, #f4efe6);
}

.svc-panel__intro {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    color: var(--text-secondary, #c9c2b6);
}

.svc-panel__note {
    margin: 24px auto 0;
    max-width: 640px;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    color: var(--muted, #9a9288);
}

/* Cards: 1 col phone, 2 col tablet, 3 col desktop */
.svc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .svc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .svc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.svc-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 20px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.svc-card:hover {
    border-color: rgba(232, 148, 46, 0.3);
    box-shadow: 0 0 0 1px rgba(232, 148, 46, 0.08), 0 16px 48px rgba(232, 148, 46, 0.06);
    transform: translateY(-2px);
}

.svc-card__media {
    margin: 10px 10px 0;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #12121a;
}

.svc-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.svc-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 18px 20px 22px;
}

.svc-card__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text, #f4efe6);
}

.svc-card__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary, #c9c2b6);
}

.svc-card__link {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-bright, #f0a84a);
    text-decoration: none;
}

.svc-card__link:hover {
    color: var(--text, #f4efe6);
}

/* Bottom band */
.svc-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: clamp(56px, 8vw, 96px);
    padding: clamp(36px, 6vw, 56px) clamp(20px, 4vw, 32px);
    border-radius: 24px;
    border: 1px solid rgba(232, 148, 46, 0.25);
    background: #0c0c12;
    box-shadow: 0 0 60px rgba(232, 148, 46, 0.1);
    text-align: center;
}

.svc-cta__title {
    margin: 0;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text, #f4efe6);
}

.svc-cta__text {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.0625rem);
    color: var(--text-secondary, #c9c2b6);
}

.svc-cta .button {
    margin-top: 6px;
}

/* Phones: tabs become a 2x2 grid so all four stay visible */
@media (max-width: 600px) {
    .svc-tabs-wrap {
        display: block;
    }

    .svc-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        border-radius: 20px;
        box-sizing: border-box;
    }

    .svc-tab {
        padding: 10px 8px;
        font-size: 13px;
        white-space: normal;
        text-align: center;
        border-radius: 14px;
    }

    .svc-hero__actions .button {
        flex: 1 1 160px;
    }

    .svc-card__body {
        padding: 16px 18px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .svc-card,
    .svc-card:hover,
    .nav-svc-panel,
    .nav-svc__toggle svg {
        transition: none;
        transform: none;
    }
}
