.custom-variation-form {
    width: 100%;
    box-sizing: border-box;
}

/* Cabecera: "Selecciona una talla" + Guía de tallas */
.cvf-attribute-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
}

.cvf-attribute-label {
    font-size: 13px;
    color: #333;
    margin: 0;
}

.cvf-size-guide-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    color: #333 !important;
    font-size: 13px !important;
    cursor: pointer;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.cvf-size-guide-btn:hover,
.cvf-size-guide-btn:focus,
.cvf-size-guide-btn:active {
    background: none !important;
    color: #000 !important;
}

.cvf-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.cvf-swatch {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: pointer;
    outline: none !important;
}

/* Botones de texto (Talla) estilo pastilla */
.cvf-swatch--text {
    flex: 0 0 auto !important;
    min-width: 50px !important;
    padding: 8px 14px !important;
    border: none !important;
    border-radius: 30px !important;
    background-color: #f5f5f5 !important;
    color: #333 !important;
    font-size: 13px !important;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
}

.cvf-swatch--text:hover,
.cvf-swatch--text:focus,
.cvf-swatch--text:active {
    background-color: #f5f5f5 !important;
    color: #333 !important;
}

.cvf-swatch--text.active {
    background-color: #000 !important;
    color: #fff !important;
}

.cvf-swatch--text.active:hover,
.cvf-swatch--text.active:focus,
.cvf-swatch--text.active:active {
    background-color: #000 !important;
    color: #fff !important;
}

/* Sin stock: visible, clickeable, pero tachado y opaco */
.cvf-swatch--text.no-stock {
    opacity: 0.45 !important;
    background: #f5f5f5 !important;
    color: #333 !important;
}

.cvf-swatch--text.no-stock::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 8%;
    width: 84%;
    height: 2px;
    background: #999;
    transform: rotate(-20deg);
    pointer-events: none;
}

.cvf-swatch--text.no-stock.active {
    background: #f5f5f5 !important;
    color: #333 !important;
}

/* Color (círculos) */
.cvf-swatch--color {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 0 1px #ccc !important;
    position: relative;
}

.cvf-swatch--color.active {
    box-shadow: 0 0 0 2px #0e0d0d !important;
}

.cvf-swatch--color.no-stock {
    opacity: 0.45 !important;
}

.cvf-swatch--color.no-stock::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: #999;
    transform: rotate(-20deg) translateY(-50%);
    pointer-events: none;
}

/* Descripción del modelo */
.cvf-model-info {
    font-size: 13px;
    color: #5073EE;
    margin: -4px 0 12px;
}

.cvf-model-info p {
    margin: 0 0 4px;
}

.cvf-stock-status {
    font-size: 13px;
    min-height: 18px;
    margin: 0 0 12px;
}

.cvf-stock-status .stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.cvf-stock-status .stock::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 15px;
    background-size: contain;
    flex-shrink: 0;
}

.cvf-stock-status .stock.in-stock::before {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15'><circle cx='7.5' cy='7.5' r='7.5' fill='rgba(0,128,0,0.3)'/><circle cx='7.5' cy='7.5' r='5' stroke='white' stroke-width='1' fill='rgb(0,128,0)'/></svg>") no-repeat center;
}

.cvf-stock-status .stock.low-stock::before {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15'><circle cx='7.5' cy='7.5' r='7.5' fill='rgba(238,148,65,0.3)'/><circle cx='7.5' cy='7.5' r='5' stroke='white' stroke-width='1' fill='rgb(238,148,65)'/></svg>") no-repeat center;
}

.cvf-stock-status .stock.out-of-stock::before {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15'><circle cx='7.5' cy='7.5' r='7.5' fill='rgba(255,0,0,0.3)'/><circle cx='7.5' cy='7.5' r='5' stroke='white' stroke-width='1' fill='rgb(255,0,0)'/></svg>") no-repeat center;
}

.cvf-add-to-cart-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    width: 100% !important;
    display: block;
    padding: 14px;
    background: #17b6b6 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    outline: none !important;
}

