/* Final responsive layer for index.html.
   Loaded last so it can correct older fixed widths and overlapping media queries. */

html {
    scroll-behavior: smooth;
    background-color: #1DB547;
}

body {
    width: min(100% - 32px, 1440px);
    margin: 0 auto;
    font-family: 'Rockwell', 'Century Gothic', serif;
    background-color: #1DB547;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

main section {
    margin-top: clamp(34px, 6vw, 78px);
}

.headrflex,
.centering,
.hi_Section_centering,
.product_Grid,
.testimonials_grid,
.appointments_grid,
.put_together {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.hi_Section_text,
.product_Section_text,
.testimonials_Section_text {
    margin-left: 0;
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.35;
}

/* Header */
.headrflex {
    width: 100%;
    height: auto;
    min-height: 64px;
    margin-top: clamp(10px, 2.2vw, 30px);
    padding: 0;
    gap: 18px;
}

.header_image {
    width: clamp(108px, 14vw, 136px);
    height: auto;
    margin-left: 0;
}

header .menu ul {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: clamp(12px, 2vw, 28px);
    margin: 0;
    padding: 0;
}

header .menu ul li {
    padding: 0;
}

.navlinks {
    font-size: clamp(17px, 2vw, 24px);
    line-height: 1.2;
    white-space: nowrap;
}

.hamburger,
.menu-close {
    line-height: 1;
}

/* Splash */
.splashbackground_img,
.splashbackground_imgs {
    width: 100%;
    min-height: clamp(360px, 44vw, 620px);
    margin: clamp(8px, 1.5vw, 16px) 0 0;
    display: grid;
    align-items: center;
    background: url(images/header2.PNG) center / cover no-repeat;
    overflow: hidden;
}

.centering {
    width: 100%;
    margin-top: 0;
    justify-items: center;
    padding: clamp(32px, 6vw, 70px) 16px;
}

.SplashWhiteLogo {
    width: clamp(230px, 42vw, 454px);
}

.barbershop_text {
    margin: 8px 0 14px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.1;
    text-align: center;
}

.button,
.button_box,
.text_box {
    width: min(100%, 536px);
    min-height: 52px;
}

.button {
    width: min(100%, 454px);
    padding: 0 18px;
    font-size: clamp(17px, 2.2vw, 24px);
}

/* Hi section */
.hi_Section_centering {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 52px);
}

.hi_Section_image {
    width: 100%;
    max-width: 560px;
    margin-left: 0;
}

.hi_Section_paragraph {
    max-width: 650px;
    margin: 0;
    font-size: clamp(24px, 3.2vw, 44px);
    line-height: 1.22;
}

/* Product and testimonial cards */
.product_Grid,
.testimonials_grid {
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
}

.first_product_card,
.second_product_card,
.third_product_card,
.fourth_product_card,
.first_testimonials_card,
.second_testimonials_card {
    min-width: 0;
    margin: 0;
    gap: 16px;
}

.first_product_card,
.second_product_card,
.third_product_card,
.fourth_product_card {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    align-items: start;
}

.product_card_image {
    width: 100%;
    height: clamp(160px, 18vw, 226px);
    object-fit: cover;
}

.first_testimonials_card,
.second_testimonials_card {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    align-items: center;
}

.testimonials_card_image {
    flex: 0 0 auto;
}

/* Appointments */
.setup_appointment_text {
    margin: 8px 0 26px;
    font-size: clamp(24px, 3.2vw, 36px);
    line-height: 1.2;
    text-align: center;
}

.appointments_grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(280px, 536px) minmax(300px, 1fr);
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4vw, 58px);
}

.appointments_form {
    width: 100%;
    margin-left: 0;
}

.text_box,
.button_box {
    width: 100%;
    font-size: clamp(18px, 2vw, 24px);
}

.appointments_img {
    width: 100%;
    max-width: 620px;
    height: auto;
    margin: 0;
}

/* About and footer */
.put_together {
    padding: clamp(20px, 4vw, 56px) 0;
    gap: 22px;
}

.about_Section_text {
    font-size: clamp(17px, 2.2vw, 24px);
    line-height: 1.6;
}

