/**
 * Till Payments Popup Addon Styles - Clean Minimal Design
 */

/* Popup Overlay */
.tppa-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

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

/* Popup Container */
.tppa-popup-container {
    background: #ffffff;
    border-radius: 8px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

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

/* Close Button */
.tppa-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f5f5;
    color: #666;
    border: none;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    border-radius: 50%;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tppa-popup-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Header */
.tppa-popup-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #eee;
}

.tppa-popup-header h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Step Indicator */
.tppa-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.tppa-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.tppa-step.active {
    color: #333;
}

.tppa-step.active .tppa-step-number {
    background: #FC933C;
    color: white;
    border-color: #FC933C;
}

.tppa-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.tppa-step-line {
    width: 60px;
    height: 1px;
    background: #e0e0e0;
}

.tppa-step-label {
    font-size: 14px;
}

/* Body */
.tppa-popup-body {
    padding: 24px;
}

/* Form Steps */
.tppa-form-step {
    display: block;
}

/* Form Fields */
.tppa-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.tppa-form-row:last-child {
    margin-bottom: 0;
}

.tppa-form-col,
.tppa-form-col-full {
    display: flex;
    flex-direction: column;
}

.tppa-form-col-full {
    grid-column: 1 / -1;
}

.tppa-form-control,
select.tppa-form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #333 !important;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.15s ease;
    background: white;
    box-sizing: border-box;
    color: #333;
    height: 46px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select.tppa-form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L2 5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 36px;
    border: 1px solid #333 !important;
}

input.tppa-form-control {
    background-image: none;
}

.tppa-form-control::placeholder {
    color: #999;
}

.tppa-form-control:focus {
    outline: none;
    border-color: #FC933C !important;
    box-shadow: 0 0 0 2px rgba(252, 147, 60, 0.15);
}

select.tppa-form-control:focus {
    outline: none;
    border-color: #FC933C !important;
    box-shadow: 0 0 0 2px rgba(252, 147, 60, 0.15);
}

/* Payment Fields */
.tppa-card-field,
.tppa-cvv-field {
    border: 1px solid #333 !important;
    border-radius: 4px;
    background: white;
    height: 46px;
    transition: all 0.15s ease;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.tppa-card-field:focus-within,
.tppa-cvv-field:focus-within {
    border-color: #FC933C !important;
    box-shadow: 0 0 0 2px rgba(252, 147, 60, 0.15);
}

/* Payment field iframes */
.tppa-card-field iframe,
.tppa-cvv-field iframe {
    border: none;
    width: 100%;
    height: 46px;
    background: transparent;
    display: block;
    margin: 0;
    padding: 10px 0 0 0;
}

/* Coupon Section */
.tppa-coupon-section {
    margin-bottom: 16px;
}

.tppa-coupon-toggle-wrapper {
    text-align: center;
    margin-bottom: 12px;
}

.tppa-coupon-link {
    color: #666;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.tppa-coupon-link:hover {
    color: #FC933C;
    text-decoration: underline;
}

.tppa-coupon-input-wrapper {
    margin-top: 12px;
}

.tppa-coupon-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.tppa-btn-apply {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    color: white !important;
    border: none !important;
    outline: none !important;
    padding: 0 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 46px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    text-shadow: none;
    justify-self: center;
}

.tppa-btn-apply:hover {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    color: white !important;
    border: none !important;
    outline: none !important;
}

.tppa-btn-apply:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: none !important;
    outline: none !important;
}

.tppa-btn-apply:focus {
    border: none !important;
    outline: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tppa-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f9ff;
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 8px;
    border: 1px solid #bfdbfe;
}

.tppa-coupon-code-display {
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
}

.tppa-remove-coupon {
    background: none;
    border: none;
    color: #1e40af;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.tppa-remove-coupon:hover {
    opacity: 1;
}

/* Extra Entries & Marketing */
.tppa-extra-entries {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    transition: all 0.2s ease;
}

.tppa-extra-entries:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.tppa-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #78350f;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tppa-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #d97706;
}

.tppa-marketing-optin {
    margin-bottom: 20px;
}

.tppa-marketing-optin .tppa-checkbox-label {
    font-weight: 400;
    color: #666;
}