.cvf-add-to-cart-btn:hover,
.cvf-add-to-cart-btn:focus,
.cvf-add-to-cart-btn:active {
    background: #17b6b6 !important;
    color: #fff !important;
    width: 100% !important;
}

.cvf-add-to-cart-btn:disabled {
    background: #eeeeee !important;
    color: #aaaaaa !important;
    cursor: not-allowed;
    width: 100% !important;
}

/* ===============================
   Modal guía de tallas
================================ */
.rvx-sg-modal {
    width: min(94vw, 960px) !important;
    max-width: 94vw !important;
    max-height: 92vh !important;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: #fff;
    color: #202020;
    overflow: hidden;
}

.rvx-sg-modal[open] {
    display: flex;
    flex-direction: column;
}

.rvx-sg-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.rvx-sg-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.rvx-sg-modal__head h2 {
    margin: 0;
    font-size: 18px;
}

.rvx-sg-modal__close {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: none !important;
    border: none !important;
    padding: 6px !important;
    color: #333 !important;
    cursor: pointer;
}

.rvx-sg-modal__body {
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

/* La imagen ocupa todo el ancho disponible del modal */
.rvx-sg-modal .rvx-sg-img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0;
}

/* Si la guía es texto/HTML, mantener espacio interno */
.rvx-sg-modal__body > p,
.rvx-sg-modal__body > table {
    margin: 16px 24px;
}

@media (max-width: 600px) {
    /* Bottom sheet casi a pantalla completa en móvil */
    .rvx-sg-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
    }

    .rvx-sg-modal__head {
        padding: 14px 16px;
    }

    /* La tabla de tallas tiene letra muy pequeña: en móvil la imagen
       se muestra más ancha y se desplaza horizontalmente para poder leerla */
    .rvx-sg-modal .rvx-sg-img {
        width: 170% !important;
        max-width: none !important;
    }
}


/* ===============================
   Animaciones premium del modal
================================ */

/* Entrada (escritorio): fade + escala suave */
.rvx-sg-modal[open] {
    animation: rvx-sg-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.rvx-sg-modal[open]::backdrop {
    animation: rvx-sg-fade-in 0.3s ease backwards;
}

/* Salida: la clase la pone el JS antes de cerrar */
.rvx-sg-modal.is-closing {
    animation: rvx-sg-out 0.26s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.rvx-sg-modal.is-closing::backdrop {
    animation: rvx-sg-fade-out 0.26s ease forwards;
}

/* Fondo con desenfoque */
.rvx-sg-modal::backdrop {
    background: rgba(10, 10, 10, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

@keyframes rvx-sg-in {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

@keyframes rvx-sg-out {
    to { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes rvx-sg-fade-in {
    from { opacity: 0; }
}

@keyframes rvx-sg-fade-out {
    to { opacity: 0; }
}

/* Mientras el dedo arrastra, sin animaciones que interfieran */
.rvx-sg-modal.is-dragging {
    animation: none !important;
    transition: none !important;
}

.rvx-sg-modal.is-snapping {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* El área de la cabecera es la zona de arrastre */
.rvx-sg-modal__head {
    position: relative;
    touch-action: none;
}

@media (max-width: 600px) {

    /* Entrada/salida móvil: sube desde abajo */
    .rvx-sg-modal[open] {
        animation: rvx-sg-in-m 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }

    .rvx-sg-modal.is-closing {
        animation: rvx-sg-out-m 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
    }

    @keyframes rvx-sg-in-m {
        from { transform: translateY(100%); }
    }

    @keyframes rvx-sg-out-m {
        to { transform: translateY(100%); }
    }

    /* Barrita de agarre */
    .rvx-sg-modal__head {
        padding-top: 26px;
    }

    .rvx-sg-modal__head::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 4px;
        background: #d9d9d9;
    }
}

/* Accesibilidad: sin movimiento si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
    .rvx-sg-modal[open],
    .rvx-sg-modal[open]::backdrop,
    .rvx-sg-modal.is-closing,
    .rvx-sg-modal.is-closing::backdrop {
        animation-duration: 0.01s !important;
    }
}