.bydv2-configurator,
.bydv2-configurator * {
    box-sizing: border-box;
}

.bydv2-configurator {
    --bydv2-rines-bg: #C4C4C4;
    --bydv2-desktop-fit: cover;
    --bydv2-mobile-fit: cover;
    --bydv2-exterior-controls-top: 57%;
    --bydv2-interior-controls-top: 70%;
    --bydv2-rines-controls-top: 64%;
    --bydv2-text: #171717;
    --bydv2-muted: rgba(23, 23, 23, .42);
    --bydv2-tabs-bg: rgba(235, 235, 235, .82);
    position: relative;
    width: 100%;
    max-width: none;
    min-height: clamp(500px, 51.5vw, 790px);
    margin: 0;
    overflow: hidden;
    background: #C4C4C4;
    color: var(--bydv2-text);
    font-family: Arial, Helvetica, sans-serif;
    isolation: isolate;
}

.bydv2-panel {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    min-height: inherit;
    overflow: hidden;
}

.bydv2-panel.is-active {
    display: block;
}

.byd-v2-panel--rines {
    background: var(--bydv2-rines-bg);
}

.byd-v2-panel--exterior {
    background: #C4C4C4;
}

.byd-v2-panel--interior {
    background: #fff;
}

.bydv2-visual {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: inherit;
}

/* Se fuerza el tamaño para evitar que el tema de WordPress deje la imagen pequeña. */
.bydv2-configurator .bydv2-main-image {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: var(--bydv2-desktop-fit) !important;
    object-position: center center !important;
    opacity: 1;
    transition: opacity .18s ease, transform .32s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.bydv2-main-image.is-changing {
    opacity: 0;
    transform: scale(1.006);
}

.bydv2-no-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: rgba(0, 0, 0, .45);
    font-size: 14px;
}

.bydv2-title {
    position: absolute;
    z-index: 4;
    top: clamp(20px, 3.2vw, 42px);
    left: 50%;
    width: min(90%, 840px);
    margin: 0;
    transform: translateX(-50%);
    color: var(--bydv2-text);
    font-size: clamp(24px, 2.25vw, 38px);
    line-height: 1.02;
    font-weight: 400;
    letter-spacing: -.02em;
    text-align: center;
}

.bydv2-controls {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: clamp(13px, 2vw, 26px);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(94%, 620px);
    transform: translateX(-50%);
    text-align: center;
}

.bydv2-product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 0 8px;
}

.bydv2-price-line {
    min-height: 17px;
    margin: 0 0 8px;
    color: var(--bydv2-text);
    font-size: clamp(10px, .85vw, 13px);
    line-height: 1.2;
    font-weight: 700;
}

.bydv2-price-prefix {
    margin-right: 3px;
}

.bydv2-price-suffix {
    margin-left: 0;
    white-space: nowrap;
}

.bydv2-version-options {
    display: grid;
    grid-template-columns: repeat(var(--bydv2-version-count), minmax(58px, 1fr));
    width: min(100%, calc(var(--bydv2-version-count) * 76px));
    min-height: 26px;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(238, 238, 238, .92);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .025);
}

.bydv2-version-options.is-single {
    width: 76px;
}

