/* TobiDu Gutschein-Kaufwidget – mobile-first, scoped zu .tobidu-vchr-widget
 * Farben: identisch mit Ticketsystem (frontend.css) – Amber #f59e0b
 */

.tobidu-vchr-widget {
    --vcr-blue:        #f59e0b;
    --vcr-blue-hover:  #d97706;
    --vcr-blue-light:  #fffbeb;
    --vcr-radius:      6px;
    --vcr-border:      #ddd;
    --vcr-text:        #222;
    --vcr-muted:       #888;
    --vcr-neutral-bg:  #f5f5f5;
    --vcr-neutral-hov: #eeeeee;
    --vcr-error-bg:    #fef2f2;
    --vcr-error-bdr:   #b91c1c;
    --vcr-success-bg:  #f0fdf4;
    --vcr-success-bdr: #15803d;

    font-family: inherit;
    color: var(--vcr-text);
    max-width: 780px;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 0;
}

.tobidu-vchr-widget *,
.tobidu-vchr-widget *::before,
.tobidu-vchr-widget *::after {
    box-sizing: border-box;
}

/* Link-Reset */
.tobidu-vchr-widget a,
.tobidu-vchr-widget a:hover,
.tobidu-vchr-widget a:focus,
.tobidu-vchr-widget a:visited {
    color: inherit;
    text-decoration: none !important;
}

/* ── Fehlermeldung / Hinweis ─────────────────────────────────────────────── */

.tobidu-vchr-msg {
    padding: 12px 16px;
    border-radius: var(--vcr-radius);
    border-left: 4px solid transparent;
    font-size: 0.93rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Fehler-Farbe wird per JS inline gesetzt; trotzdem Basis-Stil */
.tobidu-vchr-msg[style*="b91c1c"],
.tobidu-vchr-msg[style*="fee2e2"] {
    background: var(--vcr-error-bg) !important;
    border-left-color: var(--vcr-error-bdr) !important;
    color: #991b1b !important;
}

/* ── Stepper ─────────────────────────────────────────────────────────────── */

.tobidu-vchr-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    gap: 0;
}

.tobidu-vchr-stepper__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tobidu-vchr-stepper__num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--vcr-border);
    background: #fff;
    color: var(--vcr-muted);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tobidu-vchr-stepper__lbl {
    font-size: 0.72rem;
    color: var(--vcr-muted);
    white-space: nowrap;
}

.tobidu-vchr-stepper__line {
    flex: 1;
    height: 2px;
    background: var(--vcr-border);
    margin: 0 4px;
    margin-bottom: 20px;
}

.tobidu-vchr-stepper__item.is-active .tobidu-vchr-stepper__num {
    border-color: var(--vcr-blue);
    background:   var(--vcr-blue);
    color: #fff;
}
.tobidu-vchr-stepper__item.is-active .tobidu-vchr-stepper__lbl {
    color: var(--vcr-blue);
    font-weight: 600;
}

@media (max-width: 400px) {
    .tobidu-vchr-stepper__lbl  { display: none; }
    .tobidu-vchr-stepper__line { margin-bottom: 0; }
}

/* ── Panel ───────────────────────────────────────────────────────────────── */

.tobidu-vchr-panel {
    width: 100%;
}

.tobidu-vchr-panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--vcr-text);
}

/* ── Betrag-Buttons ──────────────────────────────────────────────────────── */

.tobidu-vchr-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.tobidu-vchr-amount-btn {
    padding: 12px 22px;
    border: 2px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    background: #fff;
    color: var(--vcr-text) !important;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-decoration: none !important;
    outline: none;
    line-height: 1.2;
}
.tobidu-vchr-amount-btn:hover,
.tobidu-vchr-amount-btn:focus-visible {
    border-color: var(--vcr-blue) !important;
    background: var(--vcr-blue-light) !important;
    color: var(--vcr-blue-hover) !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.tobidu-vchr-amount-btn.is-active {
    border-color: var(--vcr-blue) !important;
    background:   var(--vcr-blue-light) !important;
    color: var(--vcr-blue-hover) !important;
    font-weight: 700;
}

/* ── Custom-Betrag ───────────────────────────────────────────────────────── */

.tobidu-vchr-custom-wrap {
    margin-top: 14px;
}

.tobidu-vchr-field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--vcr-text);
    margin-bottom: 6px;
}

