/* ============================================
   CHECKOUT - Layout
   ============================================ */

.checkout-section {
    min-height: 70vh;
}

.checkout-section .container {
    max-width: 1400px;
}

/* ============================================
   CHECKOUT - Order Summary
   ============================================ */

/* Order Items Scrollable List */
.order-items {
    max-height: 400px;
    overflow-y: auto;
}

.order-items::-webkit-scrollbar {
    width: 6px;
}

.order-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.order-items::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 10px;
}

.order-items::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* Mobile Fixed Bottom Summary */
@media (max-width: 991.98px) {
    /* Add padding bottom to avoid fixed footer overlap */
    body.checkout-page {
        padding-bottom: 100px;
    }
    
    .checkout-mobile-summary {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #dee2e6;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        padding: 1rem;
        z-index: 1000;
    }
}

/* ============================================
   CHECKOUT - Custom Wizard Steps
   ============================================ */

.checkout-wizard-steps {
    position: relative;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.checkout-wizard-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e5e7eb;
    transform: translateY(-50%);
    z-index: 0;
}

.wizard-step {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.wizard-step .step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 0.5rem;
    transition: all 0.3s ease;
    color: #9ca3af;
}

.wizard-step .step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.3s ease;
}

.wizard-step.active .step-number {
    border-color: #e74c3c;
    background-color: #e74c3c;
    color: white;
    transform: scale(1.1);
}

.wizard-step.active .step-label {
    color: #e74c3c;
    font-weight: 700;
}

.wizard-step.completed .step-number {
    border-color: #10b981;
    background-color: #10b981;
    color: white;
}

.wizard-step.completed .step-label {
    color: #10b981;
}

.wizard-step:hover .step-number {
    transform: scale(1.05);
}

/* Shipping & Payment Method Cards */
.shipping-method-card,
.payment-method-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.shipping-method-card:hover,
.payment-method-card:hover {
    border-color: #e74c3c;
    background-color: #fef5f5;
}

.shipping-method-card .form-check-input:checked ~ .form-check-label,
.payment-method-card .form-check-input:checked ~ .form-check-label {
    border-color: #e74c3c !important;
}

