/* Main popup styles */
.dcp-hidden {
    display: none !important;
}

#dcp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dcp-popup-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 0;
    position: relative;
    font-family: Oswald;
    max-height: 97vh;
    overflow-y: auto;
    color: #000;
}

#dcp-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    line-height: 24px;
    cursor: pointer;
    color: #888;
    z-index: 10;
}

#dcp-popup-close:hover {
    color: #333;
}

/* Header Section */
.dcp-header-section {
    background: #f8f8f8;
    padding: 20px;
    text-align: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #eee;
}

.dcp-logo-container {
    margin: 0 auto;
    max-width: 90px;
    display: flex;
}

.dcp-logo {
    max-width: 100%;
    height: auto;
}

/* Form Content */
.dcp-form-content {
    padding: 20px;
}

/* Step styles */
.dcp-step {
    margin-bottom: 0;
    transition: opacity 0.15s ease;
    width: 100%;
    position: relative;
}

.dcp-step .dcp-heading {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    color: #333;
    padding: 8px 10px;
    border: 2px solid #e6c2004a;
    border-radius: 8px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Regular step h2 (for other headings) */
.dcp-step h2 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.5px;
    text-align: center;
}

/* Form styles */
.dcp-form-group {
    margin-bottom: 15px;
    position: relative;
}

.dcp-form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

.dcp-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f9f9f9;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.dcp-form-group input:focus {
    outline: none;
    border-color: #0073aa;
    background-color: #fff;
    box-shadow: inset 0 1px 5px rgba(0,115,170,0.15);
}

/* Input warning styles */
.dcp-form-group input.dcp-input-warning {
    border-color: #ff9800;
    background-color: #fff9f0;
}

.dcp-input-hint {
    color: #ff9800;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

/* Error message styles */
.dcp-form-error {
    background-color: #fff4f4;
    color: #e53935;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #e53935;
    font-size: 14px;
}

.dcp-form-actions {
    margin-top: 25px;
    text-align: center;
}

/* Button styles - Base styles for all buttons */
.dcp-button, 
.dcp-trigger-button, 
.dcp-elementor-button {
    padding: 14px 28px;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 22px;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Original blue style for trigger/elementor buttons */
.dcp-trigger-button, 
.dcp-elementor-button {
    background: #0073aa;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.dcp-trigger-button:hover, 
.dcp-elementor-button:hover {
    background: #005a87;
}

/* Gradient style only for form buttons */
.dcp-button {
    background: linear-gradient(135deg, #0088cc 0%, #0056b3 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 5px rgba(0,0,0,0.15);
    font-family: 'Oswald';
}

.dcp-button:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0));
    border-radius: 5px 5px 0 0;
}

.dcp-button:hover {
    background: linear-gradient(135deg, #0099e6 0%, #0062cc 100%);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 3px 7px rgba(0,0,0,0.2);
}

.dcp-button:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.15);
}

.dcp-button-back {
    background: transparent;
    color: #0073aa;
    border: none;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    margin-bottom: 10px;
    display: block;
}

.dcp-button-back:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Secure text and trust badge */
.dcp-secure-text {
    text-align: center;
    text-transform: uppercase;
    font-size: 11px;
    color: #bbb;
    margin-top: 5px;
}

.dcp-trust-badge {
    text-align: center;
    margin-top: 10px;
}

.dcp-trust-badge img {
    max-width: 95%;
    height: auto;
}

/* Product details styles */
#dcp-product-details {
    margin: 20px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 4px;
}

#dcp-product-title {
    font-size: 20px;
    margin-bottom: 10px;
}

#dcp-product-description {
    font-size: 14px;
}

/* Order summary table */
.dcp-order-summary {
    margin: 15px 0;
}

.dcp-order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: transparent;
}

.dcp-order-table th,
.dcp-order-table td {
    padding: 8px 4px;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eee;
    color: #000;
}

.dcp-order-table th:last-child,
.dcp-order-table td:last-child {
    text-align: right;
}

.dcp-order-table th {
    font-weight: bold;
}

.dcp-order-total {
    font-weight: bold;
}

.dcp-order-total td {
    padding-top: 10px;
}

/* Stripe elements */
#dcp-payment-elements {
    margin: 0 0 20px 0;
}

#stripe-card-element {
  padding: 13px 15px !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 6px;
  background: #f9f9f9 !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05) !important;
  transition: all 0.3s ease;
}

#stripe-card-element.StripeElement--focus {
    background-color: #fff !important;
    box-shadow: inset 0 1px 2px rgba(0,115,170,0.1) !important;
}

#stripe-card-errors {
    color: #fa755a;
    text-align: center;
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #fff4f4;
    border-radius: 5px;
    border-left: 4px solid #fa755a;
    display: none;
    font-size: 14px;
}

#stripe-card-errors.dcp-error-visible {
    display: block;
}

/* Loading overlay */
#dcp-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.dcp-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: dcp-spin 1s linear infinite;
}

@keyframes dcp-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success message */
#dcp-success {
    text-align: center;
}

#dcp-success h2 {
    color: #4CAF50;
}

#dcp-order-number {
    font-weight: bold;
}

