/*
 * Home clásico.
 *
 * Esta hoja sólo se carga cuando la empresa no tiene un layout personalizado
 * publicado. Los componentes compartidos de tienda viven en storefront.css.
 */
.home-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: -2rem;
}

/* Carrusel de portada clásico */
.home-banner-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1920 / 500;
    max-height: 500px;
    min-height: 160px;
    overflow: hidden;
}

.home-banner-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .9s ease;
    pointer-events: none;
}

.home-banner-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.home-banner-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-banner-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    z-index: 10;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.home-banner-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: background .3s, transform .3s;
}

.home-banner-dot.active {
    background: #FFFFFF;
    transform: scale(1.25);
}

.home-carousel-section {
    width: 100vw;
    height: var(--carousel-h);
    max-height: var(--carousel-h);
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    border-radius: 0;
    background: color-mix(in srgb, var(--primary-color) 5%, var(--surface-section));
}

/* Secciones del Home clásico */
.home-section {
    width: 100%;
    padding: 1rem 0;
}

.home-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: var(--home-content-w);
    max-width: var(--page-max);
    margin: 0 auto 1rem;
    padding: 0;
    gap: .35rem;
    text-align: center;
}

.home-section-header .section-label {
    display: inline-block;
    color: var(--primary-color);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    opacity: .85;
}

.home-section-header h2 {
    position: relative;
    margin: 0;
    padding-bottom: .5rem;
    color: var(--text-color);
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.home-section-header h2::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary-color);
    content: "";
    transform: translateX(-50%);
}

.home-section-title-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--home-content-w);
    gap: 1rem;
}

.home-section-title-row h2 {
    margin: 0;
}

.home-section-title-row .home-ver-todos {
    position: absolute;
    right: 0;
    bottom: .5rem;
}

.home-ver-todos {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding-bottom: .5rem;
    color: var(--primary-color);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    opacity: .85;
    transition: opacity .15s;
}

.home-ver-todos:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 1;
}

.home-ver-todos .pi {
    font-size: .7rem;
}

.home-section-header .section-sub {
    margin-top: .2rem;
    color: color-mix(in srgb, var(--text-color) 55%, transparent);
    font-size: .875rem;
    font-weight: 400;
}

.home-categories-section {
    overflow: clip;
    background: var(--surface-section);
}

.home-featured-section {
    overflow: hidden;
    background: var(--surface-section);
}

.home-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: var(--home-content-w);
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0;
    gap: .5rem;
    box-sizing: border-box;
}

.home-categories-grid.grid-desktop-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-categories-grid.grid-desktop-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-categories-grid.grid-desktop-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-categories-grid.grid-desktop-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Carruseles propios del Home clásico */
.gp-carousel-outer {
    position: relative;
    width: var(--home-content-w);
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0;
}

.gp-carousel-arrow-left {
    left: -18px;
}

.gp-carousel-arrow-right {
    right: -18px;
}

