/* =============================================================
   Ventas Baratas — Tienda page styles  (v2)
   3-column layout: [Filters 260px] | [Grid flex:1] | [MiniCart 280px]
   ============================================================= */

/* ── Floating back-to-tienda widget (on product detail page) ─ */
.tienda-back-widget {
    position: fixed;
    bottom: 100px;
    left: 20px;
    z-index: 1200;
    cursor: pointer;
    text-decoration: none;
    animation: tbw-enter .55s cubic-bezier(.34,1.56,.64,1) both;
    filter: drop-shadow(0 4px 18px rgba(255,122,0,.45));
}
@keyframes tbw-enter {
    from { opacity: 0; transform: translateX(-80px) scale(.85); }
    to   { opacity: 1; transform: translateX(0)    scale(1);   }
}

.tbw-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF7A00 0%, #8A2BE2 100%);
    color: #fff;
    padding: 11px 18px 11px 14px;
    border-radius: 40px;
    box-shadow: 0 4px 20px rgba(138,43,226,.35), 0 2px 8px rgba(255,122,0,.3);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .2s, filter .2s;
    animation: tbw-pulse 3s ease-in-out 1s infinite;
}
@keyframes tbw-pulse {
    0%,100% { box-shadow: 0 4px 20px rgba(138,43,226,.35), 0 2px 8px rgba(255,122,0,.3); }
    50%      { box-shadow: 0 6px 28px rgba(138,43,226,.55), 0 4px 14px rgba(255,122,0,.5); }
}
.tienda-back-widget:hover .tbw-inner {
    transform: scale(1.05) translateX(2px);
    filter: brightness(1.08);
}

.tbw-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.tbw-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.tbw-text small {
    font-size: 10px;
    font-weight: 500;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tbw-text strong {
    font-size: 13px;
    font-weight: 800;
}

.tbw-arrow {
    font-size: 18px;
    margin-left: 4px;
    opacity: .9;
    transition: transform .2s;
}
.tienda-back-widget:hover .tbw-arrow {
    transform: translateX(-3px);
}

/* ── Layout container ─────────────────────────────────────── */
.tienda-page { padding-top: 8px; padding-bottom: 48px; }

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

/* ── Left: Filters ────────────────────────────────────────── */
.tienda-filters {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.tienda-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.tienda-filters__title { font-size: 15px; font-weight: 700; margin: 0; }
.tienda-filters__close {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--c-text-muted);
    padding: 2px 6px;
}

.tf-group { margin-bottom: 20px; }
.tf-group:last-child { margin-bottom: 0; }

.tf-group__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-text-muted);
    margin-bottom: 8px;
}

.tf-input, .tf-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--c-text);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.tf-input:focus, .tf-select:focus { border-color: var(--c-secondary); }

.tf-cat-list { display: flex; flex-direction: column; gap: 4px; }
.tf-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 0;
}
.tf-check input { flex-shrink: 0; accent-color: var(--c-secondary); }
.tf-check span:first-of-type { flex: 1; }
.tf-check__count {
    font-size: 11px;
    color: var(--c-text-muted);
    background: #f3f4f6;
    border-radius: 20px;
    padding: 1px 7px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Price range dual slider */
.tf-price-range { margin-bottom: 8px; }
.tf-price-track {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 20px 0 10px;
}
.tf-price-fill {
    position: absolute;
    height: 100%;
    background: var(--c-secondary);
    border-radius: 3px;
    pointer-events: none;
}
.tf-range {
    -webkit-appearance: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
    outline: none;
}
.tf-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-secondary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 2;
}
.tf-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-secondary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
    pointer-events: all;
}
.tf-price-vals {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 4px;
}

/* Toggle switches */
.tf-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
}
.tf-switch input { display: none; }
.tf-switch__track {
    position: relative;
    width: 34px;
    height: 18px;
    background: #d1d5db;
    border-radius: 9px;
    flex-shrink: 0;
    transition: background .2s;
}
.tf-switch__track::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
    transition: left .2s;
}
.tf-switch input:checked ~ .tf-switch__track { background: var(--c-secondary); }
.tf-switch input:checked ~ .tf-switch__track::after { left: 18px; }