/* Promotional Offer Styles */
.dcp-promo-section {
    background: #f8fff8;
    border: 1px solid #e0f0e0;
    border-radius: 6px;
    padding: 15px;
    font-family: system-ui;
    margin-bottom: 20px;
    position: relative;
}

#dcp-promo-original {
    text-decoration: line-through;
}

.dcp-promo-header {
    margin-bottom: 10px;
}

.dcp-promo-label {
    background: #4CAF50;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
}

.dcp-promo-title {
    font-size: 18px;
    margin: 10px 0;
    color: #333;
}

.dcp-promo-description {
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.dcp-promo-highlight {
    color: #4CAF50;
    font-weight: bold;
}

.dcp-promo-action {
    text-align: left;
}

/* Checkbox container */
.dcp-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.dcp-checkbox-container input {
    margin-right: 8px;
}

.dcp-checkbox-label {
    font-weight: 600;
}

.dcp-promo-arrow {
    position: relative;
    margin-left: 10px;
    color: #4CAF50;
    font-weight: bold;
    display: inline-block;
    right: 0;
}

/* Apple Pay container */
#dcp-apple-pay-element {
    margin-bottom: 15px;
    min-height: 48px; /* Match the height of the Apple Pay button */
}

/* Payment option separator */
.dcp-payment-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 15px 0;
    color: #777;
}

.dcp-payment-separator::before,
.dcp-payment-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.dcp-payment-separator span {
    margin: 0 10px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Upsell container styles */
.dcp-upsell-container {
    text-align: center;
    position: relative;
}

.dcp-upsell-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    margin-bottom: 15px;
}

.dcp-upsell-button:hover {
    background: linear-gradient(135deg, #5CBF60 0%, #4CAF50 100%);
}

.dcp-button-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    font-size: 14px;
    text-transform: none;
    font-weight: normal;
}

.dcp-button-secondary:hover {
    background: #f8f8f8;
    color: #333;
}

.dcp-upsell-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Animated gradient background for upsell accept button */
.dcp-gradient-animated {
    background: linear-gradient(-45deg, #3498db, #87ceeb, #ff6b6b, #ffa500);
    background-size: 400% 400%;
    animation: gradientShift 3s ease-in-out infinite;
    color: white !important;
    border: none !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100% !important; /* Make button full width */
    display: block !important; /* Ensure it takes full width */
}

.dcp-gradient-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    animation-duration: 1.5s; /* Speed up animation on hover */
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Skip link styling */
.dcp-skip-upsell-link {
    display: inline-block;
    color: #999999;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    transition: color 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.dcp-skip-upsell-link:hover {
    color: #666666;
    text-decoration: underline;
    opacity: 0.8;
}

.dcp-skip-upsell-link:focus {
    outline: 1px dotted #999999;
    outline-offset: 2px;
}

/* Container styling */
.dcp-upsell-accept-container {
    position: relative;
    width: 100%; /* Ensure container is full width */
}

.dcp-skip-upsell-container {
    position: relative;
}

.dcp-upsell-accept-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    outline: none;
    display: block; /* Make button block level */
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    border-radius: 8px;
    padding: 15px 30px;
    transition: all 0.3s ease;
    width: 100%; /* Full width */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Override any Elementor button styles that might interfere */
.elementor-widget .dcp-upsell-accept-button.dcp-gradient-animated {
    background: linear-gradient(-45deg, #3498db, #87ceeb, #ff6b6b, #ffa500) !important;
    background-size: 400% 400% !important;
    animation: gradientShift 3s ease-in-out infinite !important;
    color: white !important;
    width: 100% !important;
    display: block !important;
}

/* Ensure the widget container doesn't restrict width */
.elementor-widget-dcp_upsell_accept_widget {
    width: 100%;
}

.elementor-widget-dcp_upsell_accept_widget .elementor-widget-container {
    width: 100%;
}

/* Loading state for both widgets */
.dcp-upsell-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.dcp-upsell-loading .dcp-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.dcp-upsell-loading p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

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

/* Responsive styles */
@media (max-width: 768px) {
    /* Prevent iOS body scrolling when popup is active */
    body.dcp-popup-open {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        -webkit-overflow-scrolling: auto;
    }
    
    #dcp-popup-overlay {
        /* Change from flex centering to allow proper scrolling */
        display: block;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 15px 0;
        align-items: flex-start;
        justify-content: center;
    }
    
    #dcp-popup-container {
        max-height: none; /* Remove height restriction on mobile */
        margin: 15px auto;
        width: 95%;
        transform: translateZ(0); /* Force hardware acceleration */
    }
    
    /* Improve touch targets on mobile */
    .dcp-button,
    .dcp-trigger-button,
    .dcp-elementor-button {
        padding: 16px 20px; /* Larger touch target */
        -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    }
    
    /* Ensure inputs don't trigger zoom on iOS */
    .dcp-form-group input,
    #stripe-card-element {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better scrolling for steps */
    .dcp-step {
        -webkit-overflow-scrolling: touch;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        perspective: 1000;
        -webkit-perspective: 1000;
    }
}

/* Safari-specific fixes */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        /* Fix for Safari rendering issues */
        .dcp-step {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        /* Ensure transitions are smooth in Safari */
        #dcp-popup-container {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
    }
}