.tobidu-vchr-hint {
    font-weight: 400;
    color: var(--vcr-muted);
    font-size: 0.85em;
}

/* ── Eingabefelder ───────────────────────────────────────────────────────── */

.tobidu-vchr-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    font-size: 0.95rem;
    color: var(--vcr-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.tobidu-vchr-input:focus {
    outline: none;
    border-color: var(--vcr-blue);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.tobidu-vchr-input--narrow {
    max-width: 200px;
}

/* ── Zeilen-Layout ───────────────────────────────────────────────────────── */

.tobidu-vchr-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 6px;
}

.tobidu-vchr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 601px) {
    .tobidu-vchr-row         { flex-direction: row; }
    .tobidu-vchr-field       { flex: 1 1 0; min-width: 0; }
    .tobidu-vchr-field--narrow { flex: 0 0 120px !important; }
}

/* ── Kanal-Buttons (Digital / Geschenkbox) ───────────────────────────────── */

.tobidu-vchr-channel-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tobidu-vchr-channel-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    background: #fff;
    color: var(--vcr-text) !important;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    font-family: inherit;
    line-height: 1.3;
}
.tobidu-vchr-channel-btn:hover,
.tobidu-vchr-channel-btn:focus-visible {
    border-color: var(--vcr-blue) !important;
    background: var(--vcr-blue-light) !important;
    color: var(--vcr-blue-hover) !important;
    outline: none !important;
    box-shadow: none !important;
}
.tobidu-vchr-channel-btn.is-active {
    border-color: var(--vcr-blue) !important;
    background: var(--vcr-blue-light) !important;
    color: var(--vcr-blue-hover) !important;
    font-weight: 700;
}

@media (max-width: 400px) {
    .tobidu-vchr-channel-row { flex-direction: column; }
}

.tobidu-vchr-channel-hint {
    background: var(--vcr-neutral-bg);
    border-left: 4px solid var(--vcr-blue);
    border-radius: 0 var(--vcr-radius) var(--vcr-radius) 0;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--vcr-muted);
    margin: 0 0 16px;
    line-height: 1.55;
}

/* ── Template-Karten ─────────────────────────────────────────────────────── */

/* Preview-Bild im Card */
.tobidu-vchr-tpl-card__preview {
    display: block;
    width: 100%;
    height: 80px;
    background: var(--vcr-neutral-bg);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.tobidu-vchr-tpl-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Vorschau-Button (Hover Desktop, immer auf Touch) */
.tobidu-vchr-tpl-preview-btn {
    display: none;
    position: absolute;
    bottom: 4px;
    right: 4px;
    padding: 2px 7px;
    background: rgba(0,0,0,0.52);
    color: #fff !important;
    font-size: 0.68rem;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none !important;
}
.tobidu-vchr-tpl-card:hover .tobidu-vchr-tpl-preview-btn,
.tobidu-vchr-tpl-card:focus-within .tobidu-vchr-tpl-preview-btn {
    display: inline-block;
}
@media (hover: none) {
    .tobidu-vchr-tpl-preview-btn { display: inline-block; }
}

/* ── Vorschau-Modal ──────────────────────────────────────────────────────── */

.tobidu-vchr-img-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    display: none;
}
.tobidu-vchr-img-modal[style*="flex"] {
    display: flex !important;
}
.tobidu-vchr-img-modal__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.tobidu-vchr-img-modal__img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.55);
}
.tobidu-vchr-img-modal__close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 30px;
    height: 30px;
    background: #333;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: inherit;
    text-decoration: none !important;
}
.tobidu-vchr-img-modal__close:hover {
    background: #555 !important;
}

.tobidu-vchr-tpl-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 400px) {
    .tobidu-vchr-tpl-list { grid-template-columns: 1fr 1fr; }
}

.tobidu-vchr-tpl-card {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: var(--vcr-text) !important;
}
.tobidu-vchr-tpl-card:hover,
.tobidu-vchr-tpl-card:focus-within {
    border-color: var(--vcr-blue) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}
.tobidu-vchr-tpl-card.is-selected {
    border-color: var(--vcr-blue) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3) !important;
}

.tobidu-vchr-tpl-card__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
}
.tobidu-vchr-tpl-card.is-selected .tobidu-vchr-tpl-card__footer {
    background: var(--vcr-blue-light);
}

