/*
 * LDG checkout voucher block: applied / not applied yet (held) / rejected.
 * Markup: themes/ldg/checkout.php (.voucher-section) and renderVoucherStatus() in
 * assets/ldg/scripts/cart.js. States are always named in words, never colour alone.
 */

.voucher-section {
    position: relative;
}

/* ---- Code entry ---- */
.voucher-section .input-group {
    border-radius: 50px;
    overflow: hidden;
}

.voucher-section .input-group .form-control {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    border-right: none;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.voucher-section .input-group .btn {
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    font-size: 0.9rem;
}

/* ---- Applied pill (valid) ---- */
.voucher-applied {
    background-color: #f8f9fa;
    border-radius: 50px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.voucher-applied:hover {
    border-color: #dee2e6;
    background-color: #f1f3f5;
}

.voucher-applied__icon {
    color: #1e6b2e;
    font-size: 1.1rem;
}

.voucher-applied__code {
    color: var(--font-color, #111111);
    word-break: break-word;
}

.voucher-state-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    margin-right: 0.35rem;
}

.voucher-state-tag--valid {
    color: #1e6b2e;
}

.voucher-state-tag--held {
    color: #6b4a00;
}

.voucher-remove-btn {
    font-size: 1.2rem;
    line-height: 1;
    min-width: 2rem;
    min-height: 2rem;
}

/* ---- Held pill: code kept, discount not applied yet ---- */
.voucher-applied--held {
    border-style: dashed;
    border-color: #ced4da;
}

.voucher-applied--held:hover {
    border-color: #adb5bd;
}

.voucher-applied--held .voucher-applied__code {
    padding-left: 0.5rem;
}

.voucher-applied--held .voucher-state-tag {
    padding-left: 0.5rem;
}

/* ---- Notices under the voucher field (held / error / success / warning) ----
 * Sits in the black checkout sidebar: translucent panel, white text, the state
 * carried by the small heading colour plus its words. No icons. */
.voucher-notice {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    line-height: 1.45;
    padding: 0.875rem 1.125rem;
    animation: voucherFadeIn 0.3s ease-out;
}

.voucher-notice p {
    margin: 0;
}

.voucher-notice > * + * {
    margin-top: 0.4rem;
}

.voucher-notice__eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.voucher-notice--held .voucher-notice__eyebrow {
    color: #ffc56b;
}

.voucher-notice--error .voucher-notice__eyebrow {
    color: var(--orange, #FF6B5A);
}

.voucher-notice--warning .voucher-notice__eyebrow {
    color: #ffc56b;
}

.voucher-notice__title {
    color: var(--white, #ffffff);
    font-size: 0.95rem;
    font-weight: 600;
}

.voucher-notice--success .voucher-notice__title {
    color: var(--primary-color, #9DD58C);
}

.voucher-notice--error {
    border-color: rgba(255, 107, 90, 0.45);
}

/* Progress towards min spend / min tickets */
.voucher-notice__meter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.2rem;
}

.voucher-notice__meter progress {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border: none;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.voucher-notice__meter progress::-webkit-progress-bar {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
}

.voucher-notice__meter progress::-webkit-progress-value {
    background-color: var(--primary-color, #9DD58C);
    border-radius: 50px;
}

.voucher-notice__meter progress::-moz-progress-bar {
    background-color: var(--primary-color, #9DD58C);
    border-radius: 50px;
}

.voucher-notice__meter-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.voucher-notice__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 0.2rem;
}

.voucher-notice__list {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
}

.voucher-notice__list li {
    position: relative;
    padding-left: 0.9rem;
}

.voucher-notice__list li + li {
    margin-top: 0.15rem;
}

.voucher-notice__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.45);
}

.voucher-notice__action {
    display: inline-block;
    border-radius: 50px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.voucher-notice__note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ---- Basket line not covered by the voucher ---- */
.voucher-item-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.5rem;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    border: 1px solid #e3c98a;
    background-color: #fffaf0;
    color: #6b4a00;
    font-size: 0.75rem;
    font-weight: 600;
}

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

@media (prefers-reduced-motion: reduce) {
    .voucher-notice {
        animation: none;
    }
}

/* ---- ?voucher= link toast: "saved, not applied yet" ---- */
.swal2-container.quickadd.voucherlink--info div:where(.swal2-icon).swal2-info {
    color: #a87700;
    border-color: #c98f00;
}
