/* =========================================================
   Shoppable Look – imagen con hotspots y popup de producto
   ========================================================= */

   .shoppable-look {
    --shoppable-sale-color: #e8590c;   /* color del precio con descuento */
    --shoppable-old-price-color: #888; /* color del precio tachado */
}

.shoppable-look__image-wrap {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: visible;
}

.shoppable-look__image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* ---------- Hotspot ---------- */

button[type="button"].shoppable-hotspot {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-sizing: border-box !important;
    position: absolute !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    background-color: rgba(0, 0, 0, .85) !important;
    border: 2px solid #fff !important;
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transform: translate(-50%, -50%) !important;
    z-index: 5 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .25s ease !important;
}

/* Ondas detrás del botón */
button[type="button"].shoppable-hotspot::before,
button[type="button"].shoppable-hotspot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .75);
    animation: shoppable-ripple 1.8s ease-out infinite;
    pointer-events: none;
}

button[type="button"].shoppable-hotspot::after {
    animation-delay: .9s;
}

@keyframes shoppable-ripple {
    0%   { transform: scale(1);   opacity: .7; }
    100% { transform: scale(2.3); opacity: 0;  }
}

@media (prefers-reduced-motion: reduce) {
    button[type="button"].shoppable-hotspot::before,
    button[type="button"].shoppable-hotspot::after {
        animation: none;
    }
}

button[type="button"].shoppable-hotspot:hover,
button[type="button"].shoppable-hotspot:focus,
button[type="button"].shoppable-hotspot:active {
    background-color: rgba(0, 0, 0, .85) !important;
    border: 2px solid #fff !important;
    color: #fff !important;
    outline: none !important;
}

/* Accesibilidad: foco visible solo con teclado */
button[type="button"].shoppable-hotspot:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 5px rgba(0, 0, 0, .9) !important;
}

/* Activo: el "+" se convierte en "X" rotando el botón */
button[type="button"].shoppable-hotspot.is-active {
    transform: translate(-50%, -50%) rotate(45deg) !important;
}

/* ---------- Popup ---------- */

.shoppable-popup {
    position: absolute;
    z-index: 20;
    box-sizing: border-box;
    width: 260px;
    max-width: calc(100% - 16px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.shoppable-popup--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Puente invisible: evita que el popup se cierre al mover el cursor
   desde el hotspot hacia el popup (escritorio, apertura por hover). */
.shoppable-popup::before {
    content: '';
    position: absolute;
    inset: -14px;
    z-index: -1;
}

.shoppable-popup__body {
    display: grid;
    grid-template-columns: minmax(64px, 92px) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 8px;
    align-items: start;
    padding: 12px;
}

.shoppable-popup__body--no-media {
    grid-template-columns: minmax(0, 1fr);
}

/* Contenedor de la imagen: proporción fija, sin recortes ni deformación */
.shoppable-popup .shoppable-popup__media {
    grid-column: 1;
    grid-row: 1;
    width: 64px;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #f5f5f5;
    overflow: hidden;
}

.shoppable-popup .shoppable-popup__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    margin: 0;
    border-radius: 0;
}

/* Selector de variación: justo debajo de la imagen */
.shoppable-popup__variation {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.shoppable-popup .shoppable-popup__select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: auto;
    margin: 0;
    padding: 6px 4px 6px 8px;
    font-size: 12px;
    line-height: 1.2;
    color: #111;
    background-color: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    text-overflow: ellipsis;
    cursor: pointer;
}

.shoppable-popup .shoppable-popup__select:focus-visible {
    outline: 2px solid #5073ee;
    outline-offset: 1px;
}

.shoppable-popup .shoppable-popup__select[aria-invalid="true"] {
    border-color: #d63638;
}

.shoppable-popup .shoppable-popup__error {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.2;
    color: #d63638;
}

.shoppable-popup .shoppable-popup__error[hidden] {
    display: none;
}

.shoppable-popup__info {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;            /* permite que el texto largo se ajuste */
}

.shoppable-popup__body--no-media .shoppable-popup__info {
    grid-column: 1;
}

.shoppable-popup .shoppable-popup__name {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Precio: normal o con descuento (tachado + precio actual) */
.shoppable-popup .shoppable-popup__price {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.3;
    color: #333;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
}

.shoppable-popup .shoppable-popup__price del {
    color: var(--shoppable-old-price-color, #888);
    text-decoration: line-through;
}

.shoppable-popup .shoppable-popup__price ins {
    color: var(--shoppable-sale-color, #e8590c);
    font-weight: 600;
    text-decoration: none;
    background: none;
}

.shoppable-popup .shoppable-popup__cta {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    text-align: center;
    background: #0e0d0d !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none !important;
    padding: 8px 0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
}

.shoppable-popup .shoppable-popup__cta:hover,
.shoppable-popup .shoppable-popup__cta:focus,
.shoppable-popup .shoppable-popup__cta:active {
    background: #0e0d0d !important;
    color: #fff !important;
}

.shoppable-popup .shoppable-popup__cta:focus-visible {
    outline: 2px solid #5073ee;
    outline-offset: 2px;
}

/* Agotado o agregando al carrito */
.shoppable-popup .shoppable-popup__cta:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- Móvil ---------- */

@media (max-width: 480px) {
    .shoppable-popup {
        width: 240px;
    }

    .shoppable-popup__body {
        grid-template-columns: minmax(56px, 84px) minmax(0, 1fr);
        column-gap: 10px;
    }

    .shoppable-popup .shoppable-popup__media {
        width: 56px;
    }
}