/* Cromex — responsive overrides (load after style.css) */

/* -------------------------------------------------------------------------
   Fluid type: slightly smaller rem base on narrow viewports (min ~9px root)
   ------------------------------------------------------------------------- */
      
@media (max-width: 1599px) {
    html {
        font-size: 58%;
    }
    .about-inner {
        align-items: center;
    }
    .card-label {
        left: -70px;
    }
}
@media (max-width: 1399px) {
    html {
        font-size: 54%;
    }
    .estimate .container, .about, .service-intro, .why-choose, .reviews__shell {
        padding-left: 14rem;
        padding-right: 14rem;
    }
    .card-label {
        left: -80px;
    }
}

@media (max-width: 1199px) {
    html {
        font-size: 54%;
    }
    .about.inner-page {
        padding-top: 15rem;
    }
    .why-choose.inner-page {
        padding-top: 12rem;
    }
    
}

@media (max-width: 991px) {
    html {
        font-size: 52%;
    }
    .why-choose__panel {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
    }
    .gallery.inner-page .gallery-watermark {
        top: 10rem;
    }
    .gallery.inner-page {
        padding-top: 20rem !important;
    }
}

@media (max-width: 767px) {
    html {
        font-size: 50%;
    }
    .gallery.inner-page {
        padding-top: 16rem !important;
    }
}

@media (max-width: 479px) {
    html {
        font-size: 58%;
    }
}

/* -------------------------------------------------------------------------
   Global typography / spacing
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    h1 {
        font-size: clamp(3.2rem, 8vw, 5.4rem);
    }

    h2 {
        font-size: clamp(2.6rem, 6vw, 3.8rem);
    }

    p {
        font-size: clamp(1.5rem, 3.8vw, 1.8rem);
    }

    button,
    .btn {
        padding: 1.2rem 2rem;
    }
}

/* -------------------------------------------------------------------------
   Header + mobile menu
   ------------------------------------------------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    width: 4.4rem;
    height: 4.4rem;
    padding: 0;
    margin-left: auto;
    border: 2px solid var(--black);
    border-radius: 0.8rem;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: rgba(56, 178, 77, 0.12);
    border-color: var(--light-green);
    outline: none;
}

.nav-toggle__bar {
    display: block;
    width: 2rem;
    height: 2px;
    margin: 0 auto;
    background: var(--black);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header--nav-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(0.7rem) rotate(45deg);
}

.site-header--nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.site-header--nav-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-0.7rem) rotate(-45deg);
}

@media (max-width: 991px) {
    .site-header {
        padding: 0;
    }

    .header-inner {
        flex-wrap: wrap;
        align-items: center;
        gap: 0 1.6rem;
        min-height: 7.2rem;
    }

    .nav-toggle {
        display: flex;
    }

    /* Animate menu (display toggles cannot use transitions) */
    .main-nav {
        display: flex;
        flex-direction: column;
        flex: 1 1 100%;
        order: 3;
        width: 100%;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        border-top: 1px solid transparent;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-1rem);
        transition:
            max-height 0.42s ease-out,
            opacity 0.32s ease-out,
            transform 0.32s ease-out,
            padding 0.32s ease-out,
            border-color 0.25s ease,
            visibility 0s linear 0.42s;
    }

    .site-header--nav-open .main-nav {
        max-height: min(92vh, 90rem);
        padding-top: 0;
        padding-bottom: 0.8rem;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition:
            max-height 0.5s ease-in,
            opacity 0.45s ease-in,
            transform 0.45s ease-in,
            padding 0.45s ease-in,
            border-color 0.3s ease,
            visibility 0s linear 0s;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        width: 100%;
    }

    .main-nav > ul > li {
        border-bottom: 1px solid rgba(34, 34, 34, 0.08);
    }

    .main-nav > ul > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.4rem 0.4rem;
        font-size: 1.5rem;
    }

    .btn-header {
        order: 2;
        padding: 1.2rem 1.6rem;
        font-size: 1.2rem;
    }

    /* Submenus: in-flow; only .is-open (JS) reveals — no CSS hover sheet */
    .main-nav .has-submenu:hover .submenu,
    .main-nav .has-submenu:focus-within .submenu,
    .main-nav .submenu:hover,
    .main-nav .has-submenu:hover ul.sub-menu,
    .main-nav .has-submenu:focus-within ul.sub-menu,
    .main-nav ul.sub-menu:hover {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
    }

    .main-nav .has-submenu.is-open .submenu,
    .main-nav .has-submenu.is-open ul.sub-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .main-nav .has-submenu:not(.is-open) .nav-chevron {
        transform: none;
    }

    .main-nav .has-submenu.is-open .nav-chevron {
        transform: rotate(180deg);
    }

    .main-nav .submenu,
    .main-nav ul.sub-menu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        margin: 0 0 0.8rem;
        padding: 0.8rem 0 1.2rem 1.2rem;
        box-shadow: none;
        border-left: 2px solid var(--light-green);
        border-radius: 0;
        background: rgba(241, 241, 241, 0.5);
    }

    .submenu__inner {
        flex-direction: column;
        gap: 0;
    }

    .submenu__col {
        min-width: 0;
    }

    .main-nav .submenu a,
    .main-nav ul.sub-menu a {
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 479px) {
    .logo img {
        max-height: 4.8rem;
    }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .hero {
        padding: 4rem 0 5rem;
    }

    .hero h1 {
        margin-bottom: 1.6rem;
    }

    .hero p {
        margin-bottom: 2.4rem;
    }
    .main-nav .submenu,
    .main-nav ul.sub-menu {
        height: 0;
        padding: 0;
        transition: 0.3s ease all;
    }
    .has-submenu.is-open .submenu,
    .has-submenu.is-open ul.sub-menu {
        height: auto;
    }
}

