/* =========================================================
   HOME PAGE — mobile-first
   Breakpoints:
     base      0–575px     phones
     576px     large phones
     768px     tablets (iPad portrait)
     1024px    iPad landscape / small laptops
     1200px    desktops
   ========================================================= */

/* ---------- Hero / slider ---------- */
.hero {
    position: relative;
    width: 100%;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    overflow: hidden;
    z-index: 9997;
}

/* Overrides for the slider styles inside slider_home.php */
.hero .slider-container {
    width: 100%;
    height: 100%;
}
.hero .slider-wrapper {
    height: 100%;
}
.hero .slider-wrapper img {
    flex: 0 0 100%;        /* every slide is exactly one screen wide */
    width: 100%;
    height: 100%;
    object-fit: cover;     /* fill the hero without stretching */
}
.hero .slider-container button {
    width: 44px;           /* comfortable touch target */
    height: 44px;
    border-radius: 50%;
    z-index: 2;
}

.hero-content {
    position: absolute;
    z-index: 1;
    padding: 0 16px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.hero-content h1 {
    font-size: 28px;
    margin: 0 0 8px;
}
.hero-content p {
    font-size: 16px;
    margin: 0;
}

/* ---------- Section titles ---------- */
.featured-products h2,
.latest-posts h2 {
    text-align: center;
    margin-top: 28px;
}

/* ---------- Products & posts: horizontal scroll on phones ---------- */
.featured-products #products,
.latest-posts #posts {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    margin: 0;
    padding: 10px 16px 16px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.featured-products #products::-webkit-scrollbar,
.latest-posts #posts::-webkit-scrollbar {
    height: 6px;
}
.featured-products #products::-webkit-scrollbar-thumb,
.latest-posts #posts::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.featured-products .product,
.latest-posts .post {
    flex: 0 0 75%;          /* next card peeks in to hint scrolling */
    width: auto;
    box-sizing: border-box;
    scroll-snap-align: center;
}
.featured-products .product img,
.latest-posts .post img {
    max-width: 100%;
    height: auto;
}
.featured-products .product h2,
.latest-posts .post h2 {
    font-size: 18px;
    margin-top: 12px;
}

.latest-posts .see-more {
    align-self: center;
    margin-top: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #d69c1c;
    color: #fff;
    text-decoration: none;
}
.latest-posts .see-more:hover {
    opacity: .9;
}

/* Hover zoom only on devices with a real mouse */
@media (hover: none) {
    .featured-products .product:hover,
    .latest-posts .post:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ---------- Large phones ---------- */
@media (min-width: 576px) {
    .hero {
        height: 280px;
    }
    .hero-content h1 {
        font-size: 34px;
    }
    .hero-content p {
        font-size: 18px;
    }

    .featured-products .product,
    .latest-posts .post {
        flex-basis: 45%;
    }
}

/* ---------- Tablets (iPad portrait) ---------- */
@media (min-width: 768px) {
    .hero {
        height: 320px;
    }
    .hero-content h1 {
        font-size: 40px;
    }

    .featured-products h2,
    .latest-posts h2 {
        margin-top: 36px;
    }

    /* back to the desktop grid: 3 cards in a row */
    .featured-products #products,
    .latest-posts #posts {
        overflow-x: visible;
        scroll-snap-type: none;
        justify-content: center;
        gap: 2%;
        margin: 2%;
        padding: 0;
    }
    .featured-products .product,
    .latest-posts .post {
        flex: 0 0 32%;
    }
    .featured-products .product h2,
    .latest-posts .post h2 {
        font-size: 20px;
    }
}

/* ---------- iPad landscape / small laptops ---------- */
@media (min-width: 1024px) {
    .hero {
        height: 350px;     /* original desktop height */
    }
    .hero-content h1 {
        font-size: 48px;
    }
    .hero-content p {
        font-size: 20px;
    }

    .featured-products h2,
    .latest-posts h2 {
        margin-top: 40px;
    }
    .featured-products .product h2,
    .latest-posts .post h2 {
        font-size: 24px;
    }
}

/* ---------- Desktops ---------- */
@media (min-width: 1200px) {
    .featured-products #products,
    .latest-posts #posts {
        max-width: 1200px;
        margin: 2% auto;
    }
}
