/* ---------- Large screens (1600px and up) ---------- */

@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
}

/* ---------- Laptops (992px - 1199px) ---------- */

@media (max-width: 1199px) {
    .header-inner {
        gap: 16px;
    }

    .brand-logo {
        width: 160px;
        height: 76px;
    }

    .site-nav {
        gap: 2px;
    }

    .site-nav > a,
    .nav-dropdown summary {
        padding: 8px 10px;
        font-size: 14.5px;
    }

    .site-nav .nav-cta {
        margin-left: 8px;
        padding: 10px 16px;
    }
}

/* ---------- Tablets and mobiles (991px and below) ---------- */

@media (max-width: 991px) {
    .header-inner {
        min-height: 76px;
    }

    .brand-logo {
        width: 150px;
        height: 72px;
    }

    .menu-toggle {
        display: flex;
    }

    /* Height is set by main.js so the menu always fits on screen */
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 8px 20px 20px;
        background: var(--white);
        border-top: 1px solid var(--line);
        box-shadow: 0 16px 30px -10px rgba(15, 23, 42, 0.15);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav > a,
    .nav-dropdown summary {
        justify-content: space-between;
        padding: 13px 4px;
        border-radius: 0;
        border-bottom: 1px solid var(--line);
        font-size: 15.5px;
    }

    .site-nav > a:hover,
    .nav-dropdown summary:hover,
    .nav-dropdown[open] summary {
        background: none;
    }

    /* Active page in the mobile menu: blue bar on the left */
    .site-nav > a.is-active,
    .nav-dropdown summary.is-active {
        padding-left: 12px;
        background: var(--blue-soft);
        box-shadow: inset 3px 0 0 var(--blue);
    }

    .site-nav > a.is-active::after,
    .nav-dropdown summary.is-active::after {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        margin: 6px 0;
        padding: 4px;
        border-top: 0;
        border-radius: 10px;
        background: var(--light);
        box-shadow: none;
    }

    .site-nav .nav-cta {
        justify-content: center;
        margin: 16px 0 0;
        padding: 13px 20px;
        border-bottom: 0;
    }
}

/* ---------- Tablet portrait: dropdown items in two columns ---------- */

@media (min-width: 600px) and (max-width: 991px) {
    .nav-dropdown-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Mobiles (767px and below) ---------- */

@media (max-width: 767px) {
    .topbar-hours {
        display: none;
    }

    .topbar-inner {
        justify-content: center;
    }
}

/* ---------- Small mobiles (575px and below) ---------- */

@media (max-width: 575px) {
    .container {
        padding: 0 16px;
    }

    .topbar-inner {
        min-height: 38px;
    }

    .topbar-contact {
        gap: 16px;
    }

    .topbar-email {
        display: none;
    }

    .header-inner {
        min-height: 66px;
    }

    .brand-logo {
        width: 130px;
        height: 62px;
    }

    .site-nav {
        padding: 6px 16px 18px;
    }
}

/* ---------- Very small mobiles (360px and below) ---------- */

@media (max-width: 360px) {
    .brand-logo {
        width: 120px;
        height: 58px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        padding: 0 10px;
    }
}

/* ---------- Phones in landscape (short screens) ---------- */

@media (max-width: 991px) and (max-height: 500px) and (orientation: landscape) {
    .topbar-inner {
        min-height: 34px;
    }

    .header-inner {
        min-height: 58px;
    }

    .brand-logo {
        width: 116px;
        height: 56px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        padding: 0 10px;
    }

    .site-nav > a,
    .nav-dropdown summary {
        padding: 10px 4px;
    }

    .nav-dropdown-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .nav-dropdown-menu a {
        padding: 7px 12px;
    }

    .site-nav .nav-cta {
        margin-top: 12px;
        padding: 11px 20px;
    }
}

/* ---------- Footer ---------- */

@media (max-width: 1199px) {
    .footer-grid {
        gap: 36px;
    }

    /* Keeps the text clear of the back to top button */
    .footer-bottom-inner {
        padding-right: 72px;
    }
}

@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 32px;
        padding-top: 56px;
        padding-bottom: 44px;
    }

    .footer-about p {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
        padding-top: 48px;
        padding-bottom: 36px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        justify-content: center;
        padding: 18px 52px;
        text-align: center;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }
}