/* -------------------------------------------------------------------------
   Estimate
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .estimate {
        padding: 15rem 0 12rem;
        margin-top: -100px;
    }

    .estimate .container {
        padding: 0 2.4rem;
    }

    .estimate-header {
        margin-bottom: 3.2rem;
    }
}

@media (max-width: 991px) {
    .estimate-grid {
        grid-template-columns: 1fr;
        gap: 3.2rem;
    }

    .field-textarea {
        min-height: 16rem;
    }

    .estimate-submit {
        margin-top: 3.2rem;
    }
    .about-photo__img {
        border-radius: 2rem;
    }
    .card:before {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8)) !important;
    }
    .why-choose__inner:before {
        top: -30px;
        left: -50px;
        width: calc(100% - 10px);
    }
}

@media (max-width: 479px) {
    .toggle-group--4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* -------------------------------------------------------------------------
   About
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .about {
        padding: 8rem 2.4rem;
        padding-right: 2.4rem;
    }

    .about-inner {
        grid-template-columns: 1fr;
        gap: 4rem;
        align-items: start;
    }

    .about-media {
        justify-content: center;
    }

    .about-photo::before {
        left: -2rem;
        top: -3rem;
        width: calc(100% + 4rem);
    }
}

/* -------------------------------------------------------------------------
   Services strip
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .service-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
        padding: 0 2.4rem;
        margin-bottom: 2.4rem;
    }

    .service-intro p {
        width: 100%;
        max-width: 60rem;
    }
}

@media (max-width: 991px) {
    .container.services-inner {
        gap: 2rem;
    }
    .service-intro {
        margin-bottom: 1.4rem;
        gap: 0;
    }
    .service-intro p {
        max-width: 90%;
    }
    .services-strip:before {
        left: -6rem;
        height: calc(100% - 10rem);
    }
    .container.services-inner {
        flex-direction: column;
        align-items: stretch;
        padding-left: 2.4rem;
        padding-right: 2.4rem;
        padding-bottom: 13rem;
    }

    .card {
        flex: none !important;
        width: 100%;
        min-height: 46rem;
        height: auto;
        max-height: none;
        border-radius: 2rem;
    }
    .gallery-nav-btn__icon svg {
        width: 10px;
    }
    

    .card:hover,
    .card.is-active {
        flex: none !important;
    }

    .card-label {
        transform: none;
        position: absolute;
        bottom: auto;
        top: 1.6rem;
        left: 1.6rem;
        width: auto;
        font-size: clamp(2rem, 5vw, 3rem);
        display: none;
    }

    .card .content {
        padding: 2.4rem;
        opacity: 1;
        transition: opacity 0.35s ease;
    }
}

@media (max-width: 479px) {
    .card {
        min-height: 58rem;
    }

    .card .content {
        padding: 1.6rem;
    }
}

/* -------------------------------------------------------------------------
   Gallery
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .gallery {
        padding: 12rem 0 6rem;
    }

    .gallery-watermark {
        top: 6rem;
        font-size: clamp(8rem, 18vw, 14rem);
    }
}

@media (max-width: 991px) {
    .gallery-slide {
        flex: 0 0 min(78vw, 36rem);
        width: min(78vw, 36rem);
        height: min(70vh, 48rem);
    }

    .gallery-nav {
        margin-top: 2.4rem;
    }
    .gallery {
        padding-top: 16rem !important;
    }
    .why-choose__inner {
        gap: 0 !important;
    }

    .reviews__meta {
        flex-direction: row !important;
    }
    .reviews__cta {
        width: auto !important;
        height: fit-content !important;
    }
}

@media (max-width: 479px) {
    .gallery {
        padding-top: 12rem !important;
    }
    .gallery-slide {
        flex: 0 0 50vw;
        width: 86vw;
        height: 34vh;
        min-height: 36rem;
    }

    .gallery-lightbox__prev {
        left: 0.8rem;
    }

    .gallery-lightbox__next {
        right: 0.8rem;
    }

    .gallery-lightbox__close {
        top: 1.2rem;
        right: 1.2rem;
        width: 4rem;
        height: 4rem;
        font-size: 2.4rem;
    }
    .why-choose__inner:before {
        top: -30px;
        left: -30px;
        width: 100%;
    }
}

/* -------------------------------------------------------------------------
   Why choose
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .why-choose {
        padding: 8rem 2.4rem;
        padding-top: 6rem;
    }

    .why-choose__inner {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .why-choose__inner:before {
        display: none;
    }

    .why-choose__panel {
        margin-left: 0;
        margin-right: 0;
        padding: 3.2rem 2.4rem;
    }

    .why-choose__video img {
        height: auto;
        min-height: 32rem;
        max-height: 50rem;
    }
}

/* -------------------------------------------------------------------------
   Reviews
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .reviews {
        padding: 10rem 0;
    }

    .reviews__shell {
        padding: 0 2.4rem;
    }

    .reviews__meta {
        flex-direction: column;
        align-items: stretch;
        gap: 1.6rem;
    }

    .reviews__cta {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .reviews-card {
        min-height: 22rem;
        max-height: 28rem;
    }

    .reviews__viewport {
        margin-bottom: 2.4rem;
    }
	.estimate .container {
		padding: 0 1.4rem !important;
	}
	.form-row--2, .form-row--city, .toggle-group--4 {
		grid-template-columns: 1fr !important;
	}
	.toggle-group {
		flex-direction: column !important;
	}
}

/* -------------------------------------------------------------------------
   CTA + footer
   ------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .cta-band__inner {
        padding: 0 2.4rem;
    }

    .cta-band__text {
        width: 100%;
        max-width: 72rem;
    }

    .site-footer__main {
        grid-template-columns: repeat(2, 1fr);
        gap: 3.2rem 2.4rem;
        padding: 4rem 2.4rem;
    }

    .site-footer__legal-inner {
        padding: 2rem 2.4rem;
    }
}

@media (max-width: 767px) {
    .hero-google-badge {
        margin-top: 2rem;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .estimate-google-badge {
        margin-bottom: 2.4rem;
    }

    .google-rating-badge {
        padding: 0.85rem 1.2rem 0.85rem 1rem;
        gap: 1rem;
    }

    .cta-band {
        padding: 5rem 0 6rem;
    }

    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 3.2rem;
    }

    .site-footer__legal-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    body {
        padding-bottom: calc(9.2rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-action-bar {
        display: flex;
        align-items: stretch;
        gap: 1.2rem;
        position: fixed;
        z-index: 90;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 1.2rem 1.6rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
        background: var(--white);
        box-shadow: 0 -0.4rem 2.4rem rgba(34, 34, 34, 0.12);
    }

    .mobile-action-bar__btn {
        flex: 1 1 0;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-weight: 700;
        font-size: clamp(1.3rem, 3.4vw, 1.5rem);
        line-height: 1.2;
        text-decoration: none;
        border-radius: 1rem;
        min-height: 5.4rem;
    }

    .mobile-action-bar__btn--call {
        flex-direction: column;
        gap: 0.2rem;
        color: var(--color-primary);
        border: 2px solid var(--color-primary);
        background: var(--white);
        text-transform: none;
    }

    .mobile-action-bar__btn--call:hover,
    .mobile-action-bar__btn--call:focus-visible {
        background: rgba(56, 178, 77, 0.1);
        color: var(--dark-green);
        border-color: var(--dark-green);
    }

    .mobile-action-bar__icon {
        display: flex;
        flex-shrink: 0;
    }

    .mobile-action-bar__icon--phone svg {
        display: block;
    }

    .mobile-action-bar__label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .mobile-action-bar__btn--quote {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* -------------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    body.site-nav-open {
        overflow: hidden;
    }
}

@media print {
    .mobile-action-bar {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}
