/* ============================================================
   Roger Tienda Virtual — v0.8.0 CSS
   Relacionados · Variantes · Galería mejorada
   ============================================================ */

/* ═══════════════════════════════════════════════════════════
   PRODUCTOS RELACIONADOS
═══════════════════════════════════════════════════════════ */
.rtv-related-section {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--rtv-border, #e0e2e8);
}
.rtv-related-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.rtv-related-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--rtv-text, #1d2327);
    white-space: nowrap;
    margin: 0;
}
.rtv-related-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--rtv-neon, #00AAFF), transparent);
    border-radius: 2px;
}
.rtv-related-grid .rtv-product-card {
    transition: transform .22s ease, box-shadow .22s ease;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCTO VARIABLE — Selectores de variante
═══════════════════════════════════════════════════════════ */
.rtv-variations-wrap {
    margin: 16px 0;
}
.rtv-attr-group {
    margin-bottom: 16px;
}
.rtv-attr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rtv-text, #1d2327);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rtv-attr-selected {
    font-size: 12px;
    font-weight: 400;
    color: var(--rtv-muted, #646970);
}

/* Botones de atributo */
.rtv-attr-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rtv-attr-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--rtv-border, #e0e2e8);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: var(--rtv-text, #1d2327);
    transition: all .15s ease;
    font-family: inherit;
    position: relative;
}
.rtv-attr-btn:hover {
    border-color: var(--rtv-primary, #2271b1);
    color: var(--rtv-primary, #2271b1);
}
.rtv-attr-btn.active {
    background: var(--rtv-primary, #1d2327);
    border-color: var(--rtv-primary, #1d2327);
    color: #fff;
}
.rtv-attr-btn.unavailable {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Selector de color (cuadrado de color) */
.rtv-attr-btn.is-color {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border-width: 2px;
}
.rtv-attr-btn.is-color.active {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--rtv-primary, #1d2327);
    background: inherit;
}

/* Precio de la variante seleccionada */
.rtv-variation-price-wrap {
    padding: 14px 16px;
    background: var(--rtv-gray-50, #f8f9fa);
    border: 1px solid var(--rtv-border, #e0e2e8);
    border-radius: 10px;
    margin-bottom: 16px;
    min-height: 60px;
    transition: all .2s ease;
}
.rtv-variation-price-wrap.rtv-updating {
    opacity: .5;
}
.rtv-variation-sku {
    font-size: 12px;
    color: var(--rtv-muted, #646970);
    margin-top: 4px;
}
.rtv-variation-stock {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

/* Mensaje sin variante seleccionada */
.rtv-variation-hint {
    font-size: 13px;
    color: var(--rtv-muted, #646970);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   GALERÍA MEJORADA — Zoom y Lightbox
═══════════════════════════════════════════════════════════ */

/* Zoom en imagen principal */
.rtv-main-image {
    cursor: zoom-in;
    overflow: hidden;
}
.rtv-main-image .rtv-main-img {
    transition: transform .4s ease, opacity .15s ease;
    transform-origin: center center;
}
.rtv-main-image:hover .rtv-main-img {
    transform: scale(1.06) !important;
}

/* Indicador de zoom */
.rtv-zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.rtv-main-image:hover .rtv-zoom-hint {
    opacity: 1;
}

/* ── LIGHTBOX ── */
.rtv-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: rtv-lb-in .2s ease;
}

@keyframes rtv-lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.rtv-lb-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtv-lb-img {
    max-width: 88vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    animation: rtv-img-in .25s ease;
}
@keyframes rtv-img-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Botón cerrar */
.rtv-lb-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    z-index: 100000;
}
.rtv-lb-close:hover { background: rgba(255,255,255,.2); }

/* Botones navegación */
.rtv-lb-prev,
.rtv-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    z-index: 100000;
}
.rtv-lb-prev { left: 16px; }
.rtv-lb-next { right: 16px; }
.rtv-lb-prev:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.05); }
.rtv-lb-next:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.05); }

/* Contador e info */
.rtv-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: 13px;
    background: rgba(0,0,0,.4);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 100000;
}

/* Thumbnails en el lightbox */
.rtv-lb-thumbs {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100000;
    max-width: 90vw;
    overflow-x: auto;
    padding: 4px;
}
.rtv-lb-thumb {
    width: 54px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .6;
    transition: opacity .15s, border-color .15s;
    flex-shrink: 0;
}
.rtv-lb-thumb:hover { opacity: .85; }
.rtv-lb-thumb.active { opacity: 1; border-color: #fff; }

@media (max-width: 480px) {
    .rtv-lb-prev { left: 8px; }
    .rtv-lb-next { right: 8px; }
    .rtv-lb-thumbs { display: none; }
}
