/* =============================================================
   pages/home.css  —  Home Page Styles
   Loaded only on the home page via @push('styles')
   ============================================================= */

/* ── Banner wrapper ──────────────────────────────────────────── */
.home-banner-wrap {
    padding: 0 16px 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    .home-banner-wrap {
        padding: 0;
    }

    .tf-slideshow .swiper {
        border-radius: 0;
    }
}

.tf-slideshow {
    border-radius: 18px;
    overflow: hidden;
    /* OK now — pagination is INSIDE the swiper */
    width: 100%;
    position: relative;
}

@media (max-width: 767.98px) {
    .tf-slideshow {
        border-radius: 0;
    }
}

/* ── Home banner pagination inside the swiper ────────────────────
   Swiper sets position:absolute on .swiper-pagination automatically.
   We override bottom/z-index and add a shadow for contrast on any bg. */
#home-banner-swiper .home-banner-pagination {
    position: absolute !important;
    bottom: 20px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10 !important;
    display: flex !important;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}

#home-banner-swiper .home-banner-pagination .swiper-pagination-bullet {
    pointer-events: auto;
    width: 24px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: rgba(255, 255, 255, 0.55) !important;
    opacity: 1 !important;
    margin: 0 !important;
    transition: background 0.3s, width 0.3s;
    cursor: pointer;
}

#home-banner-swiper .home-banner-pagination .swiper-pagination-bullet-active {
    background: #fff !important;
    width: 40px !important;
}

/* Slide image container — responsive heights */
.sld_image {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 340px;
}

@media (min-width: 576px) {
    .sld_image {
        height: 380px;
    }
}

@media (min-width: 768px) {
    .sld_image {
        height: 460px;
    }
}

@media (min-width: 992px) {
    .sld_image {
        height: 520px;
    }
}

@media (min-width: 1200px) {
    .sld_image {
        height: 560px;
    }
}

/* Ken Burns smooth zoom */
.sld_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    animation: bannerZoom 8s ease-in-out infinite alternate;
    will-change: transform;
}

.swiper-slide:nth-child(even) .sld_image img {
    animation-name: bannerZoomAlt;
}

@keyframes bannerZoom {
    from {
        transform: scale(1);
        transform-origin: 55% 50%;
    }

    to {
        transform: scale(1.06);
        transform-origin: 45% 50%;
    }
}

@keyframes bannerZoomAlt {
    from {
        transform: scale(1);
        transform-origin: 45% 50%;
    }

    to {
        transform: scale(1.06);
        transform-origin: 55% 50%;
    }
}

/* Pause zoom when slide is inactive */
.swiper-slide:not(.swiper-slide-active) .sld_image img {
    animation-play-state: paused;
}

.slideshow-wrap {
    position: relative;
}

/* Override global styles.css slideshow-wrap heights to match our sld_image heights.
   styles.css declares 550px/450px on mobile but our sld_image is only 340px — the gap
   pushed the pagination dots into empty space below the banner image. */
.tf-slideshow .slideshow-wrap {
    height: 340px !important;
    /* mobile default — matches sld_image */
}

@media (min-width: 576px) {
    .tf-slideshow .slideshow-wrap {
        height: 380px !important;
    }
}

@media (min-width: 768px) {
    .tf-slideshow .slideshow-wrap {
        height: 460px !important;
    }
}

@media (min-width: 992px) {
    .tf-slideshow .slideshow-wrap {
        height: 520px !important;
    }
}

@media (min-width: 1200px) {
    .tf-slideshow .slideshow-wrap {
        height: 560px !important;
    }
}

/* ── Home Categories Grid ─────────────────────────────────────── */
.home-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 576px) {
    .home-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 992px) {
    .home-categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Card — whole card is a single <a> */
.home-cat-card {
    display: block;
    text-decoration: none;
}

/* Pill title — inside image, at the bottom center */
.home-cat-pill {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border-radius: 999px;
    background: var(--primary, #8B1A2D);
    color: #fff;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    font-weight: 700;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.25s ease;
    line-height: 1.3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.home-cat-card:hover .home-cat-pill {
    background: #fff;
    color: var(--primary, #8B1A2D);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Square image wrapper — 1:1 ratio */
.home-cat-img-wrap {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.home-cat-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.home-cat-card:hover .home-cat-img-wrap img {
    transform: scale(1.05);
}

/* Placeholder when no image */
.home-cat-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.home-cat-placeholder img {
    position: static;
    width: 60%;
    max-width: 100px;
    height: auto;
    object-fit: contain;
    opacity: 0.5;
}