/**
 * Govee home — category grid and product sections.
 * Loaded only on shop.home.index via @push('styles').
 */

/* ------------------------------------------------------------------ */
/* Hero (Bagisto image_carousel / v-carousel)                          */
/* SSR first paint uses object-cover; Vue slides do not → stretch.    */
/* Desktop: force cover crop inside the 2.743 aspect box.             */
/* Mobile: leave alone (SSR cover + current look).                    */
/* ------------------------------------------------------------------ */

@media (min-width: 768px) {
    /*
     * Scope: only the home hero track (w-screen slides under v-carousel).
     * Do not target product cards or category images.
     */
    main.govee-dark .relative.m-auto.flex.w-full.overflow-hidden .w-screen img {
        object-fit: cover !important;
        object-position: center center;
    }
}

/* ------------------------------------------------------------------ */
/* Shared section titles (categories + product grids)                 */
/* ------------------------------------------------------------------ */

.govee-home-categories__title,
.govee-home-product-grid .container > .flex.justify-between > h2 {
    margin: 0 0 var(--govee-space-10);
    font-family: var(--govee-font-sans);
    font-size: var(--govee-text-title);
    font-weight: var(--govee-weight-semibold);
    line-height: var(--govee-leading-tight);
    letter-spacing: var(--govee-tracking-display);
    color: var(--govee-text);
    text-align: center;
}

.govee-home-categories__title::after,
.govee-home-product-grid .container > .flex.justify-between > h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: var(--govee-space-5) auto 0;
    border-radius: var(--govee-radius-pill);
    background: linear-gradient(90deg, var(--govee-cyan), var(--govee-violet));
}

/* ------------------------------------------------------------------ */
/* Categories                                                         */
/* ------------------------------------------------------------------ */

.govee-home-categories {
    background: var(--govee-bg);
    padding: var(--govee-space-12) 0;
}

.govee-home-categories__inner {
    max-width: var(--govee-container-max);
    margin: 0 auto;
    padding: 0 var(--govee-container-pad);
}

@media (min-width: 768px) {
    .govee-home-categories__inner {
        padding: 0 var(--govee-container-pad-md);
    }
}

@media (min-width: 1180px) {
    .govee-home-categories__inner {
        padding: 0 var(--govee-container-pad-lg);
    }
}

.govee-home-categories__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--govee-space-4);
}

@media (min-width: 768px) {
    .govee-home-categories__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--govee-space-7);
    }
}

.govee-home-categories__item {
    margin: 0;
    min-width: 0;
}

.govee-home-categories__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
    color: var(--govee-text);
    background: var(--govee-card);
    border: 1px solid var(--govee-border);
    border-radius: var(--govee-radius-lg);
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.govee-home-categories__card:hover,
.govee-home-categories__card:focus-visible {
    border-color: rgba(24, 200, 255, 0.45);
    box-shadow: var(--govee-shadow-elevated);
    transform: translateY(-2px);
    outline: none;
}

.govee-home-categories__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--govee-card-2);
}

.govee-home-categories__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.govee-home-categories__card:hover .govee-home-categories__image,
.govee-home-categories__card:focus-visible .govee-home-categories__image {
    transform: scale(1.04);
}

.govee-home-categories__name {
    display: block;
    padding: var(--govee-space-5) var(--govee-space-6);
    font-family: var(--govee-font-sans);
    font-size: var(--govee-text-sm);
    font-weight: var(--govee-weight-medium);
    line-height: var(--govee-leading-snug);
    color: var(--govee-text);
}

@media (min-width: 768px) {
    .govee-home-categories__name {
        font-size: var(--govee-text-base);
        padding: var(--govee-space-6) var(--govee-space-7);
    }
}

/* ------------------------------------------------------------------ */
/* Product grids (Destacados / Nuevos) — carousel restyled as CSS grid */
/* ------------------------------------------------------------------ */

.govee-home-product-grid {
    background: var(--govee-bg);
    padding: var(--govee-space-12) 0;
}

/*
 * Full-bleed band: section spans the main (edge to edge);
 * .container inside keeps content at --govee-container-max (1440px).
 */
.govee-home-product-grid--band {
    background: var(--govee-card);
    width: 100%;
}

.govee-home-product-grid .container {
    max-width: var(--govee-container-max);
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-left: var(--govee-container-pad) !important;
    padding-right: var(--govee-container-pad) !important;
}

