/* ============================================================
   HOME NUEVA — estilos generales
   ============================================================ */

:root {
    --eg-green: #1d4d3a;
    --eg-green-deep: #163b2c;
    --eg-cream: #f5f1ea;
    --eg-cream-soft: #ebe4d4;
    --eg-accent: #d4924a;
    --eg-gold: #e8a82d;
}

/* ------------------------------------------------------------
   Astra abre "#content > .ast-container" como flex (para la
   maquetación de sidebar). En esta plantilla no hay sidebar y
   necesitamos que el carrusel y el contenido se apilen en vez
   de comportarse como columnas de una fila.
   ------------------------------------------------------------ */

.page-template-template-home-php #content > .ast-container {
    display: block;
}

.eg-home-container {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ------------------------------------------------------------
   Carrusel de avisos (hero reducido)
   ------------------------------------------------------------ */

.eg-hero-carousel {
    position: relative;
    width: 100%;
    height: 220px;
    margin-top: 18px;
    overflow: hidden;
    background: var(--eg-green-deep);
}

@media (min-width: 768px) {
    .eg-hero-carousel {
        height: 280px;
    }
}

.eg-hero-carousel__track {
    position: relative;
    width: 100%;
    height: 100%;
}

.eg-hero-slide {
    position: absolute;
    inset: 0;
    display: block;
}

.eg-hero-slide[hidden] {
    display: none;
}

a.eg-hero-slide {
    cursor: pointer;
}

.eg-hero-slide__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eg-hero-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.eg-hero-carousel__arrow--prev {
    left: 0.75rem;
}

.eg-hero-carousel__arrow--next {
    right: 0.75rem;
}

.eg-hero-carousel__dots {
    position: absolute;
    z-index: 2;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
}

.eg-hero-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
}

.eg-hero-carousel__dot.is-active {
    background: var(--eg-gold);
}

/* ------------------------------------------------------------
   Filas de productos (recomendados / más vendidos / novedades)
   ------------------------------------------------------------ */

.eg-product-row {
    margin: 2.5rem 0;
}

.eg-product-row__title {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    color: var(--eg-green-deep);
}

.eg-product-row__viewport {
    position: relative;
}

.eg-product-row__track {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.eg-product-row__track::-webkit-scrollbar {
    display: none;
}

.eg-product-row__item {
    flex: 0 0 auto;
    width: calc(16.6666% - 0.5rem);
    scroll-snap-align: start;
    border: 1px solid var(--eg-cream-soft);
    border-radius: 8px;
    padding: 0.6rem;
    background: #fff;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1400px) {
    .eg-product-row__item {
        width: calc(14.2857% - 0.52rem);
    }
}

@media (max-width: 992px) {
    .eg-product-row__item {
        width: calc(25% - 0.45rem);
    }
}

@media (max-width: 600px) {
    .eg-product-row__item {
        width: calc(42% - 0.36rem);
    }
}

.eg-product-row__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.eg-product-row__img img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.eg-product-row__meta {
    margin: 0.5rem 0 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #8a8578;
}

.eg-product-row__name {
    margin: 0.2rem 0 0.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-product-row__author {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    color: #8a8578;
}

.eg-product-row__price {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--eg-accent);
}

.eg-product-row__price del {
    font-weight: 400;
    opacity: 0.55;
    margin-right: 0.3em;
    font-size: 0.85em;
}

.eg-product-row__price ins {
    text-decoration: none;
}

.eg-product-row__stock {
    margin: 0.35rem 0 0;
    font-size: 0.68rem;
    font-weight: 600;
}

.eg-product-row__stock--in-stock {
    color: #3a7a4e;
}

.eg-product-row__stock--available-on-backorder {
    color: var(--eg-accent);
}

.eg-product-row__stock--out-of-stock {
    color: #b3413c;
}

.eg-product-row__cart {
    margin-top: auto;
    padding-top: 0.45rem;
}

.eg-product-row__cart a {
    display: block;
    text-align: center;
    padding: 0.4rem 0.5rem;
    border-radius: 999px;
    background: var(--eg-green-deep);
    color: var(--eg-cream) !important;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.eg-product-row__cart a:hover {
    background: var(--eg-green);
}

.eg-product-row__arrow {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--eg-green-deep);
    color: var(--eg-cream);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.eg-product-row__arrow--prev {
    left: -0.75rem;
}

.eg-product-row__arrow--next {
    right: -0.75rem;
}