.shipping-method-card .form-check-input:checked,
.payment-method-card .form-check-input:checked {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.form-check-input {
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
}

/* ============================================
   CHECKOUT - Product Review Table
   ============================================ */

.checkout-page .table-responsive {
    max-height: 500px;
    overflow-y: auto;
}

.checkout-page .table > tbody > tr > td {
    vertical-align: middle;
}

.checkout-page .table .form-control-sm {
    max-width: 80px;
}

.checkout-page .table .btn-outline-danger:hover {
    color: white;
    background-color: #e74c3c;
    border-color: #e74c3c;
}

/* ============================================
   CHECKOUT - Form Sections
   ============================================ */

.checkout-section {
    margin-bottom: 2rem;
}

.checkout-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

/* Radio/Checkbox Custom Styling */
.fi-fo-radio-input:checked + .fi-fo-radio-label {
    border-color: #e74c3c !important;
    background-color: #fef5f5 !important;
}

.fi-fo-checkbox-input:checked + .fi-fo-checkbox-label {
    border-color: #e74c3c !important;
}

/* ============================================
   CHECKOUT - Order Summary Card
   ============================================ */

.checkout-summary-card {
    position: sticky;
    top: 100px;
    z-index: 1;
}

/* Ensure main wizard content has proper stacking */
.checkout-main-content {
    position: relative;
    z-index: 10;
}

/* Ensure Filament modals and popovers appear above everything */
.fi-modal-window,
.fi-dropdown-panel {
    z-index: 9999 !important;
}

/* Ensure backdrop is below modals */
.fi-modal-backdrop {
    z-index: 9998 !important;
}

/* Fix for address/company cards that might be too tall */
.checkout-main-content .card {
    margin-bottom: 1rem;
}

/* Prevent sticky summary from overlapping on smaller screens */
@media (min-width: 992px) {
    .checkout-summary-card {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

.checkout-summary-header {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.checkout-summary-body {
    padding: 1.5rem;
}

.checkout-product-item {
    display: flex;
    align-items-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.checkout-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.checkout-product-details {
    flex-grow: 1;
}

.checkout-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #374151;
}

.checkout-product-quantity {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.checkout-product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e74c3c;
}

/* Order Totals */
.checkout-totals {
    margin-top: 1.5rem;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.checkout-total-row.final {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
    font-size: 1.25rem;
    font-weight: 700;
}

.checkout-total-amount {
    color: #e74c3c;
}

/* ============================================
   CHECKOUT - Product Cards
   ============================================ */

.checkout-product-card {
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.checkout-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.checkout-product-header h6 {
    font-size: 1rem;
    line-height: 1.4;
    color: #2d3748;
}

.checkout-product-card .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

.checkout-product-card .btn-outline-danger,
.checkout-product-card .btn-outline-success {
    border-width: 2px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.checkout-product-card .btn-outline-danger:hover {
    transform: scale(1.05);
}

.checkout-product-card .btn-outline-success:hover {
    transform: scale(1.05);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 991.98px) {
    .checkout-summary-card {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    /* Product Cards - Mobile Optimized */
    .checkout-product-card {
        margin-bottom: 1rem;
    }
    
    .checkout-product-card .card-body {
        padding: 1rem !important;
    }
    
    .checkout-product-header h6 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem !important;
    }
    
    .checkout-product-header .badge {
        font-size: 0.7rem;
    }
    
    .checkout-product-header .text-muted {
        font-size: 0.75rem;
    }
    
    /* Quantity and Price Sections */
    .checkout-product-card .text-muted.small {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem !important;
    }
    
    .checkout-product-card .btn-sm {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem;
    }
    
    .checkout-product-card .form-control-sm {
        height: 36px;
        font-size: 1rem;
    }
    
    /* Price styling on mobile */
    .checkout-product-card .fs-5 {
        font-size: 1.1rem !important;
    }
    
    /* Delete button on mobile */
    .checkout-product-card .btn.w-100 {
        padding: 0.6rem 1rem;
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    /* Summary card images */
    .checkout-product-image {
        width: 50px;
        height: 50px;
    }
    
    .checkout-product-name {
        font-size: 0.85rem;
    }
    
    .checkout-product-quantity,
    .checkout-product-price {
        font-size: 0.8rem;
    }
    
    /* Filament wizard on mobile */
    .fi-wi-step-label {
        font-size: 0.8rem !important;
    }
    
    /* Wizard container spacing */
    #wizard-container {
        padding: 0.5rem;
    }
    
    /* Section headings on mobile */
    .fi-section-header {
        padding: 1rem 0.5rem !important;
    }
    
    .fi-section-content {
        padding: 0.5rem !important;
    }
    
    /* Next/Previous buttons on mobile */
    .fi-wi-actions {
        padding: 1rem 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .fi-wi-actions .fi-btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 575.98px) {
    .checkout-product-card .card-body {
        padding: 0.85rem !important;
    }
    
    .checkout-product-card .row.g-2 {
        margin: 0;
        gap: 0;
    }
    
    .checkout-product-card .col-12 {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Quantity section spacing */
    .checkout-product-card .col-12.mb-2 {
        margin-bottom: 1rem !important;
    }
    
    /* Price font size adjustment */
    .checkout-product-card p[style*="font-size: 1.25rem"] {
        font-size: 1.15rem !important;
    }
}

/* ============================================
   CHECKOUT - Confirmation Step
   ============================================ */

.checkout-confirmation-section {
    margin-bottom: 1.5rem;
}

.checkout-confirmation-section .card {
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.checkout-confirmation-section .card-header {
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.checkout-confirmation-section .card-body {
    padding: 1.25rem;
}

.checkout-confirmation-section .table {
    margin-bottom: 0;
}

.checkout-confirmation-section .table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.checkout-confirmation-section .table td {
    vertical-align: middle;
}

.checkout-confirmation-section .bg-light {
    background-color: #f8f9fa !important;
}

.checkout-confirmation-section .badge {
    font-size: 0.875rem;
    padding: 0.35em 0.65em;
}

/* Responsive table for confirmation */
@media (max-width: 767.98px) {
    .checkout-confirmation-section .table-responsive {
        font-size: 0.85rem;
    }
    
    .checkout-confirmation-section .card-body {
        padding: 1rem;
    }
}

/* ============================================
   CHECKOUT - Selector Cards (Address, Shipping, Payment, Billing, Company)
   ============================================ */

/* Hide default radio buttons */
.address-radio-input,
.shipping-radio-input,
.payment-radio-input,
.billing-type-radio-input,
.company-radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Custom radio indicator (shared across all selectors) */
.custom-radio-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.custom-radio-indicator i {
    font-size: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-radio-indicator.selected {
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.custom-radio-indicator.selected i {
    opacity: 1;
}

/* Card styling - Address */
.address-card {
    cursor: pointer;
    border-width: 2px !important;
}

.address-card:hover {
    border-color: #dc3545 !important;
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px);
}

.address-card:hover .custom-radio-indicator {
    border-color: #dc3545;
}

/* Card styling - Shipping */
.shipping-card {
    cursor: pointer;
    border-width: 2px !important;
}

.shipping-card:hover {
    border-color: #dc3545 !important;
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px);
}

.shipping-card:hover .custom-radio-indicator {
    border-color: #dc3545;
}

/* Price badge styling for shipping */
.shipping-card .badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shipping-card:hover .badge {
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Card styling - Payment */
.payment-card {
    cursor: pointer;
    border-width: 2px !important;
}

.payment-card:hover {
    border-color: #dc3545 !important;
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px);
}

.payment-card:hover .custom-radio-indicator {
    border-color: #dc3545;
}

.payment-card:hover .fa-3x {
    color: #dc3545 !important;
}

/* Card styling - Billing Type */
.billing-type-selector label {
    margin-bottom: 0;
}

.billing-type-card {
    cursor: pointer;
    border-width: 2px !important;
}

.billing-type-card:hover {
    border-color: #dc3545 !important;
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px);
}

.billing-type-card:hover .custom-radio-indicator {
    border-color: #dc3545;
}

.billing-type-card:hover .fa-user,
.billing-type-card:hover .fa-building {
    color: #dc3545 !important;
}

/* Card styling - Company */
.company-card {
    cursor: pointer;
    border-width: 2px !important;
}

.company-card:hover {
    border-color: #dc3545 !important;
    box-shadow: 0 0.25rem 0.5rem rgba(220, 53, 69, 0.15) !important;
    transform: translateY(-2px);
}

.company-card:hover .custom-radio-indicator {
    border-color: #dc3545;
}