.footerflex {
    height: auto;
    margin-top: clamp(56px, 10vw, 150px);
    padding: 22px 0 34px;
    align-items: center;
}

footer .menu {
    width: 100%;
}

footer .menu ul {
    position: static;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 24px;
    background: transparent;
    box-shadow: none;
    list-style: none;
}

footer .menu ul li {
    display: block;
    padding: 0;
}

/* Large desktop keeps the page readable instead of stretching forever. */
@media (min-width: 1367px) {
    body {
        width: min(100% - 80px, 1420px);
    }
}

/* Laptops and iPad Pro landscape. */
@media (max-width: 1180px) {
    .first_product_card,
    .second_product_card,
    .third_product_card,
    .fourth_product_card {
        grid-template-columns: 1fr;
    }

    .product_card_image {
        height: 210px;
    }
}

/* iPad Air, iPad Pro portrait, and narrow laptops. */
@media (max-width: 1024px) {
    body {
        width: min(100% - 48px, 960px);
    }

    .navlinks {
        font-size: 19px;
    }

    .hi_Section_centering,
    .appointments_grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .hi_Section_paragraph {
        max-width: 760px;
        text-align: left;
    }

    .appointments_form,
    .appointments_img {
        max-width: 620px;
    }
}

/* iPad Mini portrait and phones: use the hamburger menu. */
@media (max-width: 768px) {
    body {
        width: min(100% - 32px, 720px);
    }

    .hamburger {
        display: block;
    }

    .menu-close {
        display: none;
    }

    body.menu-open .menu-close {
        display: block !important;
    }

    header .menu ul {
        position: fixed;
        top: 66px;
        left: 16px;
        right: 16px;
        z-index: 999;
        width: auto;
        max-height: 65vh;
        overflow-y: auto;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px;
        border-radius: 10px;
        background: rgba(245, 245, 245, 0.99);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
    }

    header .menu.menu-open ul {
        display: flex;
    }

    header .menu ul li {
        width: 100%;
        text-align: center;
    }

    header .menu ul li a {
        display: block;
        padding: 12px 8px;
        color: #333;
        font-size: 18px;
    }

    .splashbackground_img,
    .splashbackground_imgs {
        min-height: 390px;
    }

    .hi_Section_image {
        max-width: 500px;
    }

    .product_Grid,
    .testimonials_grid {
        grid-template-columns: 1fr;
    }

    .first_product_card,
    .second_product_card,
    .third_product_card,
    .fourth_product_card {
        grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
        align-items: center;
    }

    .product_card_image {
        height: 220px;
    }
}

/* Phones. */
@media (max-width: 600px) {
    body {
        width: min(100% - 24px, 560px);
    }

    main section {
        margin-top: 38px;
    }

    .splashbackground_img,
    .splashbackground_imgs {
        min-height: 340px;
    }

    .button {
        width: min(100%, 340px);
    }

    .hi_Section_paragraph {
        font-size: clamp(22px, 7vw, 30px);
    }

    .first_product_card,
    .second_product_card,
    .third_product_card,
    .fourth_product_card,
    .first_testimonials_card,
    .second_testimonials_card {
        grid-template-columns: 1fr;
    }

    .product_card_image {
        height: 220px;
    }

    .testimonials_card_image {
        justify-self: start;
    }

    .appointments_form,
    .appointments_img {
        max-width: 100%;
    }

    footer .menu ul {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* Small phones. */
@media (max-width: 390px) {
    body {
        width: min(100% - 18px, 372px);
    }

    .headrflex {
        min-height: 54px;
    }

    .header_image {
        width: 96px;
    }

    .hamburger {
        font-size: 28px;
        padding: 6px;
    }

    header .menu ul {
        left: 9px;
        right: 9px;
    }

    .SplashWhiteLogo {
        width: min(82vw, 260px);
    }

    .product_card_image {
        height: 200px;
    }

    .text_box,
    .button_box {
        min-height: 48px;
    }
}

/* Very small devices. */
@media (max-width: 320px) {
    body {
        width: min(100% - 12px, 308px);
    }

    .product_card_image {
        height: 180px;
    }

    .testimonials_card_image {
        width: 100px;
        height: 100px;
        border-radius: 50px;
    }
}
