/* ============================================================
   Recommendation blocks — APTonerVS
   ============================================================ */

/* Skeleton shimmer animation */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.rec-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
}

/* ── Block container ───────────────────────────────────────── */
.rec-block {
    margin: 2rem 0;
    container-type: inline-size;
}

.rec-block--empty {
    display: flex;
    justify-content: center;
}

/* ── Header ────────────────────────────────────────────────── */
.rec-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rec-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.rec-source-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.rec-source-badge--cache    { background: #d1fae5; color: #065f46; }
.rec-source-badge--database { background: #dbeafe; color: #1e40af; }

/* ── Horizontal strip ──────────────────────────────────────── */
.rec-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .rec-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .rec-strip {
        grid-template-columns: repeat(6, 1fr);
        overflow-x: visible;
    }
}

/* ── Card ──────────────────────────────────────────────────── */
.rec-card-mini {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    scroll-snap-align: start;
    transition: box-shadow 0.2s, transform 0.2s;
}

.rec-card-mini:hover:not(.rec-card-mini--sinstock) {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

.rec-card-mini--sinstock {
    opacity: 0.65;
}

/* ── Card link ─────────────────────────────────────────────── */
.rec-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.rec-card-link--disabled {
    cursor: default;
    pointer-events: none;
}

/* ── Image wrap ────────────────────────────────────────────── */
.rec-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 */
    overflow: hidden;
    background: #f9fafb;
}

.rec-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.rec-img-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 2rem;
}

/* ── Card info ─────────────────────────────────────────────── */
.rec-info {
    padding: 0.6rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.rec-nombre {
    font-size: 0.78rem;
    font-weight: 500;
    color: #111827;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.rec-precio {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-top: auto;
}

/* ── Offer badge ───────────────────────────────────────────── */
.rec-badge-oferta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

/* ── Out-of-stock overlay ──────────────────────────────────── */
.rec-overlay-sinstock {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.rec-overlay-sinstock span {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Empty state ───────────────────────────────────────────── */
.rec-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.rec-empty-state i {
    font-size: 2rem;
}
