/* =============================================================
   GVD — Custom Select Dropdown per variazioni WooCommerce
   Colori tema: bordeaux #961d2e / #8b1a2a
   ============================================================= */

/* Nascondi il select nativo (già fatto via JS, doppia sicurezza) */
.single-product table.variations select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
}

/* ── Wrapper ── */
.gvd-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    font-family: inherit;
}

/* ── Trigger (la "testa" visibile del select) ── */
.gvd-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
    outline: none;
    gap: 12px;
}

.gvd-select-trigger::after {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23961d2e' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform .2s ease;
}

.gvd-select-trigger.is-placeholder {
    color: #aaa;
    font-weight: 400;
}

.gvd-select-wrapper:hover .gvd-select-trigger,
.gvd-select-wrapper.is-open .gvd-select-trigger {
    border-color: #961d2e;
}

.gvd-select-wrapper.is-open .gvd-select-trigger {
    box-shadow: 0 0 0 3px rgba(150,29,46,.1);
    border-radius: 10px 10px 0 0;
}

.gvd-select-wrapper.is-open .gvd-select-trigger::after {
    transform: rotate(180deg);
}

/* ── Dropdown panel ── */
.gvd-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 2px solid #961d2e;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gvd-select-wrapper.is-open .gvd-select-dropdown {
    display: block;
    animation: gvdFadeIn .15s ease;
}

/* Apertura verso l'alto */
.gvd-select-wrapper.opens-up .gvd-select-dropdown {
    top: auto;
    bottom: calc(100% - 2px);
    border-top: 2px solid #961d2e;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.gvd-select-wrapper.opens-up .gvd-select-trigger {
    border-radius: 0 0 10px 10px;
}

@keyframes gvdFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Singola opzione ── */
.gvd-select-option {
    padding: 11px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    border-bottom: 1px solid #f5f0f0;
}

.gvd-select-option:last-child {
    border-bottom: none;
}

.gvd-select-option:hover {
    background: #fdf5f6;
    color: #961d2e;
}

.gvd-select-option.is-selected {
    background: #961d2e;
    color: #fff;
    font-weight: 700;
}

.gvd-select-option.is-selected:hover {
    background: #7a1624;
    color: #fff;
}


/* Fix: azzera margin da bdt-uikit sul trigger */
.gvd-select-trigger {
    margin: 0 !important;
}

/* Fix: niente outline/border arancione da browser o plugin */
.gvd-select-wrapper,
.gvd-select-trigger,
.gvd-select-dropdown {
    outline: none !important;
    box-sizing: border-box !important;
}

/* Fix margin bdt-uikit sul wrapper */
.single-product .gvd-select-wrapper {
    margin: 0 !important;
}