/* ---------- Home page ---------- */

/* Slider arrows only where there is room beside the text */
@media (max-width: 1399px) {
    .hero-arrow {
        display: none;
    }
}

@media (max-width: 1199px) {
    .hero-title {
        font-size: 40px;
    }

    .about-grid {
        gap: 40px;
    }
}

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

    .section-title {
        font-size: 30px;
    }

    .hero {
        height: clamp(480px, 70vh, 640px);
    }

    .hero-title {
        font-size: 38px;
    }

    .hero-text {
        font-size: 17px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        width: calc((100% - 24px) / 2);
    }

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

    .cta-title {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .hero {
        height: clamp(460px, 80vh, 580px);
    }

    /* Darker overlay on small screens, text covers more of the image */
    .hero-slide::after {
        background: linear-gradient(180deg, rgba(10, 16, 40, 0.55) 0%, rgba(10, 16, 40, 0.8) 100%);
    }

    .hero-label {
        margin-bottom: 14px;
        font-size: 12px;
    }

    .hero-title {
        margin-bottom: 14px;
        font-size: 32px;
    }

    .hero-text {
        margin-bottom: 26px;
        font-size: 16px;
    }

    .hero-dots {
        bottom: 20px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 28px;
    }

    .listing-intro {
        margin: -12px 0 28px;
    }
}

@media (max-width: 575px) {
    .section {
        padding: 56px 0;
    }

    .section-title {
        font-size: 26px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-text {
        font-size: 15px;
    }

    .hero-buttons .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .about-features {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .feature-card {
        padding: 22px 20px;
    }

    .product-grid {
        gap: 16px;
    }

    .product-card {
        width: 100%;
    }

    .cta {
        padding: 56px 0;
    }

    .cta-title {
        font-size: 23px;
    }

    .cta-buttons,
    .cta-buttons .btn {
        width: 100%;
    }
}

/* ---------- Inner pages and product page ---------- */

@media (max-width: 991px) {
    .page-banner {
        padding: 36px 0;
    }

    .page-title {
        font-size: 32px;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    /* One column on tablets and phones, so the photo scrolls normally */
    .product-photo {
        position: static;
    }

    .post-nav {
        margin-top: 56px;
    }
}

@media (max-width: 575px) {
    .page-banner {
        padding: 28px 0;
    }

    .page-title {
        font-size: 27px;
    }

    .product-heading {
        font-size: 24px;
    }

    .product-specs {
        grid-template-columns: 1fr;
    }

    .product-specs div:nth-child(odd) {
        border-right: 0;
    }

    .product-specs div:nth-last-child(2) {
        border-bottom: 1px solid var(--line);
    }

    .product-buttons .btn {
        flex: 1;
    }

    .post-nav {
        margin-top: 44px;
    }
}

/* ---------- Contact page ---------- */

@media (max-width: 1199px) {
    .contact-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .contact-cards {
        margin-bottom: 56px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-map,
    .contact-map iframe {
        min-height: 360px;
    }
}

@media (max-width: 575px) {
    .contact-cards {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 44px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form .btn {
        align-self: stretch;
    }

    .contact-map,
    .contact-map iframe {
        min-height: 300px;
    }
}

/* Phones in landscape: shorter hero so the text still fits */
@media (max-width: 991px) and (max-height: 500px) and (orientation: landscape) {
    /* Slides share one grid cell, so the hero grows to fit the tallest slide */
    .hero {
        display: grid;
        height: auto;
    }

    .hero-slide {
        position: relative;
        grid-area: 1 / 1;
        padding: 48px 0 56px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-text {
        margin-bottom: 20px;
        font-size: 15px;
    }
}