.tobidu-vchr-tpl-card__name {
    font-size: 0.88rem;
    font-weight: 500;
}

.tobidu-vchr-tpl-radio {
    accent-color: var(--vcr-blue);
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ── Geschenkbox-Bereich ─────────────────────────────────────────────────── */

.tobidu-vchr-giftbox-wrap {
    margin-top: 24px;
    border-top: 1px solid var(--vcr-border);
    padding-top: 18px;
}

.tobidu-vchr-giftbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.tobidu-vchr-giftbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--vcr-blue);
    cursor: pointer;
}

.tobidu-vchr-giftbox-label strong {
    display: block;
    font-size: 0.95rem;
}

.tobidu-vchr-giftbox-label span[style] {
    font-size: 0.85rem;
}

.tobidu-vchr-shipping-wrap {
    background: var(--vcr-blue-light);
    border: 1px solid #fde68a;
    border-radius: var(--vcr-radius);
    padding: 16px;
    margin-top: 14px;
}

/* ── Navigations-Buttons ─────────────────────────────────────────────────── */

.tobidu-vchr-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--vcr-border);
}

.tobidu-vchr-nav .tobidu-vchr-btn-back {
    margin-right: auto;
}

.tobidu-vchr-btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: var(--vcr-blue);
    color: #fff !important;
    border: 2px solid var(--vcr-blue);
    border-radius: var(--vcr-radius);
    font-size: 0.97rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none !important;
    outline: none;
    font-family: inherit;
    line-height: 1.2;
}
.tobidu-vchr-btn-primary:hover,
.tobidu-vchr-btn-primary:focus-visible {
    background: var(--vcr-blue-hover) !important;
    border-color: var(--vcr-blue-hover) !important;
    color: #fff !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.tobidu-vchr-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tobidu-vchr-btn-back {
    display: inline-block;
    padding: 12px 22px;
    background: transparent;
    color: var(--vcr-text) !important;
    border: 2px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    font-size: 0.97rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none !important;
    outline: none;
    font-family: inherit;
    line-height: 1.2;
}
.tobidu-vchr-btn-back:hover,
.tobidu-vchr-btn-back:focus-visible {
    background: var(--vcr-neutral-hov) !important;
    border-color: #94a3b8 !important;
    color: var(--vcr-text) !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ── Zusammenfassung ─────────────────────────────────────────────────────── */

.tobidu-vchr-summary {
    border: 1px solid var(--vcr-border);
    border-radius: var(--vcr-radius);
    overflow: hidden;
    margin-bottom: 6px;
}

.tobidu-vchr-summary__row {
    display: flex;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.tobidu-vchr-summary__row:last-child {
    border-bottom: none;
}
.tobidu-vchr-summary__total {
    background: var(--vcr-blue-light);
}

.tobidu-vchr-summary__row dt {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--vcr-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.tobidu-vchr-summary__row dd {
    font-size: 0.93rem;
    margin: 0;
    line-height: 1.5;
}

.tobidu-vchr-summary__total dt,
.tobidu-vchr-summary__total dd {
    color: var(--vcr-text);
    font-weight: 700;
    font-size: 1rem;
}

/* ── Erfolg ──────────────────────────────────────────────────────────────── */

.tobidu-vchr-success {
    text-align: center;
    padding: 36px 16px;
}

.tobidu-vchr-success__check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--vcr-success-bg);
    border: 2px solid var(--vcr-success-bdr);
    color: var(--vcr-success-bdr);
    font-size: 1.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.tobidu-vchr-success__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.tobidu-vchr-success__text {
    color: var(--vcr-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

/* ── Mobile ≤ 600px ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .tobidu-vchr-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .tobidu-vchr-nav .tobidu-vchr-btn-back {
        margin-right: 0;
        order: 2;
    }
    .tobidu-vchr-nav .tobidu-vchr-btn-primary {
        order: 1;
    }
    .tobidu-vchr-btn-primary,
    .tobidu-vchr-btn-back {
        width: 100%;
        text-align: center;
    }
    .tobidu-vchr-summary__row dt {
        min-width: 90px;
    }
    .tobidu-vchr-amounts {
        gap: 8px;
    }
    .tobidu-vchr-amount-btn {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
    }
    .tobidu-vchr-field--narrow {
        flex: 1 1 auto !important;
    }
}

/* ── SR-Only ─────────────────────────────────────────────────────────────── */

.tobidu-vchr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}