.home-featured-carousel-wrap {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0 0 .75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.home-featured-carousel-wrap::-webkit-scrollbar {
    display: none;
}

.home-featured-carousel-wrap .gp-prod-card {
    flex: 0 0 calc((100% - 4rem) / 5);
    min-width: 160px;
    scroll-snap-align: start;
}

.home-featured-carousel {
    display: block !important;
    width: var(--home-content-w) !important;
    max-width: var(--page-max) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.home-featured-carousel .ui-carousel-items-content,
.home-featured-carousel .p-carousel-items-content {
    width: calc(100% + 1rem) !important;
    margin-right: -.5rem !important;
    margin-left: -.5rem !important;
    overflow: hidden !important;
}

.home-featured-carousel .ui-carousel-content,
.home-featured-carousel .p-carousel-content,
.home-featured-carousel .ui-carousel-container,
.home-featured-carousel .p-carousel-container {
    width: 100% !important;
    overflow: visible !important;
}

.home-featured-carousel .ui-carousel-items-container,
.home-featured-carousel .p-carousel-items-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    overflow: visible !important;
    transition: transform 500ms ease !important;
}

.home-featured-carousel .ui-carousel-item,
.home-featured-carousel .p-carousel-item {
    padding: 0 .5rem !important;
}

.home-categories-carousel-outer {
    position: relative;
}

.home-categories-carousel {
    display: flex;
    width: 100%;
    gap: .5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.home-categories-carousel::-webkit-scrollbar {
    display: none;
}

.home-categories-carousel .cat-card {
    flex: 0 0 calc((100% - 4 * .5rem) / 6);
    min-width: 160px;
    scroll-snap-align: start;
}

/* Barra de confianza y catálogo clásico */
.home-trust-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: var(--home-content-w);
    margin: 0 auto 1rem;
    padding: 1.5rem var(--page-pad);
    gap: 1rem;
    border: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
    border-radius: var(--border-radius);
    background: var(--surface-0);
}

.home-trust-item {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.home-trust-item > .pi {
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 1.6rem;
}

.home-trust-item > div {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.home-trust-title {
    color: var(--text-color);
    font-size: .82rem;
    font-weight: 700;
}

.home-trust-sub {
    color: color-mix(in srgb, var(--text-color) 50%, transparent);
    font-size: .72rem;
}

.home-catalog-section {
    min-height: 340px;
    background: var(--surface-section);
}

.home-compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
    gap: .6rem !important;
}

.home-compact-grid .gp-prod-card {
    border-radius: var(--border-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.home-compact-grid .gp-prod-img-carousel {
    width: 100%;
    background-color: #FFFFFF;
}

.home-compact-grid .gp-prod-img-slide {
    background-color: var(--surface-0);
    background-position: center;
    background-size: contain;
}

.home-compact-grid .gp-prod-img-link {
    display: block;
    overflow: hidden;
    border-bottom: 1px solid #F1F5F9;
    line-height: 0;
}

.home-compact-grid .gp-prod-body {
    padding: .5rem .6rem .45rem;
    gap: .25rem;
}

.home-compact-grid .gp-prod-nombre {
    min-height: calc(1.35em * 2);
    color: var(--text-color);
    font-size: .78rem;
    font-weight: 500;
    -webkit-line-clamp: 2;
}

.home-compact-grid .gp-prod-precio-desde {
    margin: .15rem 0 .1rem;
}

.home-compact-grid .gp-prod-precio-desde-val {
    color: var(--text-color);
    font-size: .92rem;
    font-weight: 800;
}

.home-compact-grid .gp-prod-precio-desde-label {
    font-size: .68rem;
}

.home-compact-grid .gp-prod-footer .gp-prod-btn-agregar.ui-button,
.home-compact-grid .gp-prod-footer .gp-prod-btn-ver {
    width: 100%;
    padding: .35rem 0;
    font-size: .75rem;
}

.home-compact-grid .gp-prod-btn-agregar {
    margin-top: .25rem;
}

.home-catalog-section .ui-dataview {
    width: var(--home-content-w);
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .home-featured-carousel-wrap .gp-prod-card {
        flex-basis: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 767px) {
    .home-banner-carousel {
        min-height: 0;
    }

    .home-carousel-section .ui-carousel,
    .home-carousel-section .p-carousel,
    .home-carousel-section .ui-carousel-content,
    .home-carousel-section .ui-carousel-container,
    .home-carousel-section .ui-carousel-items-content,
    .home-carousel-section .p-carousel-content,
    .home-carousel-section .p-carousel-container,
    .home-carousel-section .p-carousel-items-content,
    .home-carousel-section .ui-carousel-items-container,
    .home-carousel-section .p-carousel-items-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    .home-carousel-section .ui-carousel-item,
    .home-carousel-section .p-carousel-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
    }

    .home-section {
        padding: .75rem 0;
    }

    .home-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-categories-grid.grid-mobile-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .home-categories-grid.grid-mobile-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-categories-grid.grid-mobile-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-trust-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    }

    .home-categories-carousel .cat-card {
        flex-basis: calc((100% - 1rem) / 2);
    }
}

@media (max-width: 640px) {
    .home-featured-carousel-wrap .gp-prod-card {
        flex-basis: calc((100% - 1rem) / 2);
    }
}

@media (max-width: 480px) {
    .home-compact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .home-categories-carousel .cat-card {
        flex-basis: calc((100% - 2 * .5rem) / 4);
    }
}
