.ydp-pills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 4px 0;
    --ydp-color: #3FC1B7;
}

.ydp-pill {
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--ydp-color);
    color: var(--ydp-color);
    background: #fff;
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    font-family: inherit;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
    min-width: 0;
    width: 100%;
    text-align: center;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.ydp-pill__duration,
.ydp-pill__price {
    display: inline-block;
}

.ydp-pill__price {
    opacity: 0.85;
    font-size: 0.92em;
}

@keyframes ydp-shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20%      { transform: translate3d(-8px, 0, 0); }
    40%      { transform: translate3d(8px, 0, 0); }
    60%      { transform: translate3d(-5px, 0, 0); }
    80%      { transform: translate3d(5px, 0, 0); }
}

.ydp-pills.ydp-shake {
    animation: ydp-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.ydp-pills.ydp-shake .ydp-pill {
    border-color: #e55353;
    color: #e55353;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
    .ydp-pill {
        background: color-mix(in srgb, var(--ydp-color) 10%, #fff);
    }
    .ydp-pill:hover {
        background: color-mix(in srgb, var(--ydp-color) 22%, #fff);
    }
}

.ydp-pill:focus-visible {
    outline: 2px solid var(--ydp-color);
    outline-offset: 2px;
}

.ydp-pill.is-active,
.ydp-pill.is-active:hover {
    background: var(--ydp-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* ---- Color hardening ----
   Keep the pill colors driven ONLY by --ydp-color (the color chosen in the
   plugin settings). The surrounding theme (Elementor / Amelia global colors
   such as --e-global-color-primary) otherwise bleeds onto the buttons and
   overrides the chosen color. High specificity (scoped under the Amelia
   duration wrapper) + !important so no external rule can win. */
.am-advsc__duration .ydp-pills .ydp-pill {
    border-color: var(--ydp-color) !important;
    color: var(--ydp-color) !important;
    background-color: #fff !important;
}

.am-advsc__duration .ydp-pills .ydp-pill__duration,
.am-advsc__duration .ydp-pills .ydp-pill__price {
    color: inherit !important;
    background: transparent !important;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
    .am-advsc__duration .ydp-pills .ydp-pill {
        background-color: color-mix(in srgb, var(--ydp-color) 10%, #fff) !important;
    }
    .am-advsc__duration .ydp-pills .ydp-pill:hover {
        background-color: color-mix(in srgb, var(--ydp-color) 22%, #fff) !important;
    }
}

.am-advsc__duration .ydp-pills .ydp-pill.is-active,
.am-advsc__duration .ydp-pills .ydp-pill.is-active:hover {
    background-color: var(--ydp-color) !important;
    color: #fff !important;
}

.am-advsc__duration .ydp-pills.ydp-shake .ydp-pill {
    border-color: #e55353 !important;
    color: #e55353 !important;
}

.am-advsc__duration .am-select-wrapper {
    display: none !important;
}

.ydp-hidden-popper,
.ydp-hidden-popper * {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate3d(-99999px, -99999px, 0) !important;
    transition: none !important;
    animation: none !important;
}

@media (max-width: 480px) {
    .ydp-pills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .ydp-pill {
        font-size: 13px;
        padding: 9px 8px;
    }
}
