/* ========== TIENDA HERO ========== */
.tienda-page {
    padding-top: 5rem;
}

.tienda-hero {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    padding: 3rem 0;
    text-align: center;
}

.tienda-hero__title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
}

.tienda-hero__subtitle {
    color: var(--gray-700);
    font-size: 1.15rem;
    max-width: 550px;
    margin: 0 auto 2rem;
}

.tienda-hero__search {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    gap: 0.75rem;
    transition: var(--transition);
}

.tienda-hero__search:focus-within {
    border-color: var(--turquoise);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1);
}

.tienda-hero__search i {
    color: var(--gray-500);
    font-size: 1.1rem;
}

.tienda-hero__search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    font-family: var(--font);
    background: transparent;
}

/* ========== LAYOUT PRINCIPAL ========== */
.tienda-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* ========== SIDEBAR FILTROS ========== */
.tienda-filters {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
}

.filters__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.filters__header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.filters__clear {
    color: var(--turquoise);
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.filters__clear:hover {
    opacity: 0.7;
}

.filters__group {
    margin-bottom: 1.5rem;
}

.filters__group h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.filter-option:hover {
    background: var(--gray-50);
}

.filter-option.active {
    background: rgba(0, 180, 216, 0.08);
    color: var(--turquoise-dark);
    font-weight: 600;
}

.filter-option input {
    display: none;
}

.filters__whatsapp {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

/* ========== PRODUCTOS HEADER ========== */
.tienda-products__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tienda-products__count {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.tienda-filters-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* ========== GRID DE PRODUCTOS ========== */
.tienda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Tarjeta de producto estilo Mercado Libre */
.product-ml-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-ml-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--turquoise-light);
}

.product-ml-card__img {
    height: 200px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-ml-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-ml-card__img-fallback {
    font-size: 4rem;
    color: var(--turquoise);
    opacity: 0.6;
}

.product-ml-card__discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #FF4757;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-ml-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-ml-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;                    /* propiedad estándar */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-ml-card__desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.product-ml-card__price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.product-ml-card__installments {
    font-size: 0.8rem;
    color: var(--turquoise-dark);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-ml-card__shipping {
    font-size: 0.75rem;
    color: #00A650;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.product-ml-card__actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

.product-ml-card__actions .btn {
    flex: 1;
    justify-content: center;
}

/* ========== EMPTY STATE ========== */
.tienda-empty {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.tienda-empty i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.tienda-empty p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .tienda-layout {
        grid-template-columns: 1fr;
    }

    .tienda-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        z-index: 2000;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.35s ease;
        box-shadow: var(--shadow-xl);
    }

    .tienda-filters.open {
        left: 0;
    }

    .tienda-filters-toggle {
        display: flex;
    }

    .filters__overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        display: none;
    }

    .filters__overlay.visible {
        display: block;
    }
}

@media (max-width: 600px) {
    .tienda-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .product-ml-card__img {
        height: 150px;
    }

    .product-ml-card__price {
        font-size: 1.2rem;
    }

    .product-ml-card__actions {
        flex-direction: column;
    }
}