.tf-clear {
    display: block;
    text-align: center;
    font-size: 12px;
    margin-top: 8px;
    color: var(--c-text-muted);
    text-decoration: none;
}
.tf-clear:hover { color: var(--c-danger); }

/* ── Center: Products grid ────────────────────────────────── */
.tienda-main { min-width: 0; }

.tienda-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}
.tienda-topbar__count { margin: 0; font-size: 14px; color: var(--c-text-muted); }
.tienda-topbar__count strong { color: var(--c-text); }
.tienda-topbar__right { display: flex; align-items: center; gap: 10px; }

.tienda-filters-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: var(--c-text);
}
.tienda-filters-toggle:hover { border-color: var(--c-secondary); color: var(--c-secondary); }

/* 3-column product grid */
.tienda-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── Product cards ────────────────────────────────────────── */
.tienda-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
    position: relative;
}
.tienda-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.tienda-card.is-highlighted {
    outline: 2.5px solid var(--c-primary);
    animation: tc-highlight .8s ease 2;
}
@keyframes tc-highlight {
    0%, 100% { outline-color: var(--c-primary); }
    50%       { outline-color: var(--c-secondary); }
}

.tienda-card__media {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f9f9f9;
}
.tienda-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s, opacity .18s;
}
.tienda-card:hover .tienda-card__media img { transform: scale(1.04); }

/* Hover image cycling — progress dots */
.tc-img-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    z-index: 3;
}
.tienda-card:hover .tc-img-dots { opacity: 1; }

.tc-img-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(0,0,0,.15);
    transition: background .2s, transform .2s, width .2s;
    flex-shrink: 0;
}
.tc-img-dot.is-active {
    background: #fff;
    width: 14px;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.tienda-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #bbb;
    background: #f3f4f6;
}

