/* =============================================
   CHECKOUT PAGE STYLES
   ============================================= */

main.container {
    padding: 40px 20px;
}

/* Page Navigation */
.page-nav {
    margin-bottom: 30px;
}

/* Product Selection */
.product-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
}

.product-select:last-child {
    margin-bottom: 0;
}

.product-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.product-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.product-header h3 {
    color: var(--rr-charcoal);
    margin-bottom: 5px;
}

.product-header .product-subtitle {
    margin-bottom: 0;
}

/* Package Bubble Picker */
.package-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .package-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.package-bubble {
    cursor: pointer;
    display: flex;
}

.package-bubble input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bubble-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-background);
    text-align: center;
    transition: all 0.2s ease;
    min-height: 130px;
    height: 100%;
    width: 100%;
}

.package-bubble:hover .bubble-content {
    border-color: var(--rr-gold);
    background: rgba(184, 155, 94, 0.03);
}

.package-bubble input[type="radio"]:checked + .bubble-content {
    border-color: var(--rr-gold);
    background: rgba(184, 155, 94, 0.08);
    box-shadow: 0 0 0 3px rgba(184, 155, 94, 0.15);
}

.bubble-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
}

.bubble-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.bubble-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--rr-charcoal);
    margin-top: 8px;
}

/* Recurring Toggle */
.recurring-toggle {
    margin-top: 25px;
    padding: 20px;
    background: var(--rr-bone);
    border: 1px solid var(--rr-border);
    border-radius: var(--rr-radius);
}

.toggle-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label strong {
    font-size: 1.1rem;
    color: var(--rr-charcoal);
}

.toggle-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 32px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--rr-gold);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

/* Policy Checkboxes */
.policy-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Payment Section */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.payment-method {
    padding: 15px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    text-align: center;
}

.payment-placeholder {
    margin-top: 25px;
    padding: 20px;
    background: #f0f0f0;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-light);
}

/* PayPal Integration Styles */
.payment-section {
    background: var(--card-background);
}

.payment-intro {
    margin-bottom: 20px;
    color: var(--text-light);
}

#paypal-button-container {
    max-width: 400px;
    margin: 20px auto;
}

.paypal-empty-state {
    padding: 30px;
    background: #f5f5f5;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-light);
}

.paypal-message {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.paypal-message.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.paypal-message.info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.paypal-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.payment-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: var(--rr-bone);
    border-radius: var(--rr-radius);
    font-size: 0.9rem;
    color: var(--rr-muted);
}

.lock-icon {
    font-size: 1.1rem;
}

/* Payment Processing Overlay */
#payment-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-content {
    background: white;
    padding: 40px 60px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.processing-content .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--rr-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.processing-content p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.processing-note {
    font-size: 0.9rem !important;
    color: var(--text-light) !important;
    margin-top: 10px !important;
}

/* Payment Success Page */
.payment-success {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--rr-gold);
    color: var(--rr-black);
    font-size: 40px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.payment-success h2 {
    color: var(--rr-charcoal);
    margin-bottom: 10px;
}

.success-message {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.order-confirmation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    text-align: left;
}

.order-confirmation h3 {
    margin-bottom: 15px;
    color: var(--rr-charcoal);
}

.confirmation-details p {
    margin: 8px 0;
}

.next-steps {
    text-align: left;
    margin-bottom: 30px;
}

.next-steps h3 {
    margin-bottom: 15px;
    color: var(--rr-charcoal);
}

.next-steps ul {
    padding-left: 20px;
}

.next-steps li {
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Order Summary */
.order-summary {
    background: var(--card-background);
    border: 1px solid var(--rr-gold);
}

#summary-items {
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-total {
    font-size: 1.3rem;
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid var(--rr-gold);
    color: var(--rr-charcoal);
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
    margin-bottom: 40px;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 0;
    text-align: center;
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
}

.modal-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.modal-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.modal-icon.info {
    background: #dbeafe;
    color: #2563eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-color);
}

.modal-body {
    padding: 20px 24px;
    text-align: center;
}

.modal-body p {
    margin: 0 0 12px;
    color: var(--text-light);
    line-height: 1.6;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body .distance-info {
    display: inline-block;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 8px 0;
}

.modal-body .contact-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.modal-body .contact-info a {
    color: var(--rr-gold);
    font-weight: 600;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-footer .btn {
    min-width: 120px;
}

.btn-modal-close {
    background: var(--rr-gold);
    color: var(--rr-black);
    border: none;
    padding: 12px 24px;
    border-radius: var(--rr-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-close:hover {
    background: #a08748;
}

.btn-modal-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-modal-secondary:hover {
    background: #f3f4f6;
    border-color: var(--text-light);
}

/* Responsive */
@media (max-width: 480px) {
    .product-header {
        flex-direction: column;
        text-align: center;
    }

    .product-thumb {
        width: 100px;
        height: 100px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}
