/* ═══════════ TIENDA PÚBLICA ═══════════ */

.tienda-body { background: #f8fafc; margin: 0; }

.tienda-header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(11,37,69,.08);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tienda-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.tienda-logo { font-size: 1.5rem; font-weight: 800; color: #13315c; text-decoration: none; }
.tienda-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.carrito-header-btn {
    background: #1d4ed8;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: .85rem;
}
.carrito-header-btn:hover { background: #13315c; }

.carrito-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    padding: 0 4px;
}

.tienda-hero {
    background: linear-gradient(135deg, #0b2545, #1d4ed8);
    color: #fff;
    padding: 50px 20px;
    text-align: center;
}
.tienda-hero h1 { font-size: 2.2rem; margin-bottom: 10px; color: #fff; }
.tienda-hero p { opacity: .9; font-size: 1rem; }

.tienda-content { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

.tienda-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.tienda-subtitulo {
    color: #13315c;
    margin-bottom: 14px;
    font-size: 1.2rem;
}

.tienda-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.tienda-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(11,37,69,.06);
    transition: all .2s;
    cursor: pointer;
}
.tienda-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(11,37,69,.12); }
.tienda-card-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    overflow: hidden;
}
.tienda-card-img img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card-info { padding: 12px; text-align: center; }
.tienda-card-nombre { font-weight: 700; color: #0f172a; font-size: .95rem; margin-bottom: 4px; }
.tienda-card-precio { color: #1d4ed8; font-weight: 800; font-size: 1.1rem; }
.tienda-card-precio small { font-size: .7rem; color: #94a3b8; font-weight: 500; }

/* CARRITO LATERAL */
.carrito-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(11,37,69,.08);
    position: sticky;
    top: 80px;
    overflow: hidden;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}
.carrito-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #0b2545, #1d4ed8);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.carrito-header h3 { color: #fff; margin: 0; font-size: 1.05rem; }
.carrito-vacio { padding: 40px 20px; text-align: center; }
.carrito-vacio p { margin: 8px 0; }
.carrito-items { max-height: 340px; overflow-y: auto; padding: 10px; }
.carrito-item {
    background: #eff6ff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
}
.carrito-item-nombre { font-weight: 700; color: #0f172a; font-size: .85rem; padding-right: 24px; }
.carrito-item-detalle { font-size: .75rem; color: #475569; margin-top: 2px; }
.carrito-item-precio { font-weight: 700; color: #1d4ed8; font-size: .9rem; margin-top: 4px; }
.carrito-item-quitar {
    position: absolute; top: 6px; right: 6px;
    background: transparent; border: none;
    color: #ef4444; cursor: pointer;
    font-size: 1rem; padding: 2px 6px; border-radius: 4px;
}
.carrito-item-quitar:hover { background: #fee2e2; }

.carrito-resumen {
    padding: 14px 16px;
    border-top: 2px solid #dbeafe;
    background: #fafbff;
}
.carrito-linea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: .88rem;
}
.carrito-total {
    font-size: 1.15rem !important;
    font-weight: 800;
    color: #0f172a;
    padding-top: 10px;
    border-top: 1px solid #dbeafe;
    margin-top: 6px;
}

@media(max-width:900px) {
    .tienda-grid { grid-template-columns: 1fr; }
    .carrito-card { position: static; max-height: none; }
}