/* ═══════════════════════════════════════════════════════
   _tienda.css  –  Página de tienda y detalle de producto
   ═══════════════════════════════════════════════════════ */

/* ── Hero tienda ── */
.tienda-hero {
    background: linear-gradient(135deg, #F9D9E0 0%, #F2B8C6 50%, #FAD4DC 100%);
    color: var(--brown-dark);
    padding: 50px 24px;
    text-align: center;
    border-bottom: 2px solid var(--pink-mid);
}
.tienda-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-style: italic;
    color: var(--brown-dark);
}
.tienda-hero p {
    margin-top: 8px;
    font-size: 16px;
    color: var(--brown-mid);
}

/* ── Layout principal tienda ── */
.tienda-main {
    background: var(--cream);
    padding: 40px 0 60px;
}
.tienda-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Sidebar ── */
.tienda-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--nav-h) + 16px);
}
.filtro-group {
    background: var(--white);
    border-radius: 14px;
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}
.filtro-titulo {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brown-light);
    margin-bottom: var(--space-md);
}
.filtro-lista { display: flex; flex-direction: column; gap: 4px; }
.filtro-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--brown-mid);
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.filtro-link:hover       { background: var(--pink-soft); color: var(--brown-dark); }
.filtro-link-activo      { background: var(--red); color: var(--white) !important; font-weight: bold; }

/* ── Contenido tienda ── */
.tienda-content { min-width: 0; }
.tienda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.tienda-count { font-size: 14px; color: var(--brown-mid); }
.productos-grid         { display: grid; gap: 16px; }
.productos-grid-tienda  { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ── Tarjeta producto (estilo MercadoLibre) ── */
.producto-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    color: var(--brown-dark);
}
.producto-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-3px);
}

.producto-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}
.producto-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .3s;
}
.producto-card:hover .producto-img img { transform: scale(1.04); }
.producto-img-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--brown-light);
}

.badge-agotado {
    position: absolute;
    top: 10px; left: 10px;
    background: #e00;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.producto-info {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.producto-categoria {
    font-size: 11px;
    color: var(--brown-light);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.producto-nombre {
    font-size: 14px;
    font-weight: normal;
    font-style: normal;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.producto-precio {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-top: 6px;
    font-style: normal;
}

/* ── Empty state ── */
.tienda-empty {
    text-align: center;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}
.empty-icon  { font-size: 4rem; }
.tienda-empty h3 { font-size: 20px; color: var(--brown-dark); font-style: italic; }
.tienda-empty p  { color: var(--brown-mid); }

/* ── Detalle producto ── */
.detalle-section {
    background: var(--cream);
    padding: 40px 0 60px;
}
.detalle-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--brown-mid);
    margin-bottom: var(--space-xl);
}
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span:not(.sep) { color: var(--brown-light); }

.detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.detalle-img-wrapper {
    border-radius: 20px;
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
}
.detalle-img { width: 100%; height: 100%; object-fit: cover; }

.detalle-info { display: flex; flex-direction: column; gap: var(--space-md); }
.detalle-nombre {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: bold;
    font-style: italic;
    color: var(--brown-dark);
}
.detalle-precio-wrapper { display: flex; align-items: baseline; gap: 12px; }
.detalle-precio { font-size: 32px; font-weight: bold; color: var(--red); }
.detalle-unidad { font-size: 14px; color: var(--brown-light); }
.detalle-descripcion { font-size: 15px; color: var(--brown-mid); line-height: 1.7; }

.detalle-stock { font-size: 14px; font-weight: bold; }
.stock-ok  { color: #4CAF50; }
.stock-out { color: var(--red); }

.detalle-proveedor { font-size: 13px; color: var(--brown-light); }

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: var(--white);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: bold;
    font-family: var(--font-main);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all var(--transition-fast);
    margin-top: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn-whatsapp:hover {
    background: #1db954;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    transform: translateY(-2px);
}

.section-relacionados { padding: 40px 0; background: var(--cream); }
.section-relacionados .section-title { font-size: 24px; margin-bottom: 24px; }

/* ── Responsive tienda ── */
@media (max-width: 860px) {
    .tienda-container { grid-template-columns: 1fr; }
    .tienda-sidebar   { position: static; }
    .filtro-lista     { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .filtro-link      { border: 1px solid var(--pink-mid); border-radius: var(--radius-full); padding: 6px 14px; }
    .detalle-grid     { grid-template-columns: 1fr; }
}
