/* Shared breakpoints. These rules come after the component files, so on a
   matching screen they replace the desktop styles above.
   Breakpoints in use: 380px, 720px, 900px, 1100px, plus one 760px auth rule
   in 04-components.css. Prefer 720 / 900 / 1100 when adding a new query.
   Do not restate a component's desktop look here; only the narrow-screen difference.
   13-portals.css and 14-overrides.css still win over this file where they
   repeat a selector. */

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .tk-hero__inner,
    .tk-hero--photo .tk-hero__inner { grid-template-columns: 1fr; }
    .tk-hero__art { order: -1; }
    .tk-hero__art img { width: 190px; }
    .tk-hero h1 { font-size: 2.1rem; }
    .tk-hero--photo {
        min-height: 0;
        padding-block: 56px 64px;
    }
    .tk-hero--photo h1 { font-size: 2.05rem; }
    .tk-hero--photo .tk-hero__shade,
    html[dir="ltr"] .tk-hero--photo .tk-hero__shade {
        background:
            linear-gradient(to top, rgba(6, 8, 12, .94) 0%, rgba(6, 8, 12, .84) 46%, rgba(6, 8, 12, .62) 100%);
    }
    .tk-grid--3, .tk-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .tk-coverage { grid-template-columns: 1fr; }
}