/* Continue Button */
.tppa-btn-continue {
    width: 100% !important;
    display: block;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    color: white !important;
    border: none !important;
    outline: none !important;
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    text-shadow: none;
    position: relative;
    overflow: hidden;
}

.tppa-btn-continue:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.tppa-btn-continue:hover {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: white !important;
    border: none !important;
    outline: none !important;
}

.tppa-btn-continue:hover:before {
    left: 100%;
}

.tppa-btn-continue:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: none !important;
    outline: none !important;
}

.tppa-btn-continue:focus {
    border: none !important;
    outline: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Order Summary */
.tppa-order-summary {
    background: #f9fafb;
    border-radius: 4px;
    padding: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
}

.tppa-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #666;
}

.tppa-order-item:first-child {
    padding-top: 0;
}

.tppa-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

/* Back Button - New Design - Override Elementor styles */
.tppa-back-wrapper {
    text-align: center;
    margin-top: 12px;
}

.tppa-popup-container .tppa-btn-back-text,
.tppa-popup-overlay .tppa-btn-back-text {
    background: none !important;
    border: none !important;
    color: #999 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    transition: color 0.2s ease !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: normal !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    display: inline !important;
}

.tppa-popup-container .tppa-btn-back-text:hover,
.tppa-popup-overlay .tppa-btn-back-text:hover {
    background: none !important;
    color: #666 !important;
    text-decoration: underline !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.tppa-popup-container .tppa-btn-back-text:active,
.tppa-popup-overlay .tppa-btn-back-text:active {
    background: none !important;
    color: #333 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.tppa-popup-container .tppa-btn-back-text:focus,
.tppa-popup-overlay .tppa-btn-back-text:focus {
    outline: none !important;
    background: none !important;
    color: #666 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Submit Button */
.tppa-btn-submit {
    width: 100% !important;
    display: block;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    color: white !important;
    border: none !important;
    outline: none !important;
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    text-shadow: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tppa-btn-submit:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.tppa-btn-submit:hover {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: white !important;
    border: none !important;
    outline: none !important;
}

.tppa-btn-submit:hover:before {
    left: 100%;
}

.tppa-btn-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: none !important;
    outline: none !important;
}

.tppa-btn-submit:focus {
    border: none !important;
    outline: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.tppa-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    background: #9ca3af;
    color: white !important;
    border: none !important;
    outline: none !important;
}

.tppa-btn-submit:disabled:before {
    display: none;
}

/* Popup Trigger Button */
.tppa-popup-trigger {
    background: #FC933C;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.tppa-popup-trigger:hover {
    background: #e8832b;
    box-shadow: 0 4px 12px rgba(252, 147, 60, 0.25);
    text-decoration: none;
    color: white;
}

/* Error Messages */
.tppa-error-messages {
    margin-bottom: 16px;
}

.tppa-error-message {
    background: #fee;
    color: #c00;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    border: 1px solid #fcc;
}

/* Success Messages */
.tppa-success-message {
    background: #f0fdf4;
    color: #166534;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    border: 1px solid #bbf7d0;
}

/* Apple Pay Divider */
.tppa-divider {
    text-align: center;
    margin: 20px 0 16px;
    font-size: 12px;
    color: #999;
    position: relative;
}

.tppa-divider:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.tppa-divider span {
    background: white;
    padding: 0 12px;
    position: relative;
}

/* Apple Pay Button */
.tppa-apple-pay-container {
    margin-top: 16px;
}

.tppa-apple-pay-button {
    background: #000;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tppa-apple-pay-button img {
    height: 20px;
    width: auto;
}

/* Field Error States */
.tppa-field-error {
    border-color: #dc3545 !important;
}

/* Loading States */
.tppa-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.tppa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #FC933C;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .tppa-popup-overlay {
        padding: 10px;
    }
    
    .tppa-popup-container {
        max-width: 100%;
        border-radius: 8px;
    }
    
    .tppa-popup-header {
        padding: 20px 20px 16px;
    }
    
    .tppa-popup-header h2 {
        font-size: 18px;
    }
    
    .tppa-popup-body {
        padding: 20px;
    }
    
    .tppa-form-row {
        grid-template-columns: 1fr;
    }
    
    .tppa-back-wrapper {
        margin-top: 12px;
    }
}