.tc-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}
.tc-badge--discount { background: var(--c-danger); color: #fff; }
.tc-badge--new      { background: var(--c-secondary); color: #fff; }
.tc-badge--out      { background: #6b7280; color: #fff; }

.tienda-card__body { padding: 10px 12px 6px; flex: 1; }

.tienda-card__compare {
    font-size: 11px;
    text-decoration: line-through;
    color: var(--c-text-muted);
}
.tienda-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.tienda-card__price.is-sale { color: var(--c-danger); }
.tienda-card__off {
    font-size: 11px;
    font-weight: 600;
    background: #fef2f2;
    color: var(--c-danger);
    border-radius: 4px;
    padding: 1px 5px;
}
.tienda-card__name {
    font-size: 13px;
    color: var(--c-text);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.tienda-card__rating {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-top: 5px;
    font-size: 12px;
}
.star-on  { color: #f59e0b; }
.star-off { color: #d1d5db; }
.tienda-card__rating-count { color: var(--c-text-muted); font-size: 11px; margin-left: 3px; }

/* Card action buttons */
.tienda-card__actions {
    display: flex;
    gap: 6px;
    padding: 8px 10px 10px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.btn-tc {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1;
    white-space: nowrap;
}

/* "Ver rápido" — ghost gray */
.btn-tc--view {
    background: #fff;
    color: var(--c-text-muted);
    border: 1.5px solid #e2e2e2;
    flex: 0 0 44px;
    padding: 8px 0;
}
.btn-tc--view:hover {
    border-color: var(--c-secondary);
    color: var(--c-secondary);
    background: #f5f0ff;
}

/* "Agregar al carrito" — orange primary, grows */
.btn-tc--atc {
    flex: 1;
    background: var(--c-primary);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(255,122,0,.3);
    font-size: 12px;
}
.btn-tc--atc:hover {
    background: #e66c00;
    box-shadow: 0 3px 12px rgba(255,122,0,.45);
    transform: translateY(-1px);
}
.btn-tc--atc.btn-added {
    background: #22c55e;
    box-shadow: 0 2px 8px rgba(34,197,94,.3);
}
.btn-tc--out {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* "Ya en carrito" — verde suave con hover a carrito */
.btn-tc--incart {
    flex: 1;
    background: #f0fdf4;
    color: #16a34a;
    border: 1.5px solid #86efac;
    font-size: 12px;
    text-decoration: none;
}
.btn-tc--incart:hover {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
    box-shadow: 0 2px 8px rgba(34,197,94,.3);
    transform: translateY(-1px);
}

/* "Ver opciones" — secondary */
.btn-tc--secondary {
    background: #f3f4f6;
    color: var(--c-text);
    border: 1px solid var(--c-border);
    flex: 1;
}
.btn-tc--secondary:hover { background: var(--c-secondary); color: #fff; border-color: var(--c-secondary); }

/* Empty state */
.tienda-empty {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.tienda-empty__icon { font-size: 48px; margin: 0 0 12px; }
.tienda-empty__title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.tienda-empty__sub { color: var(--c-text-muted); font-size: 14px; margin: 0; }

/* ── Infinite scroll loader ───────────────────────────────── */
.tienda-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 0;
}
.tienda-loader[hidden] { display: none; }
.tienda-loader__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-secondary);
    animation: tl-bounce 1.2s ease-in-out infinite;
}
.tienda-loader__dot:nth-child(1) { animation-delay: 0s; }
.tienda-loader__dot:nth-child(2) { animation-delay: .2s; background: var(--c-primary); }
.tienda-loader__dot:nth-child(3) { animation-delay: .4s; }
@keyframes tl-bounce {
    0%,80%,100% { transform: scale(.7); opacity: .5; }
    40%          { transform: scale(1.1); opacity: 1; }
}

.tienda-page-info {
    text-align: center;
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 12px;
}
.tienda-end-msg {
    text-align: center;
    font-size: 13px;
    color: var(--c-text-muted);
    padding: 20px 0;
}

/* ── Right: Mini Cart ─────────────────────────────────────── */
.tienda-minicart {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.tmc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #8A2BE2 0%, #6a1fa0 100%);
    flex-shrink: 0;
}
.tmc-head__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    flex: 1;
    color: #fff;
}
.tmc-head__badge {
    background: var(--c-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.6;
}

.tmc-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
    scrollbar-width: thin;
}
.tmc-body::-webkit-scrollbar { width: 4px; }
.tmc-body::-webkit-scrollbar-track { background: transparent; }
.tmc-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* Divider between cart items */
.tmc-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
    margin: 2px 0;
}

.tmc-empty {
    text-align: center;
    padding: 28px 0;
    color: var(--c-text-muted);
    font-size: 13px;
}
.tmc-empty p:first-child { font-size: 32px; margin: 0 0 8px; }
.tmc-empty p:last-child { margin: 0; }

.tmc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
}

.tmc-item__img {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: block;
    border: 1.5px solid #f0f0f0;
}
.tmc-item__img img { width: 100%; height: 100%; object-fit: cover; }

.tmc-item__body { flex: 1; min-width: 0; }
.tmc-item__name {
    font-size: 12px;
    color: var(--c-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
    font-weight: 500;
}
.tmc-item__price { font-size: 11px; color: var(--c-text-muted); margin-bottom: 5px; }

.tmc-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tmc-qty__btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #e2e2e2;
    background: #f9f9f9;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}
.tmc-qty__btn:hover { background: var(--c-secondary); color: #fff; border-color: var(--c-secondary); }
.tmc-qty__val { font-size: 13px; font-weight: 700; min-width: 20px; text-align: center; }

.tmc-item__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.tmc-item__total { font-size: 13px; font-weight: 700; color: var(--c-text); }
.tmc-item__del {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--c-text-muted);
    cursor: pointer;
    padding: 1px 3px;
    line-height: 1;
    border-radius: 3px;
    transition: color .15s, background .15s;
}
.tmc-item__del:hover { color: #fff; background: var(--c-danger); }

.tmc-foot {
    padding: 12px 14px;
    border-top: 2px solid #f0f0f0;
    flex-shrink: 0;
    background: #fafafa;
}
.tmc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 10px;
}
.tmc-total span { color: var(--c-text-muted); }
.tmc-total strong { font-size: 16px; color: var(--c-text); font-weight: 800; }

.tmc-hr {
    border: none;
    border-top: 1px dashed #e2e2e2;
    margin: 8px 0 10px;
}

.tmc-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    padding: 11px;
    margin-bottom: 7px;
    background: linear-gradient(135deg, #FF7A00 0%, #ff5500 100%);
    box-shadow: 0 3px 12px rgba(255,122,0,.35);
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    transition: opacity .15s, transform .15s;
}
.tmc-btn-checkout:hover { opacity: .9; transform: translateY(-1px); }

.tmc-btn-cart {
    font-size: 12px;
    text-align: center;
    padding: 7px;
}

/* ── Quick-view overlay ───────────────────────────────────── */
.tqv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.58);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: tqv-fadein .2s ease;
}
@keyframes tqv-fadein { from { opacity: 0; } to { opacity: 1; } }
.tqv-overlay[hidden] { display: none; }

.tqv-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: tqv-slidein .22s ease;
}
@keyframes tqv-slidein { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.tqv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: var(--c-text);
    transition: background .15s;
}
.tqv-close:hover { background: #e5e7eb; }

.tqv-loading {
    padding: 60px;
    text-align: center;
    color: var(--c-text-muted);
    font-size: 14px;
}

.tqv-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.tqv-gallery { padding: 24px 16px 24px 24px; }
.tqv-gallery__main {
    aspect-ratio: 1/1;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 10px;
}
.tqv-gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.tqv-gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.tqv-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #f3f4f6;
    transition: border-color .15s;
    flex-shrink: 0;
}
.tqv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tqv-thumb.is-active { border-color: var(--c-secondary); }

.tqv-info {
    padding: 24px 24px 24px 16px;
    border-left: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
}
.tqv-category {
    font-size: 11px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    margin-bottom: 6px;
    display: block;
}
.tqv-category:hover { color: var(--c-secondary); }
.tqv-name { font-size: 18px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.tqv-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    margin-bottom: 10px;
}
.tqv-rating .star-on { color: #f59e0b; }
.tqv-rating .star-off { color: #d1d5db; }
.tqv-rating__count { color: var(--c-text-muted); font-size: 12px; margin-left: 4px; }

.tqv-price-area { margin-bottom: 12px; }
.tqv-compare { font-size: 12px; text-decoration: line-through; color: var(--c-text-muted); margin-bottom: 2px; }
.tqv-price { font-size: 24px; font-weight: 700; color: var(--c-text); }
.tqv-price.is-sale { color: var(--c-danger); }
.tqv-sale-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: #fef2f2;
    color: var(--c-danger);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.tqv-desc { font-size: 13px; color: var(--c-text-muted); line-height: 1.55; margin-bottom: 14px; flex: 1; }

.tqv-variants { margin-bottom: 14px; }
.tqv-variants__group { margin-bottom: 10px; }
.tqv-variants__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
    display: block;
}
.tqv-variants__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tqv-chip {
    padding: 5px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
}
.tqv-chip:hover { border-color: var(--c-secondary); }
.tqv-chip.is-active { border-color: var(--c-secondary); background: var(--c-secondary); color: #fff; }
.tqv-chip input { display: none; }

/* QV — actions area */
.tqv-atc {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.tqv-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}
.tqv-qty__btn {
    width: 32px;
    height: 38px;
    border: none;
    background: #f9f9f9;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.tqv-qty__btn:hover { background: #e5e7eb; }
.tqv-qty__input {
    width: 42px;
    height: 38px;
    border: none;
    border-left: 1.5px solid var(--c-border);
    border-right: 1.5px solid var(--c-border);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    background: #fff;
}

.tqv-atc-form { flex: 1; }
.tqv-atc-btn {
    width: 100%;
    padding: 11px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tqv-atc-btn:hover { opacity: .9; transform: translateY(-1px); }
.tqv-atc-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* QV — comprar ahora */
.tqv-buynow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #8A2BE2 0%, #6a1fa0 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .15s;
    margin-top: 6px;
}
.tqv-buynow-btn:hover { opacity: .9; transform: translateY(-1px); }

.tqv-detail-link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.tqv-detail-link:hover { color: var(--c-secondary); }

/* ── Filters overlay (mobile) ─────────────────────────────── */
.tienda-filters-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 800;
}
.tienda-filters-overlay.is-open { display: block; }

/* ═══════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .tienda-layout {
        grid-template-columns: 230px 1fr;
        grid-template-areas:
            "filters main"
            "filters minicart";
    }
    .tienda-filters  { grid-area: filters; }
    .tienda-main     { grid-area: main; }
    .tienda-minicart { grid-area: minicart; position: static; max-height: none; }
    .tienda-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .tienda-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "minicart";
    }
    .tienda-filters {
        position: fixed;
        top: 0;
        left: -290px;
        width: 290px;
        height: 100vh;
        max-height: 100vh;
        z-index: 900;
        border-radius: 0;
        transition: left .3s;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .tienda-filters.is-open { left: 0; }
    .tienda-filters__close { display: flex; }
    .tienda-filters-toggle { display: flex; }
    .tienda-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .tienda-grid { grid-template-columns: 1fr; }
    .tqv-inner { grid-template-columns: 1fr; }
    .tqv-info { border-left: none; border-top: 1px solid #f3f4f6; padding: 16px; }
    .tqv-gallery { padding: 16px; }
    .tienda-back-widget { bottom: 80px; left: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   Comparador de productos
═══════════════════════════════════════════════════════════ */
.btn-tc--compare{background:#f3f0ff;color:#7c3aed;border:1.5px solid #ddd6fe;flex-shrink:0;width:32px;height:32px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background .15s,border-color .15s}
.btn-tc--compare:hover{background:#ede9fe;border-color:#c4b5fd}
.btn-tc--compare.is-added{background:#7c3aed;color:#fff;border-color:#7c3aed}
.btn-tc--compare.is-added svg{stroke:#fff}

#snl-compare-bar{position:fixed;bottom:0;left:0;right:0;z-index:7999;background:#1e1440;color:#fff;padding:10px 16px;display:flex;align-items:center;gap:12px;transform:translateY(100%);transition:transform .3s cubic-bezier(.34,1.56,.64,1);box-shadow:0 -4px 24px rgba(0,0,0,.2)}
#snl-compare-bar.is-open{transform:translateY(0)}
.snl-cb__title{font-size:13px;font-weight:700;white-space:nowrap}
.snl-cb__slots{display:flex;gap:8px;flex:1;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;align-items:center;min-height:44px}
.snl-cb__slots::-webkit-scrollbar{display:none}
.snl-cb__slot{width:40px;height:40px;border-radius:6px;border:2px dashed rgba(255,255,255,.3);flex-shrink:0;position:relative;display:flex;align-items:center;justify-content:center;font-size:10px;color:rgba(255,255,255,.4)}
.snl-cb__slot.has-item{border-style:solid;border-color:rgba(255,255,255,.5);overflow:hidden;padding:0}
.snl-cb__slot img{width:100%;height:100%;object-fit:cover}
.snl-cb__slot__x{position:absolute;top:-4px;right:-4px;width:16px;height:16px;background:#ef4444;color:#fff;border-radius:50%;font-size:10px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;z-index:2;padding:0}
.snl-cb__actions{display:flex;gap:8px;flex-shrink:0}
.snl-cb__btn-compare{background:#FF9A00;color:#fff;border:none;border-radius:8px;padding:9px 16px;font-size:13px;font-weight:700;cursor:pointer;transition:opacity .15s}
.snl-cb__btn-compare:hover{opacity:.9}
.snl-cb__btn-compare:disabled{background:#555;cursor:not-allowed;opacity:1}
.snl-cb__btn-clear{background:rgba(255,255,255,.1);color:#fff;border:1px solid rgba(255,255,255,.2);border-radius:8px;padding:9px 12px;font-size:12px;cursor:pointer;transition:opacity .15s}
.snl-cb__btn-clear:hover{opacity:.8}
