/* ========================================
   Gift Card Widget — 2-step wizard
   ======================================== */

/* ---- CTA button ---- */

.sdb-gift-card-widget .sdb-gift-card-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6b3ef0 0%, #4b2de0 100%);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.sdb-gift-card-widget .sdb-gift-card-open:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(107, 62, 240, 0.35);
}

/* ---- Modal shell ---- */

.sdb-gift-card-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.sdb-gift-card-modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sdb-gift-card-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.58);
    z-index: 1;
}

.sdb-gift-card-dialog {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    padding: 24px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
}

.sdb-gift-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef2ff;
    color: #1f2937;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s;
}

.sdb-gift-card-close:hover {
    background: #dbeafe;
}

body.sdb-gift-card-open {
    overflow: hidden;
}

/* ---- Step indicators ---- */

.sdb-gc-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 20px;
}

.sdb-gc-step {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: opacity 0.25s;
}

.sdb-gc-step.is-active,
.sdb-gc-step.is-completed {
    opacity: 1;
}

.sdb-gc-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    transition: background 0.25s, color 0.25s;
}

.sdb-gc-step.is-active .sdb-gc-step-num {
    color: #fff;
    background: var(--sdb-gift-accent, #e2b04a);
}

.sdb-gc-step.is-completed .sdb-gc-step-num {
    color: #fff;
    background: #10b981;
}

.sdb-gc-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.sdb-gc-step-line {
    width: 40px;
    height: 2px;
    margin: 0 10px;
    background: #e5e7eb;
    border-radius: 1px;
}

/* ---- Step panels ---- */

.sdb-gc-panel {
    display: none;
}

.sdb-gc-panel.is-active {
    display: block;
    animation: sdbGcFadeIn 0.25s ease;
}

@keyframes sdbGcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Headings ---- */

.sdb-gift-card-head h3 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.sdb-gift-card-head p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #6b7280;
}

/* ---- Gift card preview (visual card) ---- */

.sdb-gift-card-preview {
    position: relative;
    margin-bottom: 18px;
    border-radius: 16px;
    padding: 24px 22px 20px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--sdb-gift-color-start, #1a1a2e) 0%,
        var(--sdb-gift-color-end, #0f3460) 100%
    );
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sdb-gift-card-preview::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.sdb-gift-card-logo {
    margin-bottom: 8px;
}

.sdb-gift-card-logo img {
    max-height: 34px;
    width: auto;
    display: block;
}

.sdb-gift-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.sdb-gift-card-amount-display {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    color: var(--sdb-gift-accent, #e2b04a);
}

.sdb-gc-currency {
    font-size: 26px;
    vertical-align: top;
    margin-right: 2px;
    opacity: 0.85;
}

.sdb-gift-card-company {
    font-size: 13px;
    opacity: 0.75;
}

.sdb-gift-card-code {
    margin-top: 6px;
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 700;
    opacity: 0.5;
}

/* ---- Amount section (Step 1) ---- */

.sdb-gc-amount-section {
    margin-bottom: 6px;
}

.sdb-gc-amount-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.sdb-gc-amount-label span {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.sdb-gc-amount-label input {
    width: 100%;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.15s;
}

.sdb-gc-amount-label input:focus {
    outline: none;
    border-color: var(--sdb-gift-accent, #e2b04a);
}

.sdb-gc-quick-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.sdb-gc-quick-btn {
    flex: 1;
    min-width: 70px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.sdb-gc-quick-btn:hover {
    border-color: var(--sdb-gift-accent, #e2b04a);
    background: #fffbeb;
}

.sdb-gc-quick-btn.is-selected {
    border-color: var(--sdb-gift-accent, #e2b04a);
    background: var(--sdb-gift-accent, #e2b04a);
    color: #fff;
}

.sdb-gc-amount-hint {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

/* ---- Step 2 fieldsets ---- */

.sdb-gc-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px 16px;
    margin: 0 0 14px;
}

.sdb-gc-fieldset legend {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    padding: 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sdb-gc-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sdb-gc-field-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #374151;
}

.sdb-gc-field-grid label:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.sdb-gc-field-grid label span {
    font-weight: 600;
}

.sdb-gc-field-grid input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    transition: border-color 0.15s;
}

.sdb-gc-field-grid input:focus {
    outline: none;
    border-color: var(--sdb-gift-accent, #e2b04a);
}

.sdb-gc-message-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 13px;
    color: #374151;
}

.sdb-gc-message-label span {
    font-weight: 600;
}

.sdb-gc-message-label textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.15s;
}

.sdb-gc-message-label textarea:focus {
    outline: none;
    border-color: var(--sdb-gift-accent, #e2b04a);
}

/* ---- Recipient hidden when send-to-self ---- */

.sdb-gc-recipient-fields.is-hidden {
    display: none;
}

/* ---- Send-to-self switch ---- */

.sdb-gift-card-switch {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.sdb-gift-card-switch input {
    width: auto;
    accent-color: var(--sdb-gift-accent, #e2b04a);
}

/* ---- Status message ---- */

.sdb-gift-card-message {
    min-height: 20px;
    font-size: 13px;
    margin-bottom: 4px;
}

.sdb-gift-card-message:empty {
    display: none;
}

.sdb-gift-card-message.is-error {
    display: block;
    color: #b91c1c;
}

.sdb-gift-card-message.is-success {
    display: block;
    color: #166534;
}

/* ---- Buttons ---- */

.sdb-gift-card-submit {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--sdb-gift-accent, #e2b04a) 0%,
        #c7922c 100%
    );
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.sdb-gift-card-submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.sdb-gift-card-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Step 2 actions — back + submit side by side */

.sdb-gc-step2-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.sdb-gc-back {
    flex: 0 0 auto;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sdb-gc-back:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.sdb-gc-step2-actions .sdb-gift-card-submit {
    flex: 1;
}

/* ---- Mobile ---- */

@media (max-width: 680px) {
    .sdb-gift-card-modal.is-open {
        padding: 0;
    }

    .sdb-gift-card-dialog {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .sdb-gc-field-grid {
        grid-template-columns: 1fr;
    }

    .sdb-gift-card-submit,
    .sdb-gc-back {
        min-height: 46px;
    }

    .sdb-gift-card-amount-display {
        font-size: 34px;
    }

    .sdb-gc-quick-btn {
        min-width: 60px;
        padding: 8px 8px;
        font-size: 14px;
    }
}
