/* ==========================================================================
   SigninLink Gift Redeem — Popup Styles
   ========================================================================== */

/* ----- Trigger Button ----- */
.sl-gift-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    line-height: 1.4;
}

.sl-gift-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 59, 0, 0.35);
}

.sl-gift-trigger-btn:active {
    transform: translateY(0);
}

/* ----- Popup Overlay ----- */
.sl-gift-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
    animation: sl-gift-fadeIn 0.25s ease;
}

@keyframes sl-gift-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ----- Popup Container ----- */
.sl-gift-popup-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    animation: sl-gift-scaleIn 0.3s ease;
}

@keyframes sl-gift-scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* ----- Close Button ----- */
.sl-gift-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sl-gift-popup-close:hover {
    background: #ff3b00;
}

/* ==========================================================================
   Step 1: Gift Card
   ========================================================================== */
.sl-gift-step {
    transition: opacity 0.3s ease;
}

.iti {
    width: 100%;
    margin-bottom: 0;
}
.iti__flag-container {
    border-radius: 20px 0 0 20px;
}


/* Ensure the dropdown is above the popup overlay which has z-index 999999 */
.iti--container {
    z-index: 9999999 !important;
}

.sl-gift-card-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.sl-gift-card-bg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}

/* Input area positioned over the card (configurable via Elementor controls) */
.sl-gift-card-input-area {
    position: absolute;
    top: 75%;
    left: 42%;
    width: 48%;
    transform: translateY(-50%);
}

.sl-gift-code-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px dashed #d4a853;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.sl-gift-code-input:focus {
    border-color: #ff3b00;
    box-shadow: 0 0 0 3px rgba(255, 59, 0, 0.15);
}

.sl-gift-code-input::placeholder {
    color: #999;
    font-weight: 400;
    letter-spacing: 0;
}

/* Step 1 submit button */
.sl-gift-step1-submit {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4a853, #b8903f);
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sl-gift-step1-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.4);
}

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

/* ==========================================================================
   Step 2: Registration Form
   ========================================================================== */
.sl-gift-form-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.sl-gift-form-bg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}

/* Form header overlaid on the card's white area */
.sl-gift-form-header {
    position: absolute;
    top: 8%;
    left: 10%;
    width: 80%;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}

.sl-gift-vendor-name {
    display: block;
    color: #1a1a1a;
    font-size: clamp(12px, 2.8vw, 17px);
    font-weight: 800;
    text-transform: uppercase;
}

.sl-gift-value {
    display: block;
    color: #d4a853;
    font-size: clamp(10px, 2.2vw, 14px);
    font-weight: 700;
    margin-top: 2px;
}

/* Form fields positioned within the white area */
.sl-gift-form-fields {
    position: absolute;
    top: 22%;
    left: 12%;
    width: 76%;
    bottom: 8%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 0;
}
/* Name row: first + last name side by side */
.sl-gift-name-row {
    display: flex;
    gap: 6px;
}

.sl-gift-name-row .sl-gift-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.sl-gift-input {
    width: 100%;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(220, 220, 220, 0.9);
    color: #333;
    font-size: clamp(11px, 2vw, 14px);
    outline: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.sl-gift-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 59, 0, 0.15);
}

.sl-gift-input::placeholder {
    color: #888;
    font-weight: 400;
}

.sl-gift-input.sl-gift-input--error {
    background: #ffe0e0;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.3);
}

/* Step 2 submit button */
.sl-gift-step2-submit {
    display: block;
    width: auto;
    margin: 16px auto 0;
    padding: 14px 40px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #d4a853, #b8903f);
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sl-gift-step2-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.4);
}

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

/* ==========================================================================
   Step 3: Success
   ========================================================================== */
.sl-gift-success {
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
    animation: sl-gift-fadeIn 0.4s ease;
}

/* -- Text mode -- */
.sl-gift-success--text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 40px 24px;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(212, 168, 83, 0.3);
}

.sl-gift-success-message {
    color: #fff;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}

.sl-gift-success-message h3 {
    margin: 0 0 8px;
    font-size: 1.3em;
}

.sl-gift-success-message p {
    margin: 4px 0;
}

/* -- Image mode -- */
.sl-gift-success--image {
    padding: 0;
    background: none;
    border: none;
}

.sl-gift-success-img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */
.sl-gift-error {
    margin-top: 10px;
    padding: 0;
    color: #ff4444;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.sl-gift-error:empty {
    display: none;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.sl-gift-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
}

.sl-gift-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #d4a853;
    border-radius: 50%;
    animation: sl-gift-spin 0.7s linear infinite;
}

@keyframes sl-gift-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .sl-gift-popup-container {
        max-width: 100%;
    }

    .sl-gift-popup-close {
        top: -8px;
        right: -4px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .sl-gift-card-input-area {
        /* Position managed by Elementor controls */
    }

    .sl-gift-code-input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .sl-gift-step1-submit,
    .sl-gift-step2-submit {
        padding: 12px 20px;
        font-size: 14px;
    }

    .sl-gift-form-fields {
        top: 22%;
        left: 10%;
        width: 80%;
    }

    .sl-gift-input {
        padding: 6px 12px;
    }

    .sl-gift-success {
        padding: 40px 16px;
    }

    .sl-gift-success-message {
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .sl-gift-card-input-area {
        /* Position managed by Elementor controls */
    }

    .sl-gift-form-fields {
        gap: 4%;
    }
}