@media (min-width: 768px) {
    .govee-home-product-grid .container {
        padding-left: var(--govee-container-pad-md) !important;
        padding-right: var(--govee-container-pad-md) !important;
    }
}

@media (min-width: 1180px) {
    .govee-home-product-grid .container {
        padding-left: var(--govee-container-pad-lg) !important;
        padding-right: var(--govee-container-pad-lg) !important;
    }
}

/* Center carousel title row (side chrome already hidden) */
.govee-home-product-grid .container > .flex.justify-between {
    justify-content: center !important;
    align-items: center;
}

.govee-home-product-grid .container > .flex.justify-between > h2 {
    font-size: var(--govee-text-title) !important;
    letter-spacing: var(--govee-tracking-display);
    text-align: center;
    margin: 0 0 var(--govee-space-10);
}

/* Hide carousel chrome (arrows / “view all”) — grid shows all items */
.govee-home-product-grid .container > .flex.justify-between > div,
.govee-home-product-grid .container > a.secondary-button {
    display: none !important;
}

/*
 * products.carousel row is flex + overflow-auto. Force a responsive grid
 * so few products sit side-by-side instead of a useless slider.
 */
.govee-home-product-grid .scrollbar-hide {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: var(--govee-space-4) !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
}

@media (min-width: 640px) {
    .govee-home-product-grid .scrollbar-hide {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .govee-home-product-grid .scrollbar-hide {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--govee-space-6) !important;
    }
}

/* 4 columns on desktop; with fewer than 4 items, empty tracks stay empty (left-aligned). */
@media (min-width: 1180px) {
    .govee-home-product-grid .scrollbar-hide {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--govee-space-7) !important;
        justify-items: stretch;
    }
}

.govee-home-product-grid .scrollbar-hide > * {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    flex: none !important;
}

.govee-home-product-grid .govee-product-card {
    width: 100% !important;
    max-width: none !important;
}

.govee-home-product-grid .govee-product-card__media,
.govee-home-product-grid .govee-product-card__body {
    max-width: 100% !important;
}

/* ------------------------------------------------------------------ */
/* Services strip (layouts.services) — OUTSIDE main.govee-dark         */
/* govee-footer.css hides .container.mt-20 when footer is dark;        */
/* re-enable + restyle only here (this file loads on home only).       */
/* ------------------------------------------------------------------ */

/*
 * Full-bleed band after "Nuevos" (base bg): alternate with --govee-card
 * like Destacados. Inner row stays at --govee-container-max.
 */
#app:has(main.govee-dark) > div.container.mt-20 {
    display: block !important;
    max-width: none !important;
    width: 100%;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: var(--govee-space-12) 0 !important;
    background: var(--govee-card);
    color: var(--govee-text);
}

#app:has(main.govee-dark) > div.container.mt-20 > div {
    max-width: var(--govee-container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--govee-container-pad);
    padding-right: var(--govee-container-pad);
    gap: var(--govee-space-8) !important;
}

@media (min-width: 768px) {
    #app:has(main.govee-dark) > div.container.mt-20 > div {
        padding-left: var(--govee-container-pad-md);
        padding-right: var(--govee-container-pad-md);
    }
}

@media (min-width: 1180px) {
    #app:has(main.govee-dark) > div.container.mt-20 > div {
        padding-left: var(--govee-container-pad-lg);
        padding-right: var(--govee-container-pad-lg);
    }
}

/* Drop white bags — icon + copy on the band */
#app:has(main.govee-dark) > div.container.mt-20 > div > div {
    background: transparent !important;
    align-items: flex-start;
}

#app:has(main.govee-dark) > div.container.mt-20 span[class^="icon-"],
#app:has(main.govee-dark) > div.container.mt-20 span[class*=" icon-"] {
    background: transparent !important;
    border: 1px solid var(--govee-border) !important;
    color: var(--govee-cyan) !important;
    flex-shrink: 0;
}

#app:has(main.govee-dark) > div.container.mt-20 > div > div > div > p:first-child {
    font-family: var(--govee-font-sans) !important;
    font-size: var(--govee-text-base) !important;
    font-weight: var(--govee-weight-semibold);
    color: var(--govee-text) !important;
}

#app:has(main.govee-dark) > div.container.mt-20 > div > div > div > p:last-child {
    color: var(--govee-muted) !important;
    font-weight: var(--govee-weight-regular) !important;
    max-width: 14rem;
}