/* Tablet + compact desktop: lean dropdown under the header (not a side drawer). */
@media (max-width: 1100px) {
    :root {
        --tk-safe-top: env(safe-area-inset-top, 0px);
        --tk-safe-bottom: env(safe-area-inset-bottom, 0px);
        --tk-header-h: 58px;
    }

    .tk-header {
        padding-top: var(--tk-safe-top);
    }
    .tk-header__inner {
        position: relative;
        min-height: var(--tk-header-h);
        gap: 12px;
    }
    .tk-logo__en { display: none; }
    .tk-header__actions {
        margin-inline-start: auto;
        gap: 8px;
        position: relative;
        z-index: 72;
    }
    .tk-header__auth { display: none; }
    .tk-hide-mobile { display: none !important; }

    /* Theme moves into the dropdown; keep lang + burger in the top bar. */
    .tk-header__actions > .tk-themeswitch { display: none; }
    .tk-themeswitch--sheet {
        display: inline-flex;
        width: 40px;
        height: 40px;
    }

    .tk-langswitch a {
        padding: 7px 11px;
        font-size: .8rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .tk-burger__btn { display: inline-flex; }

    .tk-burger:checked ~ .tk-header__actions .tk-burger__btn {
        border-color: var(--cyan-line);
        color: var(--cyan);
    }
    .tk-burger:checked ~ .tk-header__actions .tk-burger__btn span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .tk-burger:checked ~ .tk-header__actions .tk-burger__btn span:nth-child(2) {
        opacity: 0;
    }
    .tk-burger:checked ~ .tk-header__actions .tk-burger__btn span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .tk-burger__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(0, 0, 0, .35);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .18s, visibility .18s;
    }
    .tk-burger:checked ~ .tk-burger__backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .tk-nav {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        inset-inline: 0;
        z-index: 60;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: auto;
        max-height: min(70vh, 520px);
        padding: 10px;
        background: var(--bg-raised);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow-pop);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: none;
    }
    html[dir="rtl"] .tk-nav {
        transform: none;
        box-shadow: var(--shadow-pop);
    }
    .tk-burger:checked ~ .tk-nav {
        display: flex;
        transform: none;
    }

    .tk-nav > a {
        padding: 12px 14px;
        font-size: .95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: 10px;
    }

    .tk-nav__panel {
        display: grid;
        gap: 10px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
    .tk-nav__panel-tools {
        display: flex;
        justify-content: flex-end;
    }
    .tk-nav__account {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 10px;
        background: var(--bg-hover);
        color: inherit;
        text-decoration: none;
    }
    a.tk-nav__account:hover {
        color: inherit;
        background: var(--bg-card);
    }
    a.tk-nav__account.is-active {
        box-shadow: inset 0 0 0 1px var(--cyan-line);
        background: var(--cyan-dim);
    }
    .tk-nav__account-meta {
        min-width: 0;
        display: grid;
        gap: 2px;
    }
    .tk-nav__account-label {
        font-size: .72rem;
        font-weight: 700;
        color: var(--silver-dim);
    }
    .tk-nav__account-name {
        font-size: .9rem;
        font-weight: 600;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tk-nav__auth {
        display: grid;
        gap: 8px;
    }
    .tk-nav__logout { margin: 0; }
}

@media (max-width: 720px) {
    :root {
        --tk-tabs-h: 64px;
        --tk-safe-bottom: env(safe-area-inset-bottom, 0px);
        --tk-safe-top: env(safe-area-inset-top, 0px);
        --tk-header-h: 56px;
    }

    .tk-body:has(.tk-tabs),
    .tk-body.tk-body--tabs {
        padding-bottom: calc(var(--tk-tabs-h) + var(--tk-safe-bottom));
    }

    .tk-header__inner {
        gap: 10px;
        min-height: var(--tk-header-h);
    }
    .tk-logo-mark { width: 36px; height: 36px; }
    .tk-logo__ar { font-size: .98rem; }
    .tk-header__actions { gap: 6px; }

    /* Dropdown sits under the header; bottom tabs stay independent. */

    /* Bottom tab bar */
    .tk-tabs {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 50;
        min-height: calc(var(--tk-tabs-h) + var(--tk-safe-bottom));
        padding: 6px 4px calc(6px + var(--tk-safe-bottom));
        background: var(--header-bg);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
        box-shadow: var(--shadow-up);
    }
    .tk-body--tech .tk-tabs {
        grid-template-columns: repeat(3, 1fr);
    }

    .tk-tabs__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 48px;
        padding: 4px 2px;
        color: var(--silver-dim);
        font-size: .68rem;
        font-weight: 700;
        line-height: 1.15;
        text-align: center;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }
    .tk-tabs__item svg {
        width: 22px;
        height: 22px;
        display: block;
    }
    .tk-tabs__item.is-active { color: var(--cyan); }
    .tk-tabs__item--book {
        position: relative;
        top: -10px;
        color: var(--cyan);
    }
    .tk-tabs__book {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--cyan);
        color: #04222B;
        display: grid;
        place-items: center;
        box-shadow: 0 8px 22px rgba(0, 180, 230, .4);
        margin-bottom: 2px;
    }
    .tk-tabs__book svg { width: 26px; height: 26px; }
    .tk-tabs__item--book.is-active .tk-tabs__book {
        background: var(--cyan-bright);
    }
    .tk-tabs__item--book span:last-child {
        color: var(--cyan);
    }

    /* Sticky action / booking bar sits above the tabs.
       Leave room for the elevated Book FAB so it does not cover actions. */
    .tk-stickybar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        inset-inline: 0;
        bottom: calc(var(--tk-tabs-h) + var(--tk-safe-bottom) + 14px);
        z-index: 45;
        padding: 10px 14px;
        background: var(--header-bg);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        box-shadow: var(--shadow-up);
    }
    .tk-stickybar--split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
    /* Call + WhatsApp on one row, complete full-width underneath. */
    .tk-stickybar--trio {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
    .tk-stickybar--trio .tk-stickybar__btn-wrap {
        grid-column: 1 / -1;
    }

    .tk-stickybar__btn-wrap { margin: 0; display: flex; }
    .tk-stickybar__btn-wrap .tk-btn { width: 100%; min-height: 48px; }

    .tk-stickybar__meta {
        display: flex;
        flex-direction: column;
        min-width: 0;
        flex: 1;
    }
    .tk-stickybar__label {
        font-size: .72rem;
        color: var(--silver-faint);
        font-weight: 600;
    }
    .tk-stickybar__value {
        color: var(--text);
        font-weight: 800;
        font-size: clamp(1rem, 4.2vw, 1.15rem);
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.2;
    }
    .tk-stickybar__btn {
        flex: 1.15;
        min-height: 48px;
        width: auto;
        padding-inline: 10px;
        white-space: normal;
        line-height: 1.2;
        font-size: .9rem;
        text-align: center;
    }
    .tk-stickybar__full { width: 100%; margin: 0; }
    .tk-book-submit--desktop { display: none; }

    .tk-body:has(.tk-stickybar),
    .tk-body.tk-body--sticky {
        padding-bottom: calc(var(--tk-tabs-h) + var(--tk-safe-bottom) + 96px);
    }
    .tk-body:has(.tk-stickybar--trio),
    .tk-body.tk-body--sticky-trio {
        padding-bottom: calc(var(--tk-tabs-h) + var(--tk-safe-bottom) + 150px);
    }

    .tk-grid--2, .tk-grid--3, .tk-grid--4 { grid-template-columns: 1fr; }
    .tk-choice--2, .tk-choice--3 { grid-template-columns: 1fr; }
    .tk-choice__box {
        padding: 18px 16px;
        min-height: 64px;
    }
    .tk-input,
    .tk-select,
    .tk-textarea {
        padding: 14px 14px;
        font-size: 1rem;
        min-height: 48px;
    }
    .tk-textarea { min-height: 120px; }
    .tk-fieldset {
        padding: 16px;
        border-radius: 16px;
        margin-bottom: 14px;
    }
    .tk-fieldset > legend {
        font-size: 1rem;
        padding-inline: 6px;
    }

    h1 { font-size: 1.55rem; }
    .tk-pagehead { margin-bottom: 18px; }
    .tk-pagehead h1 { font-size: 1.45rem; }

    .tk-container { padding-inline: 16px; }
    .tk-banner__dots { bottom: 10px; }

    .tk-hero {
        padding-block: 28px 22px;
        background:
            radial-gradient(720px 280px at 50% -20%, rgba(0, 180, 230, .2), transparent 60%),
            var(--bg);
    }
    .tk-hero--photo {
        padding-block: 32px 56px;
        min-height: 0;
    }
    .tk-hero--photo .tk-brand-mark { display: none; }
    .tk-hero__art { display: none; }
    .tk-hero h1,
    .tk-hero--photo h1 { font-size: 1.65rem; line-height: 1.25; }
    .tk-hero__lead { font-size: .98rem; margin-bottom: 0; }
    .tk-trust { margin-top: 1.15rem; gap: 8px 14px; }
    .tk-trust li { font-size: .86rem; }
    .tk-brand-mark { margin-bottom: 10px; }
    .tk-brand-mark__ar { font-size: 1.35rem; }
    .tk-row.tk-mt-2 {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 18px;
    }
    .tk-service {
        padding: 20px 18px;
        min-height: 148px;
        border-radius: 16px;
    }
    .tk-service__icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }
    .tk-service__icon svg { width: 28px; height: 28px; }
    .tk-service h3 { font-size: 1.15rem; }
    .tk-price { font-size: 1.65rem; }

    .tk-card { padding: 18px; border-radius: 16px; }
    .tk-card--pad-lg { padding: 20px; }
    .tk-btn {
        width: 100%;
        min-height: 48px;
        padding: 13px 18px;
        font-size: 1rem;
        border-radius: 12px;
    }
    .tk-btn--inline { width: auto; min-height: 40px; }
    .tk-btn--sm,
    .tk-btn--inline { min-height: 44px; padding: 10px 14px; }
    .tk-btn--lg { min-height: 52px; font-size: 1.05rem; }

    .tk-pagehead .tk-row--between {
        align-items: flex-start;
        gap: 8px;
    }
    .tk-pagehead h1 { min-width: 0; flex: 1 1 auto; }
    .tk-extras-card .tk-row--between > :first-child {
        min-width: 0;
        overflow-wrap: anywhere;
        padding-inline-end: 10px;
    }
    /* Scrollable tables stay usable; list pages swap to cards instead. */
    .tk-table-wrap {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .tk-table-wrap:has(.tk-table--desktop),
    .tk-table-wrap--cards { display: none; }
    .tk-row .tk-btn { flex: 1 1 auto; }
    .tk-extra-actions .tk-btn { width: 100%; }
    .tk-extra-actions { gap: 8px; }

    .tk-table--desktop { display: none; }
    .tk-request-cards { display: grid; gap: 12px; }
    .tk-request-card {
        padding: 18px 16px;
        border-radius: 16px;
        min-height: 96px;
    }

    .tk-main { padding-block: 22px 28px; }
    .tk-section { padding-block: 36px; }
    .tk-step { padding: 18px; }
    .tk-step__num {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .tk-auth {
        max-width: none;
        margin: 8px auto 24px;
    }
    .tk-auth__head img,
    .tk-auth__head .tk-logo-full { width: 72px; }
    .tk-auth__head h1 { font-size: 1.45rem; }
    .tk-check {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .tk-footer {
        padding-bottom: 12px;
    }
    .tk-footer .tk-grid--3 > div:nth-child(2),
    .tk-footer .tk-grid--3 > div:nth-child(3) {
        display: none;
    }
    .tk-footer__bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        font-size: .78rem;
    }

    .tk-starrate label {
        font-size: 2rem;
        padding: 6px;
        min-width: 44px;
        min-height: 44px;
        display: inline-grid;
        place-items: center;
    }

    .tk-facts {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tk-alert { padding: 14px; border-radius: 14px; }

    /* Hide in-card call/complete only when a sticky bar already covers them. */
    .tk-body:has(.tk-stickybar--split) .tk-tech-contact { display: none; }
    .tk-body.tk-body--sticky-split .tk-tech-contact { display: none; }
    .tk-body:has(.tk-stickybar__full) .tk-complete-form .tk-btn,
    .tk-body:has(.tk-stickybar__btn-wrap) .tk-complete-form .tk-btn { display: none; }
    .tk-body.tk-body--sticky-full .tk-complete-form .tk-btn,
    .tk-body.tk-body--sticky-btns .tk-complete-form .tk-btn { display: none; }

    .tk-checkwall__list {
        grid-template-columns: 1fr 1fr;
    }

    .tk-photo-preview img {
        width: 96px;
        height: 96px;
    }

    /* Auth screens: quieter chrome, room for the tab bar. */
    .tk-auth {
        padding-bottom: 12px;
    }
    .tk-auth .tk-card {
        border-radius: 18px;
        padding: 22px 18px;
    }
    .tk-auth__head {
        margin-bottom: 18px;
    }
    .tk-auth__head h1 {
        font-size: 1.4rem;
    }

    /* Coverage chips stay scannable without horizontal scroll traps. */
    .tk-coverage__list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .tk-coverage__list span {
        padding: 8px 12px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        background: var(--bg-raised);
        border: 1px solid var(--line);
        font-size: .86rem;
    }

    .tk-choice__box {
        min-height: 64px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .tk-fieldset {
        padding: 16px;
        border-radius: 16px;
    }

    .tk-input,
    .tk-select,
    .tk-textarea {
        min-height: 48px;
        font-size: 1rem;
        padding: 12px 14px;
        border-radius: 12px;
    }
    .tk-file {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        border-radius: 12px;
    }
    .tk-textarea { min-height: 120px; }
}

@media (max-width: 380px) {
    .tk-tabs__item { font-size: .62rem; }
    .tk-tabs__book { width: 48px; height: 48px; }
    .tk-hero h1,
    .tk-hero--photo h1 { font-size: 1.45rem; }

    /* Keep header chrome from forcing horizontal scroll on small phones. */
    .tk-logo__ar { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tk-header__actions { gap: 4px; }
    .tk-langswitch a { padding: 7px 9px; }
    .tk-stickybar__btn { font-size: .82rem; padding-inline: 8px; }
}
