/* =========================================================
   TIENDA
   Estilos propios de la página Tienda.
   Todos los selectores parten de .tienda-page para evitar
   interferencias con el resto de páginas de la SPA.
   ========================================================= */

.tienda-page {
    width: 100%;
    background: #f3f5f7;
    color: var(--azul-marino);

    /* Evita que el margen inferior de la última sección
       salga fuera del fondo de la página */
    display: flow-root;
}


/* =========================================================
   HERO
   ========================================================= */

.tienda-hero {
    position: relative;

    min-height: 300px;
    padding: 45px 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    /* Foto real de la tienda con una capa clara encima
       para mantener una buena legibilidad del contenido */
    background:
        linear-gradient(
            rgba(232, 238, 241, 0.72),
            rgba(232, 238, 241, 0.72)
        ),
        url("../assets/img/tienda/hero-tienda.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-bottom: 3px solid var(--verde);
}


/* Tarjeta blanca central del hero */
.tienda-hero-card {
    position: relative;
    z-index: 1;

    width: min(100%, 540px);
    padding: 28px 36px;

    text-align: center;

    background: rgba(255, 255, 255, 0.94);

    border: 1px solid #e2e6ea;
    border-radius: 14px;

    box-shadow: 0 8px 24px rgba(31, 46, 94, 0.12);
}


.tienda-hero-card h1 {
    margin: 0 0 12px;

    color: var(--azul-marino);

    font-size: 32px;
    font-weight: 800;
}


.tienda-hero-card p {
    margin: 0;

    color: #666;

    font-size: 14px;
    line-height: 1.6;
}


/* Dirección mostrada como botón/píldora,
   siguiendo el diseño de Figma */
.tienda-address {
    width: fit-content;

    margin: 20px auto 0;
    padding: 9px 24px;

    background: var(--azul-marino);
    color: var(--blanco);

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
}


/* =========================================================
   FRASE DESTACADA
   ========================================================= */

.tienda-quote {
    padding: 20px;

    background: var(--azul-marino);
    color: var(--blanco);

    text-align: center;
}


.tienda-quote p {
    margin: 0;

    font-size: 14px;
    line-height: 1.6;
}


.tienda-quote strong {
    color: var(--verde);
    font-weight: 700;
}


/* =========================================================
   CONTENEDORES PRINCIPALES
   Categorías y artículos
   ========================================================= */

.tienda-categories,
.tienda-products {
    width: calc(100% - 80px);
    max-width: 1540px;

    margin: 35px auto 50px;
    padding: 40px 42px 46px;

    border-radius: 22px;
}


/* Categorías:
   fondo ligeramente verdoso con acento verde */
.tienda-categories {
    background: linear-gradient(
        135deg,
        #f7faf8 0%,
        #eef5f0 100%
    );

    border: 1px solid #dce7df;
    border-top: 4px solid var(--verde);

    box-shadow: 0 10px 28px rgba(31, 46, 94, 0.06);
}


/* Artículos:
   fondo blanco con acento azul */
.tienda-products {
    background: var(--blanco);

    border: 1px solid #dde4ec;
    border-top: 4px solid var(--azul-marino);

    box-shadow: 0 10px 28px rgba(31, 46, 94, 0.08);
}


/* =========================================================
   TÍTULOS DE SECCIÓN
   ========================================================= */

.tienda-categories h2,
.tienda-section-heading h2 {
    margin: 0 0 8px;

    text-align: center;

    color: var(--azul-marino);

    font-size: 32px;
    font-weight: 800;
}


.tienda-categories h2 {
    margin-bottom: 24px;
}


.tienda-section-heading {
    margin-bottom: 24px;

    text-align: center;
}


.tienda-section-heading p {
    margin: 0;

    color: #666;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   GRID DE CATEGORÍAS Y PRODUCTOS
   ========================================================= */

/* Tres tarjetas por fila en escritorio */
.tienda-categories-grid,
.tienda-products-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 24px;
}


/* Si queda una sola tarjeta en la última fila,
   se coloca en el centro en escritorio */
.tienda-categories-grid > .tienda-category-card:last-child:nth-child(3n + 1),
.tienda-products-grid > .tienda-product-card:last-child:nth-child(3n + 1) {
    grid-column: 2 / 3;
}


/* =========================================================
   TARJETAS DE CATEGORÍAS
   ========================================================= */

.tienda-category-card {
    overflow: hidden;

    background: var(--blanco);

    border: 1px solid #e2e6ea;
    border-radius: 12px;

    text-align: center;

    box-shadow: 0 6px 18px rgba(31, 46, 94, 0.08);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.tienda-category-card img {
    display: block;

    width: 100%;
    height: 180px;

    object-fit: cover;
}


/* Línea verde que separa la imagen del contenido */
.tienda-category-content {
    padding: 16px 18px 20px;

    border-top: 7px solid var(--verde);
}


.tienda-category-content h3 {
    margin: 0 0 10px;

    color: var(--azul-marino);

    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
}


.tienda-category-content p {
    max-width: 260px;

    margin: 0 auto;

    color: #666;

    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   TARJETAS DE ARTÍCULOS
   Productos cargados dinámicamente desde la BD
   ========================================================= */

.tienda-product-card {
    overflow: hidden;

    background: var(--blanco);

    border: 1px solid #e2e6ea;
    border-radius: 12px;

    box-shadow: 0 6px 18px rgba(31, 46, 94, 0.08);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Zona reservada para la imagen del artículo */
.tienda-product-image {
    width: 100%;
    height: 180px;

    overflow: hidden;

    background: #e8edf0;
}


.tienda-product-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* Se muestra cuando la imagen indicada en la BD
   no existe físicamente en el servidor */
.tienda-product-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #7b8490;

    font-size: 12px;
}


/* Información del producto */
.tienda-product-content {
    padding: 16px 18px 20px;
}


/* Categoría visual del artículo */
.tienda-product-category {
    display: inline-block;

    margin-bottom: 10px;
    padding: 5px 11px;

    background: var(--verde);
    color: var(--blanco);

    border-radius: 999px;

    font-size: 11px;
    font-weight: 600;
}


.tienda-product-content h3 {
    margin: 0 0 8px;

    color: var(--azul-marino);

    font-size: 17px;
    font-weight: 800;
}


.tienda-product-content p {
    margin: 0;

    color: #666;

    font-size: 12px;
    line-height: 1.5;
}


/* Mensaje mostrado cuando no existen artículos */
.tienda-empty {
    margin: 0;

    text-align: center;

    color: #666;

    font-size: 13px;
}


/* =========================================================
   EFECTO HOVER DE TARJETAS
   ========================================================= */

.tienda-category-card:hover,
.tienda-product-card:hover {
    transform: translateY(-4px);

    box-shadow: 0 12px 26px rgba(31, 46, 94, 0.14);
}


/* =========================================================
   MENSAJE DE SOSTENIBILIDAD
   ========================================================= */

.tienda-sustainability {
    max-width: 780px;

    margin: 10px auto 40px;
    padding: 24px 34px;

    background: var(--verde);
    color: var(--blanco);

    border-radius: 12px;

    text-align: center;

    box-shadow: 0 8px 20px rgba(90, 188, 85, 0.18);
}


.tienda-sustainability h2 {
    margin: 0 0 8px;

    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}


.tienda-sustainability p {
    max-width: 470px;

    margin: 0 auto;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   VEN A VERNOS
   ========================================================= */

.tienda-visit {
    width: calc(100% - 80px);
    max-width: 1540px;

    margin: 0 auto 50px;
    padding: 38px 42px 42px;

    background: var(--azul-marino);
    color: var(--blanco);

    border: 1px solid rgba(255, 255, 255, 0.12);

    /* El acento superior pasa a verde
       para contrastar con el fondo azul */
    border-top: 4px solid var(--verde);

    border-radius: 22px;

    box-shadow: 0 12px 30px rgba(31, 46, 94, 0.16);
}


/* Título principal de la sección */
.tienda-visit .tienda-section-heading h2 {
    color: var(--blanco);
}


/* Texto descriptivo debajo del título */
.tienda-visit .tienda-section-heading p {
    color: rgba(255, 255, 255, 0.82);
}


.tienda-visit-grid {
    max-width: 1050px;

    margin: 25px auto 0;

    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 24px;
}


/* Tarjetas de información */
.tienda-visit-card {
    position: relative;
    overflow: hidden;

    padding: 24px 24px;

    background: var(--verde);
    color: var(--blanco);

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;

    text-align: center;

    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Línea decorativa sobre cada tarjeta.
   Ahora es clara porque la tarjeta ya es verde. */
.tienda-visit-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 4px;

    background: rgba(255, 255, 255, 0.85);
}


/* Pequeño efecto visual al pasar el ratón */
.tienda-visit-card:hover {
    transform: translateY(-3px);

    box-shadow: 0 11px 24px rgba(0, 0, 0, 0.18);
}


.tienda-visit-card h3 {
    margin: 4px 0 8px;

    color: var(--blanco);

    font-size: 15px;
    font-weight: 700;
}


.tienda-visit-card p {
    margin: 0;

    color: rgba(255, 255, 255, 0.88);

    font-size: 12px;
    line-height: 1.55;
}


.tienda-visit-card strong {
    color: var(--blanco);

    font-weight: 700;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet y pantallas medianas */
@media (max-width: 1100px) {

    .tienda-categories-grid,
    .tienda-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }


    /* Ya no es necesario centrar la última tarjeta
       cuando tenemos dos columnas */
    .tienda-categories-grid > .tienda-category-card:last-child:nth-child(3n + 1),
    .tienda-products-grid > .tienda-product-card:last-child:nth-child(3n + 1) {
        grid-column: auto;
    }

}


/* Tablet pequeño */
@media (max-width: 768px) {

    .tienda-hero {
        min-height: 260px;

        padding: 35px 18px;
    }


    .tienda-hero-card {
        padding: 24px 20px;
    }


    .tienda-hero-card h1 {
        font-size: 26px;
    }


    .tienda-hero-card p {
        font-size: 13px;
    }


    .tienda-categories,
    .tienda-products,
    .tienda-visit {
        width: calc(100% - 36px);

        padding-left: 24px;
        padding-right: 24px;
    }


    .tienda-categories-grid,
    .tienda-products-grid {
        gap: 16px;
    }

}


/* Móvil */
@media (max-width: 560px) {

    .tienda-categories,
    .tienda-products,
    .tienda-visit {
        width: calc(100% - 28px);

        padding-left: 18px;
        padding-right: 18px;

        border-radius: 16px;
    }


    .tienda-categories-grid,
    .tienda-products-grid,
    .tienda-visit-grid {
        grid-template-columns: 1fr;
    }


    .tienda-category-card img,
    .tienda-product-image {
        height: 190px;
    }


    .tienda-sustainability {
        margin-left: 18px;
        margin-right: 18px;

        padding: 22px 20px;
    }

}


/* Móvil pequeño */
@media (max-width: 480px) {

    .tienda-hero {
        min-height: 230px;

        padding: 26px 14px;
    }


    .tienda-hero-card h1 {
        font-size: 23px;
    }


    .tienda-address {
        padding: 8px 18px;

        font-size: 11px;
    }


    .tienda-categories h2,
    .tienda-section-heading h2 {
        font-size: 26px;
    }

}


/* =========================================================
   BÚSQUEDA Y FILTRADO DE ARTÍCULOS
   ========================================================= */

.tienda-filter-form {
    margin: 0 auto 32px;
    padding: 22px 24px;

    display: grid;
    grid-template-columns: minmax(220px, 1fr) 260px auto auto;
    align-items: end;
    gap: 16px;

    background: #f6f8fa;

    border: 1px solid #dce3e8;
    border-radius: 14px;
}


.tienda-filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.tienda-filter-field label {
    color: var(--azul-marino);

    font-size: 11px;
    font-weight: 700;
}


.tienda-filter-field input,
.tienda-filter-field select {
    width: 100%;
    min-height: 42px;

    padding: 10px 13px;

    background: var(--blanco);
    color: var(--azul-marino);

    border: 1px solid #ccd5dc;
    border-radius: 8px;

    font-family: var(--fuente);
    font-size: 12px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.tienda-filter-field input:focus,
.tienda-filter-field select:focus {
    border-color: var(--verde);

    box-shadow: 0 0 0 3px rgba(90, 188, 85, 0.15);
}


.tienda-filter-button {
    min-height: 42px;

    padding: 10px 20px;

    border: none;
    border-radius: 999px;

    font-family: var(--fuente);
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


.tienda-filter-button:hover {
    transform: translateY(-2px);
}


.tienda-filter-submit {
    background: var(--verde);
    color: var(--blanco);
}


.tienda-filter-reset {
    background: var(--azul-marino);
    color: var(--blanco);
}


/* ===== RESPONSIVE FILTROS ===== */

@media (max-width: 950px) {

    .tienda-filter-form {
        grid-template-columns: 1fr 1fr;
    }

}


@media (max-width: 600px) {

    .tienda-filter-form {
        grid-template-columns: 1fr;
    }

    .tienda-filter-button {
        width: 100%;
    }

}