:root {
    --floating-phone-size: 62px;
}

html {
    scroll-padding-top: 110px;
}

img[data-enhanced-lightbox="true"] {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

img[data-enhanced-lightbox="true"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 35px rgba(10, 36, 99, 0.18);
}

.roof-image,
.about-image img,
.hero-image img,
.service-image img,
.portfolio-item img {
    max-width: 100%;
}

.roof-image,
.about-image img,
.hero-image img,
.service-image img {
    max-height: clamp(260px, 44vw, 520px);
    object-fit: cover;
    object-position: center;
}

.portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)) !important;
    gap: 28px !important;
}

.portfolio-item {
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: clamp(260px, 32vw, 360px) !important;
    object-fit: cover;
    object-position: center;
}

.portfolio-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-card,
.service-card {
    position: relative;
}

.category-price-note,
.tag-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--primary-blue, #0a2463);
    background: rgba(214, 234, 255, 0.85);
    border: 1px solid rgba(62, 146, 204, 0.35);
    box-shadow: 0 8px 18px rgba(10, 36, 99, 0.08);
}

.tag-price {
    margin-top: 0;
}

.floating-phone-wrapper {
    position: fixed;
    right: clamp(16px, 2vw, 24px);
    bottom: clamp(16px, 2vw, 24px);
    z-index: 2200;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.floating-phone-btn {
    width: var(--floating-phone-size);
    height: var(--floating-phone-size);
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue, #0a2463), var(--secondary-blue, #1e6db6));
    color: #fff;
    box-shadow: 0 18px 44px rgba(10, 36, 99, 0.25);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-size: 1.22rem;
}

.floating-phone-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 22px 52px rgba(10, 36, 99, 0.32);
}

.floating-phone-panel {
    min-width: 220px;
    max-width: 280px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(214, 234, 255, 0.95);
    box-shadow: 0 18px 44px rgba(10, 36, 99, 0.18);
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.floating-phone-wrapper.open .floating-phone-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.floating-phone-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-blue, #0a2463);
    margin-bottom: 4px;
}

.floating-phone-number {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-blue, #051938);
    margin-bottom: 4px;
    line-height: 1.3;
}

.floating-phone-hint {
    font-size: 0.82rem;
    color: rgba(51, 51, 51, 0.82);
    line-height: 1.45;
}

body.lightbox-open {
    overflow: hidden !important;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(5, 25, 56, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-dialog {
    width: min(96vw, 1320px);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(74vh, 760px);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.lightbox-stage img {
    display: block;
    max-width: 100%;
    max-height: 74vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.04);
}

.lightbox-close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.04);
}

.lightbox-nav.prev {
    left: 18px;
}

.lightbox-nav.next {
    right: 18px;
}

.lightbox-meta {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
}

.lightbox-counter {
    color: rgba(214, 234, 255, 0.9);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.lightbox-title {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
    margin-bottom: 6px;
}

.lightbox-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.98rem;
}

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
    }

    .lightbox-stage {
        min-height: min(68vh, 640px);
    }
}

@media (max-width: 900px) {
    .floating-phone-panel {
        display: none !important;
    }
}

@media (max-width: 767px) {
    :root {
        --floating-phone-size: 58px;
    }

    .floating-phone-wrapper {
        right: 14px;
        bottom: 14px;
    }

    .lightbox-overlay {
        padding: 12px;
    }

    .lightbox-dialog {
        width: 100%;
        gap: 12px;
    }

    .lightbox-stage {
        min-height: 62vh;
        border-radius: 18px;
    }

    .lightbox-stage img {
        max-height: 62vh;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .lightbox-description {
        font-size: 0.92rem;
    }

    .portfolio-item img {
        height: clamp(240px, 68vw, 320px) !important;
    }
}
/* Language buttons fix */
.lang, .lang-btn, .language a {
    border-radius: 50% !important;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Round language selector buttons in the header on every page */
.language-selector .lang-btn,
.lang-btn {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    white-space: nowrap;
}

.mobile-lang-selector .mobile-lang-btn,
.mobile-lang-btn {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 60px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    white-space: nowrap;
}

/* Header layout harmony: keep navigation away from language circles */
.header-container {
    grid-template-columns: auto minmax(0, 1fr) !important;
    column-gap: clamp(16px, 2.2vw, 34px) !important;
}
.header-nav-container {
    min-width: 0 !important;
    justify-content: flex-start !important;
    gap: clamp(22px, 3vw, 42px) !important;
    margin-left: clamp(8px, 1.6vw, 28px) !important;
}
nav.desktop-nav {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
nav.desktop-nav ul {
    justify-content: flex-start !important;
    gap: clamp(14px, 1.4vw, 24px) !important;
    margin-right: 0 !important;
}
nav.desktop-nav ul li {
    margin-left: 0 !important;
}
.language-selector {
    flex: 0 0 auto !important;
    min-width: 190px !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin-left: clamp(10px, 1.5vw, 26px) !important;
}
@media (max-width: 1180px) {
    nav.desktop-nav ul {
        gap: 12px !important;
    }
    nav.desktop-nav ul li a {
        font-size: 0.92rem !important;
        gap: 6px !important;
    }
    .language-selector {
        min-width: 178px !important;
    }
}
@media (max-width: 1024px) {
    .header-container {
        grid-template-columns: auto auto !important;
    }
}

/* Services page: main material cards, two cards per row on desktop/tablet */
.materials-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 700px) {
    .materials-grid {
        grid-template-columns: 1fr !important;
        max-width: 520px;
    }
}


/* Mobile header fix: logo on the left, burger menu on the right */
@media (max-width: 1024px) {
    .header-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .header-nav-container,
    nav.desktop-nav,
    .language-selector {
        display: none !important;
    }

    .logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: calc(100% - 66px) !important;
    }

    .logo-text {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        flex: 0 0 50px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        justify-self: flex-end !important;
        align-self: center !important;
        order: 2 !important;
    }
}

@media (max-width: 576px) {
    .mobile-menu-btn {
        flex-basis: 45px !important;
    }

    .logo {
        max-width: calc(100% - 58px) !important;
    }
}