.bydv2-version {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    height: 26px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(40, 40, 40, .36);
    font-family: inherit;
    font-size: clamp(9px, .73vw, 11px);
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.bydv2-version.is-active {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.bydv2-sku-line {
    min-height: 12px;
    margin-top: 5px;
    color: rgba(18, 18, 18, .48);
    font-size: clamp(8px, .61vw, 9px);
    line-height: 1.2;
}

.bydv2-selected-label {
    margin: 0 0 8px;
    color: var(--bydv2-text);
    font-size: 14px;
    font-family:"Roboto";
    line-height: 1.2;
    font-weight: 400;
}

.bydv2-color-options,
.bydv2-rim-options {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    margin: 0 0 10px;
    padding: 6px 13px;
    gap: 6px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .18);
}

.bydv2-option {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.byd-v2-option--color {
    width: 26px;
    height: 26px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--bydv2-swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .10);
    transition: transform .18s ease, box-shadow .18s ease;
}

.byd-v2-option--color.has-image {
    background-color: #fff;
    background-image: var(--bydv2-swatch-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.byd-v2-option--color:hover,
.byd-v2-option--color:focus-visible {
    transform: scale(1.06);
}

.byd-v2-option--color.is-active {
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, .10),
        0 0 0 2px #fff,
        0 0 0 3px rgba(0, 0, 0, .16);
}

.bydv2-rim-options {
    min-height: 46px;
    padding: 4px 9px;
}

.byd-v2-option--rim {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: transform .18s ease;
}

.byd-v2-option--rim:hover,
.byd-v2-option--rim:focus-visible,
.byd-v2-option--rim.is-active {
    transform: scale(1.04);
}

.byd-v2-option--rim img {
    display: block !important;
    width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
}

.bydv2-rim-placeholder {
    width: 28px;
    height: 28px;
    border: 2px solid #404040;
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, transparent 0 12deg, #3f3f3f 13deg 16deg),
        radial-gradient(circle, #fff 0 20%, #4a4a4a 21% 28%, transparent 29% 100%);
}

.bydv2-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: clamp(245px, 26vw, 310px);
    min-height: 32px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .04);
    border-radius: 9px;
    background: var(--bydv2-tabs-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.bydv2-tab {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    height: 32px;
    margin: 0;
    padding: 0 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font-size: 16px;
    font-weight: 400;
    font-family: 'Montserrat';
    line-height: 1;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.bydv2-tab.is-active {
    background: #fff;
    color: #242424 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.bydv2-tab:disabled {
    cursor: default;
    opacity: .36;
}

.bydv2-tab:focus-visible,
.bydv2-option:focus-visible,
.bydv2-version:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.bydv2-note {
    width: 100%;
    margin: 8px 0 0;
    color: var(--bydv2-muted);
    font-size: 14px;
    font-family:"Roboto";
    line-height: 1.25;
    font-weight: 400;
    text-align: center;
}

.bydv2-admin-message {
    padding: 14px;
    border: 1px dashed #bbb;
    background: #fafafa;
    color: #555;
    font-size: 13px;
    text-align: center;
}

.bydv2-configurator [hidden] {
    display: none !important;
}

@media (min-width: 768px) {
    /* La información se posiciona desde arriba y no desde el borde inferior.
       Así conserva la misma separación con el auto en monitores de distinta altura. */
    .byd-v2-panel--exterior .bydv2-controls {
        top: var(--bydv2-exterior-controls-top);
        bottom: auto;
    }

    .byd-v2-panel--interior .bydv2-controls {
        top: var(--bydv2-interior-controls-top);
        bottom: auto;
    }

    .byd-v2-panel--rines .bydv2-controls {
        top: var(--bydv2-rines-controls-top);
        bottom: auto;
    }

    .byd-v2-panel--interior .bydv2-selected-label,
    .byd-v2-panel--interior .bydv2-price-line,
    .byd-v2-panel--interior .bydv2-sku-line {
        color: #fff;
        font-family: 'Roboto';
        font-weight: 400;
        font-size: 16px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
    }

    .byd-v2-panel--interior .bydv2-tabs,
    .byd-v2-panel--interior .bydv2-version-options {
        background: rgba(222, 222, 222, .82);
    }

    .byd-v2-panel--interior .bydv2-note {
        color: rgba(255, 255, 255, .74);
        text-shadow: 0 1px 2px rgba(0, 0, 0, .38);
    }
}

@media (max-width: 767px) {
    /*
     * En móvil no usamos un scroll interno. El panel participa en el flujo
     * normal de la página para que el gesto vertical continúe desplazando
     * WordPress aunque el dedo empiece sobre la imagen o los controles.
     */
    .bydv2-configurator {
        height: auto !important;
        min-height: 0;
        overflow: visible;
        background: #fff;
        touch-action: pan-y pinch-zoom;
        overscroll-behavior-y: auto;
    }

    .bydv2-panel {
        position: relative;
        inset: auto;
        height: auto;
        min-height: 0;
        overflow: visible;
        touch-action: pan-y pinch-zoom;
    }

    .bydv2-panel.is-active {
        display: grid;
        grid-template-rows: minmax(300px, 58svh) minmax(248px, auto);
        align-content: stretch;
        overflow: visible;
        overscroll-behavior: auto;
        -webkit-overflow-scrolling: auto;
    }

    .bydv2-tab,
    .bydv2-option,
    .bydv2-version {
        touch-action: manipulation;
    }

    .byd-v2-panel--rines.is-active,
    .byd-v2-panel--exterior.is-active {
        background: var(--bydv2-rines-bg);
    }

    .byd-v2-panel--interior.is-active {
        background: #fff;
    }

    .bydv2-visual {
        position: relative;
        inset: auto;
        grid-row: 1;
        width: 100%;
        height: 100%;
    }

    .bydv2-configurator .bydv2-main-image {
        object-fit: var(--bydv2-mobile-fit) !important;
        object-position: center center !important;
    }

    .bydv2-title {
        z-index: 5;
        top: 28px;
        width: 90%;
        font-size: clamp(19px, 7vw, 24px);
        line-height: 1.05;
    }

    .bydv2-controls {
        position: relative;
        z-index: 5;
        left: auto;
        top: auto;
        bottom: auto;
        grid-row: 2;
        justify-content: flex-start;
        width: 100%;
        min-height: 100%;
        padding: 18px 10px 26px;
        transform: none;
        background: #fff;
    }

    .byd-v2-panel--rines .bydv2-controls,
    .byd-v2-panel--exterior .bydv2-controls {
        background: transparent;
    }

    .bydv2-product-info {
        margin-bottom: 10px;
    }

    .bydv2-price-line {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .bydv2-version-options {
        min-height: 28px;
        width: min(100%, calc(var(--bydv2-version-count) * 76px));
        font-size:16px;
    }

    .bydv2-version {
        height: 28px;
        font-size: 16px;
    }

    .bydv2-sku-line {
        margin-top: 5px;
        font-size: 9px;
    }

    .bydv2-selected-label {
        margin-bottom: 17px;
        font-size: 11px;
    }

    .bydv2-color-options,
    .bydv2-rim-options {
        min-height: 46px;
        margin-bottom: 12px;
        padding: 7px 14px;
        gap: 7px;
    }

    .byd-v2-option--color {
        width: 27px;
        height: 27px;
    }

    .bydv2-rim-options {
        padding: 4px 10px;
    }

    .byd-v2-option--rim {
        width: 39px;
        height: 39px;
    }

    .byd-v2-option--rim img {
        width: 33px !important;
        max-width: 33px !important;
        height: 33px !important;
        max-height: 33px !important;
    }

    .bydv2-tabs {
        order: 3;
        width: 100%;
        min-height: 38px;
        margin-top: 0;
        border-color: rgba(0, 0, 0, .06);
        border-radius: 10px;
        background: #d8d8d8;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .bydv2-tab {
        height: 38px;
        border-radius: 9px;
        color: rgba(255, 255, 255, .76) !important;
        font-size: 12px;
    }

    .bydv2-tab.is-active {
        color: #343434 !important;
    }

    .bydv2-note {
        order: 4;
        margin-top: 20px;
        padding: 0 5px;
        color: rgba(16, 16, 16, .38) !important;
        text-shadow: none !important;
        font-size: 10px;
        line-height: 1.35;
    }
}

@media (max-width: 380px) {
    .bydv2-panel.is-active {
        grid-template-rows: minmax(285px, 56svh) minmax(255px, auto);
    }

    .bydv2-controls {
        padding-left: 10px;
        padding-right: 10px;
    }

    .bydv2-title {
        top: 25px;
        font-size: 19px;
    }
}
