/* ==========================================================================
   Smart Repair Desk — site header, footer and buttons
   Shared by the new homepage and the older pages. Design tokens are scoped to
   the header and footer so they never override the older pages' variables.
   ========================================================================== */

.site-header, .site-footer, .skip-link {
    --ink: #0F1A14;
    --ink-2: #1D2A22;
    --ink-3: #2C3A31;
    --text: #1A231E;
    --muted: #59655E;
    --line: #E2E0D8;
    --line-2: #D3D1C8;
    --paper: #F6F5F0;
    --paper-2: #EFEDE6;
    --white: #FFFFFF;

    --green: #16A34A;          /* brand green: accents on dark backgrounds */
    --green-ink: #16A34A;      /* buttons and links on light backgrounds */
    --green-ink-hover: #15803D;
    --green-wash: #E7F4EB;

    --amber: #9A5B00;  --amber-wash: #FDF1DC;
    --blue: #2F5C9E;   --blue-wash: #E6EEF8;
    --red: #B42318;    --red-wash: #FCE9E7;

    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-frame: 0 1px 2px rgba(15, 26, 20, .06), 0 24px 60px -24px rgba(15, 26, 20, .28);
}

.site-header, .site-footer { font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.site-header *, .site-header *::before, .site-header *::after,
.site-footer *, .site-footer *::before, .site-footer *::after { box-sizing: border-box; }
.site-header :where(ul, ol, p, h2), .site-footer :where(ul, ol, p, h2) { margin: 0; padding: 0; list-style: none; }
.site-header :where(button) { font: inherit; color: inherit; cursor: pointer; }
.site-header :where(img), .site-footer :where(img) { display: block; height: auto; }
.site-header :focus-visible, .site-footer :focus-visible { outline: 2px solid var(--green-ink); outline-offset: 2px; border-radius: 4px; }
body.menu-open { overflow: hidden; }

/* Exposed so full-height pages (maps, invoice tracker) can size themselves below the header. */
:root { --site-header-h: 73px; }
@media (max-width: 960px) { :root { --site-header-h: 65px; } }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px;
    border-radius: 8px; border: 1px solid transparent;
    font-size: 16px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--green-ink); color: #fff !important; }
.btn--primary:hover { background: var(--green-ink-hover); }
.btn--outline { border-color: var(--line-2); color: var(--ink) !important; background: var(--white); }
.btn--outline:hover { border-color: var(--ink); }
.btn--outline-light { border-color: rgba(255,255,255,.35); color: #fff !important; }
.btn--outline-light:hover { border-color: #fff; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__bar { display: flex; align-items: center; gap: 32px; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 20px; height: auto; }
.brand__name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand__name span { color: var(--green-ink); }
.brand--light .brand__name { color: #fff; }
.brand--light .brand__name span { color: var(--green); }

.primary-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.primary-nav__link {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
    background: none; border: 0; border-radius: 6px;
    font-size: 15px; font-weight: 500; color: var(--ink-3); text-decoration: none;
}
.primary-nav__link:hover, .dropdown.is-open > .primary-nav__link { color: var(--ink); background: var(--paper-2); }
.primary-nav__link .bi { font-size: 11px; transition: transform .15s ease; }
.dropdown.is-open > .primary-nav__link .bi { transform: rotate(180deg); }

.dropdown { position: relative; }
.dropdown__panel {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 16px 40px -12px rgba(15, 26, 20, .18);
    padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.dropdown.is-open .dropdown__panel { opacity: 1; visibility: visible; transform: none; }
.dropdown__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.dropdown__panel--wide { width: 520px; padding: 16px; }
.dropdown__label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 8px 8px; }
.dropdown__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dropdown__grid a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 6px; font-size: 15px; text-decoration: none; color: var(--ink-2); }
.dropdown__grid a:hover { background: var(--paper); }
.dropdown__grid .bi { color: var(--muted); width: 18px; text-align: center; }
.dropdown__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dropdown__foot a { text-decoration: none; color: var(--muted); }
.dropdown__foot a:first-child { color: var(--green-ink); font-weight: 600; }
.dropdown__foot a:hover { text-decoration: underline; }
.dropdown__list a { display: block; padding: 10px 12px; border-radius: 6px; text-decoration: none; }
.dropdown__list a:hover { background: var(--paper); }
.dropdown__list strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.dropdown__list span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }

.site-header__actions { display: flex; align-items: center; gap: 8px; }
.link-login { padding: 0 12px; font-size: 15px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.link-login:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; position: relative; }
.menu-toggle span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); transition: transform .2s ease; }
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu { border-top: 1px solid var(--line); background: var(--paper); max-height: calc(100vh - 72px); overflow-y: auto; padding: 8px 0 24px; }
.mobile-menu__link { display: block; padding: 14px 0; font-size: 18px; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
.mobile-menu__link::-webkit-details-marker { display: none; }
.mobile-menu__group summary::after { content: "+"; float: right; color: var(--muted); }
.mobile-menu__group[open] summary::after { content: "\2013"; }
.mobile-menu__group a { display: block; padding: 10px 0 10px 16px; color: var(--ink-3); text-decoration: none; font-size: 16px; }
.mobile-menu__group[open] { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mobile-menu__group[open] summary { border-bottom: 0; }
.mobile-menu__actions { display: grid; gap: 10px; margin-top: 20px; }

@media (max-width: 960px) {
    .primary-nav, .link-login { display: none; }
    .menu-toggle { display: block; }
    .site-header__bar { justify-content: space-between; height: 64px; }
}
@media (max-width: 420px) {
    .site-header__actions .btn--sm { padding: 0 12px; }
    .brand__name { font-size: 16px; }
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #A9B6AD; font-size: 15px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 64px; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 40px; padding-bottom: 56px; }
.site-footer__brand p { margin: 16px 0 20px; max-width: 300px; }
.site-footer h2 { font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: #fff; margin-bottom: 16px; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { text-decoration: none; color: #C9D3CC; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__social { display: flex; gap: 8px; }
.site-footer__social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; font-size: 16px; }
.site-footer__social a:hover { border-color: #fff; text-decoration: none; }
.site-footer__contact a { overflow-wrap: anywhere; }
.site-footer__contact .bi { margin-right: 6px; }
.site-footer__contact .bi-whatsapp { color: #25d366; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 24px 0 32px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.site-footer__bottom ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer__bottom li { margin: 0; }
@media (max-width: 1080px) {
    .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__contact { grid-column: 1 / -1; } }
