/* ===== Дани Строй 25 — мобилен изглед в стил приложение (до 767px) ===== */

/* Мобилните елементи са скрити на по-големи екрани */
.tabbar,
.sheet,
.sheet-backdrop,
.appbar-call,
.service-chips,
.contact-actions { display: none; }

@media (max-width: 767px) {

    :root {
        --tabbar-h: 64px;
        --appbar-h: 60px;
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-top: env(safe-area-inset-top, 0px);
        --radius-lg: 18px;
        --radius-md: 14px;
    }

    html { scroll-padding-top: calc(var(--appbar-h) + var(--safe-top) + 12px); }

    body {
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior-y: none;
        padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
        font-size: 15px;
        overflow-x: clip;
    }

    .container { padding: 0 16px; }

    a, button, .btn { touch-action: manipulation; }
    .btn:active,
    .service-card:active,
    .contact-card:active,
    .quick-action:active,
    .sheet-item:active,
    .tab:active { transform: scale(.96); }

    /* ---------- Горна лента ---------- */
    .site-header {
        padding-top: var(--safe-top);
        background: rgba(0, 0, 0, .9);
        -webkit-backdrop-filter: saturate(160%) blur(14px);
        backdrop-filter: saturate(160%) blur(14px);
        transition: box-shadow .2s, border-color .2s;
        border-bottom-color: transparent;
    }
    .site-header.scrolled {
        border-bottom-color: var(--border-soft);
        box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
    }
    .header-inner {
        height: var(--appbar-h);
        padding-top: 0;
        padding-bottom: 0;
        gap: 12px;
    }
    .logo-img { height: 46px; }
    .logo-mark { height: 40px; }
    .logo-tagline { display: none; }
    .logo-name { font-size: 17px; }

    .main-nav,
    .main-nav.open,
    .nav-toggle,
    .header-actions { display: none !important; }

    .appbar-call {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin-left: auto;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: rgba(224, 170, 62, .1);
    }

    /* ---------- Долна навигация ---------- */
    .tabbar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: end;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        height: calc(var(--tabbar-h) + var(--safe-bottom));
        padding: 0 4px var(--safe-bottom);
        background: rgba(12, 12, 12, .94);
        -webkit-backdrop-filter: saturate(160%) blur(16px);
        backdrop-filter: saturate(160%) blur(16px);
        border-top: 1px solid var(--border-soft);
    }
    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: var(--tabbar-h);
        background: none;
        border: none;
        color: #8d8d8d;
        font-family: inherit;
        font-size: 10.5px;
        font-weight: 600;
        letter-spacing: .02em;
        cursor: pointer;
        transition: color .15s, transform .15s;
    }
    .tab .icon { color: currentColor; width: 24px; height: 24px; }
    .tab.active { color: var(--gold); }
    .tab.active::before {
        content: '';
        position: absolute;
        top: 0;
        width: 26px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--gold);
    }
    .tab { position: relative; }

    .tab-call { color: var(--gold); justify-content: flex-end; padding-bottom: 8px; }
    .tab-call-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        margin-top: -26px;
        margin-bottom: 1px;
        border-radius: 50%;
        background: linear-gradient(180deg, #f3cd68, #d39d22);
        box-shadow: 0 8px 22px rgba(217, 164, 40, .45), 0 0 0 5px #0c0c0c;
    }
    .tab-call-btn .icon { color: #1a1200; width: 26px; height: 26px; }

    /* ---------- Панел „Още" ---------- */
    .sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 140;
        background: rgba(0, 0, 0, .6);
        opacity: 0;
        transition: opacity .25s;
    }
    .sheet {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        max-height: 86vh;
        overflow-y: auto;
        padding: 10px 16px calc(20px + var(--safe-bottom));
        background: #131313;
        border-top: 1px solid var(--border);
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        transition: transform .26s cubic-bezier(.2, .8, .2, 1);
        overscroll-behavior: contain;
    }
    .sheet-backdrop[hidden], .sheet[hidden] { display: none !important; }
    body.sheet-open { overflow: hidden; }
    body.sheet-open .sheet-backdrop { opacity: 1; }
    body.sheet-open .sheet { transform: translateY(0); }

    .sheet-handle {
        width: 42px;
        height: 5px;
        border-radius: 3px;
        background: #3a3a3a;
        margin: 2px auto 16px;
    }
    .sheet-quick {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 18px;
    }
    .quick-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 7px;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--text);
        text-align: center;
        transition: transform .15s;
    }
    .quick-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: rgba(224, 170, 62, .1);
        border: 1px solid var(--border);
    }
    .sheet-list {
        background: #1a1a1a;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    .sheet-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 0 16px;
        font-size: 15px;
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
        transition: background .15s, transform .15s;
    }
    .sheet-item:last-child { border-bottom: none; }
    .sheet-item .icon { color: #555; }
    .sheet-item.active { color: var(--gold); }
    .sheet-item.active .icon { color: var(--gold); }
    .sheet-label {
        margin: 18px 4px 8px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .12em;
        color: var(--text-muted);
    }
    .sheet-meta {
        margin: 18px 4px 0;
        font-size: 12px;
        color: #777;
        text-align: center;
        line-height: 1.6;
    }

    /* ---------- Начало: херо ---------- */
    .hero { padding: 26px 0 30px; }
    .hero-inner { gap: 26px; }
    .hero-text h1 { font-size: 40px; line-height: 1.02; }
    .hero-sub { font-size: 15px; margin-top: 12px; letter-spacing: .04em; }
    .hero-divider { margin: 16px 0; width: 64px; }
    .hero-motto { font-size: 15px; margin-bottom: 6px; }
    .hero-desc { font-size: 14px; margin-bottom: 20px; }
    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .hero-buttons .btn {
        min-height: 50px;
        padding: 12px 10px;
        font-size: 12px;
        border-radius: var(--radius-md);
        white-space: normal;
        text-align: center;
    }

    /* Формата като карта на приложение */
    .hero-form {
        padding: 22px 16px 18px;
        border-radius: var(--radius-lg);
        scroll-margin-top: calc(var(--appbar-h) + var(--safe-top) + 12px);
    }
    .hero-form h2 { font-size: 16px; }
    .form-field { margin-bottom: 10px; }
    .form-field input,
    .form-field select,
    .form-field textarea {
        font-size: 16px; /* без автоматично увеличение в iOS */
        min-height: 50px;
        border-radius: 12px;
        padding: 12px 14px;
    }
    .form-field textarea { min-height: 96px; }
    .hero-form .btn-block { min-height: 52px; border-radius: 14px; font-size: 13px; }

    /* ---------- Предимства: плъзгащ се карусел ---------- */
    .badges { padding: 18px 0; }
    .badges-inner {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 2px 16px 6px;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }
    .badges-inner::-webkit-scrollbar { display: none; }
    .badge {
        flex: 0 0 78%;
        scroll-snap-align: center;
        background: var(--bg-card);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        padding: 14px;
    }
    .badge .icon { width: 38px; height: 38px; }

    /* ---------- Услуги: решетка от плочки ---------- */
    .services { padding: 34px 0 26px; }
    .section-eyebrow { font-size: 11px; margin-bottom: 6px; }
    .section-title { font-size: 22px; margin-bottom: 22px; }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .service-card {
        position: relative;
        padding: 16px 6px 12px;
        gap: 8px;
        border-radius: var(--radius-md);
        justify-content: flex-start;
    }
    .service-card:hover { transform: none; }
    .service-card .icon { width: 34px; height: 34px; }
    .service-card h3 {
        font-size: 11.5px;
        font-weight: 600;
        text-transform: none;
        letter-spacing: 0;
        line-height: 1.3;
        overflow-wrap: break-word;
    }
    .service-card .svc-num { display: none; }
    /* Цялата плочка е линк — бутонът остава само като невидима „покривка" */
    .service-card .btn {
        position: static;
        padding: 0;
        border: 0;
        min-height: 0;
        height: 0;
        overflow: hidden;
        font-size: 0;
    }
    .service-card .btn::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
    }
    .services-all { margin-top: 20px; }
    .services-all .btn { width: 100%; min-height: 50px; border-radius: var(--radius-md); }

    /* ---------- Защо да ни изберете ---------- */
    .why { padding: 32px 0; }
    .why-inner { gap: 18px; }
    .why-list h2 { font-size: 19px; margin-bottom: 12px; }
    .why-list li { font-size: 14px; padding: 6px 0; align-items: flex-start; }
    .why-list .btn { width: 100%; min-height: 48px; border-radius: var(--radius-md); }
    .why-stats {
        flex-direction: row;
        justify-content: space-between;
        gap: 6px;
        padding: 16px 10px;
        border-radius: var(--radius-md);
    }
    .stat {
        flex: 1;
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }
    .stat .icon { width: 28px; height: 28px; }
    .stat strong { font-size: 22px; }
    .stat span { font-size: 9.5px; letter-spacing: .04em; }
    .why-image { min-height: 200px; border-radius: var(--radius-md); }

    /* ---------- Призив за обаждане ---------- */
    .cta { padding: 20px 0 28px; }
    .cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 22px 16px;
        border-radius: var(--radius-lg);
    }
    .cta-icon { width: 54px; height: 54px; }
    .cta-icon .icon { width: 30px; height: 30px; }
    .cta-text { min-width: 0; }
    .cta-text h2 { font-size: 16px; }
    .cta-text p { font-size: 13px; }
    .cta-action { width: 100%; }
    .cta-phone { font-size: 22px; }
    .cta-action .btn { width: 100%; min-height: 48px; border-radius: var(--radius-md); }

    /* ---------- Футър ---------- */
    .site-footer { padding-top: 28px; }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 22px 16px;
        padding-bottom: 22px;
    }
    .footer-brand { grid-column: 1 / -1; text-align: center; }
    .footer-brand .footer-logo { margin: 0 auto 6px; height: 84px; }
    .footer-col:last-child { grid-column: 1 / -1; }
    .footer-col h4 { margin-bottom: 6px; }
    .footer-col a, .footer-col p { font-size: 13.5px; padding: 6px 0; }
    .footer-bottom { padding: 14px 0; }
    .footer-bottom p { font-size: 11px; }

    /* ---------- Вътрешни страници ---------- */
    .page-head { padding: 26px 0 4px; }
    .page-head .section-title { font-size: 24px; }
    .page-body { padding: 18px 0 28px; }
    .page-content {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }
    .rich { font-size: 14.5px; line-height: 1.7; }
    .rich h2 { font-size: 18px; margin-top: 22px; }
    .rich h3 { font-size: 16px; }
    .rich table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }

    /* Услуги: лента с бързи връзки */
    .services-page { padding: 22px 0 10px; }
    .services-page .section-title { margin-bottom: 14px; }
    .service-chips {
        display: flex;
        gap: 8px;
        position: sticky;
        top: calc(var(--appbar-h) + var(--safe-top));
        z-index: 50;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -16px 16px;
        padding: 10px 16px;
        background: rgba(10, 10, 10, .92);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-soft);
    }
    .service-chips::-webkit-scrollbar { display: none; }
    .service-chip {
        flex: 0 0 auto;
        padding: 8px 14px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: rgba(224, 170, 62, .06);
        color: var(--text);
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
    }
    .service-chip.current {
        background: var(--gold);
        border-color: var(--gold);
        color: #1a1200;
    }
    .sdetail-grid { gap: 14px; }
    .sdetail-card {
        border-radius: var(--radius-lg);
        scroll-margin-top: calc(var(--appbar-h) + var(--safe-top) + 66px);
    }
    .sdetail-photo { height: 180px; }
    .sdetail-body { padding: 16px; }
    .sdetail-body h3 { font-size: 15px; }
    .sdetail-body li { font-size: 14px; padding: 4px 0 4px 18px; }
    .sdetail-badges { padding: 12px 16px; }
    .sdetail-badges span { font-size: 9.5px; }

    /* Контакти */
    .contact-inner { gap: 18px; }
    .contact-intro { padding: 16px; margin-bottom: 14px; }
    .contact-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }
    .contact-actions a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 14px 6px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        background: rgba(224, 170, 62, .08);
        font-size: 12px;
        font-weight: 700;
        color: var(--gold);
    }
    .contact-actions a.primary {
        background: linear-gradient(180deg, #f0c75e, #d9a428);
        border-color: transparent;
        color: #1a1200;
    }
    .contact-actions a.primary .icon { color: #1a1200; }
    .contact-cards {
        grid-template-columns: 1fr;
        gap: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    .contact-card {
        border: none;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
        padding: 14px 16px;
    }
    .contact-card:last-child { border-bottom: none; }
    .contact-card .icon { width: 26px; height: 26px; }

    /* Галерия */
    .gallery-intro { padding: 14px 16px; margin-bottom: 14px; }
    .gallery-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .gallery-item { border-radius: 10px; aspect-ratio: 1 / 1; }
    .gallery-caption { font-size: 10.5px; padding: 6px 8px; }
    .lightbox { padding: 0; background: #000; }
    .lightbox img { max-height: 76vh; border-radius: 0; border: none; }
    .lightbox-close { top: calc(10px + var(--safe-top)); right: 14px; }
    .lightbox .lightbox-nav { display: none; }
    .lightbox .lightbox-counter { display: block; }

    /* Лента за бисквитки — над долната навигация */
    .cookie-bar {
        left: 10px;
        right: 10px;
        bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px);
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }
    .cookie-bar p { font-size: 12px; }
    .cookie-bar .btn { width: 100%; min-height: 42px; }

    /* Известия във формата */
    .alert { border-radius: 12px; font-size: 13px; }
}

/* Лайтбокс: брояч и стрелки (стрелки само на по-големи екрани) */
.lightbox-counter { display: none; color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, .5);
    color: var(--gold);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (prefers-reduced-motion: reduce) {
    .sheet, .sheet-backdrop, .tab, .btn, .service-card { transition: none !important; }
}

/* Отворен като инсталирано приложение (от началния екран) */
@media (display-mode: standalone) and (max-width: 767px) {
    .cookie-bar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); }
}
