/* ─── EcomFlow Funnels Styles ─────────────────────────────────────────────── */

/* Funnel buttons */
.ef-funnel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: var(--ef-primary, #22d3ee);
    color: #fff;
}

.ef-funnel-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ef-funnel-btn--secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.ef-funnel-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.ef-funnel-btn.ef-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ef-funnel-btn.ef-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: ef-spin 0.6s linear infinite;
    margin-left: 8px;
}

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

/* Timer */
.ef-funnel-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-weight: 600;
}

.ef-timer-display {
    font-size: 24px;
    font-family: monospace;
    letter-spacing: 2px;
}

/* Modal */
.ef-funnel-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ef-funnel-modal.ef-modal-visible {
    opacity: 1;
    visibility: visible;
}

.ef-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ef-modal-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 90%;
    padding: 32px;
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.ef-modal-visible .ef-modal-content {
    transform: scale(1);
}

/* Modal slide-up animation */
.ef-modal-slideUp {
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ef-modal-visible .ef-modal-slideUp {
    transform: translateY(0) scale(1);
}

/* Checkout data validation modal */
body.ef-checkout-validation-open {
    overflow: hidden;
}

.ef-checkout-validation-modal {
    z-index: 100002;
    align-items: center;
    padding: 18px;
}

.ef-checkout-validation-modal .ef-modal-overlay {
    background: rgba(10, 15, 25, 0.58);
    backdrop-filter: blur(8px);
}

.ef-checkout-validation-card {
    position: relative;
    z-index: 1;
    width: min(94vw, 520px);
    max-height: min(90vh, 720px);
    overflow-y: auto;
    padding: 28px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    color: #101828;
    transform: translateY(18px) scale(0.96);
    transition: transform 0.24s ease;
}

.ef-modal-visible .ef-checkout-validation-card {
    transform: translateY(0) scale(1);
}

.ef-checkout-validation-card.ef-checkout-validation-card-out {
    animation: ef-checkout-card-out 0.15s ease forwards;
}

.ef-checkout-validation-card.ef-checkout-validation-card-in {
    animation: ef-checkout-card-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ef-checkout-validation-transitioning .ef-checkout-validation-input,
.ef-checkout-validation-transitioning .ef-checkout-validation-save,
.ef-checkout-validation-transitioning .ef-checkout-validation-no-street,
.ef-checkout-validation-transitioning .ef-checkout-validation-no-email {
    pointer-events: none;
}

@keyframes ef-checkout-card-out {
    to {
        opacity: 0.56;
        transform: translateX(-20px) scale(0.97);
    }
}

@keyframes ef-checkout-card-in {
    from {
        opacity: 0.56;
        transform: translateX(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.ef-checkout-validation-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.ef-checkout-validation-step-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.ef-checkout-validation-step-pulse {
    animation: ef-checkout-step-pulse 0.34s ease;
}

@keyframes ef-checkout-step-pulse {
    0% {
        transform: translateY(-4px);
        opacity: 0.45;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.ef-checkout-validation-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff4e5;
    color: #b54708;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}

.ef-checkout-validation-card h3 {
    margin: 0 0 12px;
    color: #c2410c;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.ef-checkout-validation-message {
    margin: 0 0 22px;
    color: #475467;
    font-size: 15px;
    line-height: 1.55;
}

.ef-checkout-validation-message strong {
    color: #1d2939;
    font-weight: 800;
}

.ef-checkout-validation-field {
    display: block;
    margin: 0;
    max-height: 180px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0);
    transition: max-height 0.24s ease, opacity 0.2s ease, transform 0.24s ease, margin 0.24s ease;
}

.ef-checkout-validation-email-skipped .ef-checkout-validation-field {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.ef-checkout-validation-label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.ef-checkout-validation-input-wrap {
    display: block;
}

.ef-checkout-validation-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #ffffff;
    color: #101828;
    font-size: 16px;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.ef-checkout-validation-input:focus {
    outline: none;
    border-color: var(--ef-primary, #22d3ee);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
}

.ef-checkout-validation-checkbox-copy {
    margin: 0;
    padding: 13px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #f8fafc;
    color: #344054;
    font-size: 14px;
}

.ef-checkout-validation-no-street {
    display: none;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    color: #344054;
    font-size: 14px;
    line-height: 1.35;
}

.ef-checkout-validation-no-email {
    display: none;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.ef-checkout-validation-no-email-note {
    display: none;
    margin: 10px 0 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.45;
}

.ef-checkout-validation-no-street input,
.ef-checkout-validation-no-email input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ef-primary, #22d3ee);
    flex: 0 0 auto;
}

.ef-checkout-validation-error {
    display: none;
    margin: 12px 0 0;
    color: #b42318;
    font-size: 13px;
    line-height: 1.4;
}

.ef-checkout-validation-save {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--ef-primary, #22d3ee);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(34, 211, 238, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ef-checkout-validation-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(34, 211, 238, 0.28);
}

.ef-checkout-validation-save:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.22), 0 18px 34px rgba(34, 211, 238, 0.28);
}

.ef-checkout-validation-save:disabled {
    cursor: not-allowed;
    opacity: 0.54;
    transform: none;
    box-shadow: none;
}

.ef-checkout-validation-pending .ef-checkout-validation-save {
    cursor: wait;
}

.woocommerce-checkout .form-row.ef-checkout-validation-target {
    border-radius: 12px;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

@media (max-width: 480px) {
    .ef-checkout-validation-modal {
        align-items: center;
        padding: 10px;
    }

    .ef-checkout-validation-card {
        width: 100%;
        max-height: 88vh;
        padding: 22px 18px 18px;
        border-radius: 18px;
    }

    .ef-checkout-validation-icon {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .ef-checkout-validation-status {
        margin-bottom: 12px;
    }

    .ef-checkout-validation-step-count {
        min-width: 44px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .ef-checkout-validation-message {
        font-size: 14px;
    }

    .ef-checkout-validation-card h3 {
        font-size: 21px;
    }
}

.ef-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.ef-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ef-modal-headline {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.ef-modal-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 20px;
    line-height: 1.5;
}

.ef-modal-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
}

.ef-modal-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* Modal timer */
.ef-modal-timer {
    margin-bottom: 16px;
    justify-content: center;
}

.ef-timer-label {
    font-size: 13px;
    font-weight: 500;
}

/* Modal discount badge */
.ef-modal-discount-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.ef-modal-actions {
    display: flex;
    gap: 12px;
}

/* Modal subheadline */
.ef-modal-subheadline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: -4px 0 16px;
    line-height: 1.4;
}

/* Modal quantity controls */
.ef-modal-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.ef-modal-quantity__label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.ef-qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.ef-qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ef-qty-input {
    width: 48px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 4px;
    -moz-appearance: textfield;
}

.ef-qty-input::-webkit-outer-spin-button,
.ef-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Modal responsive */
@media (max-width: 480px) {
    .ef-modal-content {
        width: 95%;
        padding: 20px;
    }

    .ef-modal-product {
        flex-direction: column;
        text-align: center;
    }

    .ef-modal-product img {
        width: 100px;
        height: 100px;
    }

    .ef-modal-actions {
        flex-direction: column;
    }

    .ef-modal-actions .ef-funnel-btn {
        width: 100%;
    }
}

/* Bump Offer */
.ef-bump-offer {
    padding: 16px;
    margin: 16px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.ef-bump-checkbox {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    accent-color: var(--ef-primary, #22d3ee);
}

.ef-bump-offer__headline {
    font-size: 15px;
    font-weight: 700;
    color: var(--ef-bump-headline-color, var(--ef-font-color, #111827));
    line-height: 1.3;
    margin-bottom: 4px;
}

.ef-bump-offer__description {
    font-size: 13px;
    color: var(--ef-bump-description-color, #6b7280);
    line-height: 1.4;
    margin-top: 4px;
}

.ef-bump-offer__price {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.ef-bump-offer__price del {
    color: var(--ef-bump-old-price-color, #9ca3af);
    margin-right: 8px;
}

.ef-bump-offer__price ins {
    color: var(--ef-bump-new-price-color, var(--ef-primary, #111827));
    text-decoration: none;
}

.ef-bump-offer__body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ef-bump-offer__image {
    flex: 0 0 30%;
    width: 30%;
    max-width: 180px;
}

.ef-bump-offer__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.ef-bump-offer__info {
    flex: 1 1 auto;
    min-width: 0;
}

.ef-bump-offer__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ef-bump-title-color, var(--ef-font-color, #111827));
    line-height: 1.35;
}

.ef-bump-offer__action {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
    color: var(--ef-bump-checkbox-text-color, var(--ef-font-color, #111827));
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ef-bump-offer__error {
    display: none;
    margin: 10px 0 0;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
}

.ef-bump-offer__error:not(:empty) {
    display: block;
}

.ef-bump-offer--mobile {
    display: none;
}

@media (max-width: 767px) {
    .ef-bump-offer--desktop {
        display: none;
    }

    .ef-bump-offer--mobile {
        display: block;
    }

    .ef-bump-offer__body {
        flex-direction: column;
        gap: 12px;
    }

    .ef-bump-offer__image {
        flex-basis: auto;
        width: 100%;
        max-width: none;
    }
}

/* Funnel step container */
.ef-funnel-step {
    min-height: 60vh;
}

.ef-funnel-step__content {
    color: #fff;
}

/* Order details on THX page */
.ef-order-details {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ef-order-details table {
    width: 100%;
    border-collapse: collapse;
}

.ef-order-details td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.ef-order-details td:first-child {
    color: rgba(255, 255, 255, 0.5);
}

.ef-order-details td:last-child {
    text-align: right;
    font-weight: 600;
    color: #fff;
}

/* Offer box */
.ef-offer-box {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
}

.ef-offer-box__image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ef-offer-box__price {
    font-size: 28px;
    font-weight: 800;
    color: var(--ef-primary, #22d3ee);
}

.ef-offer-box__original-price {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: line-through;
    margin-right: 8px;
}

.ef-offer-box__discount-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

/* Checkout: stable field gaps and per-device field widths */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper,
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    column-gap: 16px !important;
    row-gap: 0 !important;
    width: 100% !important;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-first,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-last {
    width: calc(50% - 8px) !important;
    flex: 0 0 calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
    float: none !important;
    clear: none !important;
    margin-right: 0 !important;
}

.woocommerce-checkout .form-row.ef-field-desktop-full {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: none !important;
    margin-right: 0 !important;
}

.woocommerce-checkout .form-row.ef-field-desktop-half {
    width: calc(50% - 8px) !important;
    flex: 0 0 calc(50% - 8px) !important;
    max-width: calc(50% - 8px) !important;
    float: none !important;
    clear: none !important;
    margin-right: 0 !important;
}

@media (max-width: 768px) {
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-first,
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-last,
    .woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-first,
    .woocommerce-checkout .woocommerce-shipping-fields__field-wrapper .form-row-last {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .woocommerce-checkout .form-row.ef-field-mobile-full {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .woocommerce-checkout .form-row.ef-field-mobile-half {
        width: calc(50% - 8px) !important;
        flex: 0 0 calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
    }
}
