/**
 * Modern Checkout Page Styles
 * Inspired by Zooplus checkout design with clean, user-friendly interface
 * 
 * Features:
 * - Responsive card-based layout
 * - Clear visual hierarchy
 * - Mobile-first approach
 * - Accessible form controls
 */

/* ========================================
   Progress Indicator
   ======================================== */

.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 2rem;
    max-width: 785px;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #757575;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #1976d2;
    color: white;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.step-label {
    font-size: 0.85rem;
    color: #757575;
    text-align: center;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: #1976d2;
    font-weight: 600;
}

.progress-connector {
    height: 2px;
    flex: 1;
    background: #e0e0e0;
    margin: 0 1rem;
    margin-bottom: 2rem;
    min-width: 40px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .checkout-progress {
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }
    
    .step-label {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .progress-connector {
        min-width: 20px;
        margin: 0 0.5rem;
    }
}

/* ========================================
   Main Container
   ======================================== */

.checkout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    zoom: 90%;
}

.checkout-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #212121;
    margin-bottom: 0.5rem;
}

.checkout-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #757575;
    margin-bottom: 2rem;
}

/* ========================================
   Alert Messages
   ======================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ========================================
   Tab Navigation
   ======================================== */

.checkout-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto 2rem;
    max-width: 1400px;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 200px;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1976d2;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-button:hover {
    border-color: #1976d2;
    background: #f5f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
}

.tab-button.active {
    border-color: #1976d2;
    background: #e3f2fd;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.2);
}

.tab-button.active::before {
    transform: scaleX(1);
}

.tab-button i {
    font-size: 1.75rem;
    color: #757575;
    transition: all 0.3s ease;
}

.tab-button:hover i,
.tab-button.active i {
    color: #1976d2;
    transform: scale(1.1);
}

.tab-button span {
    font-weight: 600;
    font-size: 0.95rem;
    color: #424242;
    text-align: center;
}

.tab-button.active span {
    color: #1976d2;
}

@media (max-width: 768px) {
    .checkout-tabs {
        flex-direction: column;
        max-width: 100%;
    }
    
    .tab-button {
        min-width: auto;
        flex-direction: row;
        justify-content: center;
        padding: 1rem 1.25rem;
    }
    
    .tab-button i {
        font-size: 1.5rem;
    }
}

/* ========================================
   Tab Content
   ======================================== */

.checkout-tab-content {
    max-width: 1400px;
    margin: 0 auto;
    display: none;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
    display: block;
}

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

/* ========================================
   Checkout Cards
   ======================================== */

.checkout-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.card-header {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    padding: 1rem 2rem 0.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: #1976d2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #212121;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.9rem;
    color: #757575;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

/* custom scrollbar for card body */
.card-body::-webkit-scrollbar {
    width: 8px;
}

.card-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* ========================================
   Benefits List
   ======================================== */

.benefits-list {
    background: #f5f9ff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #424242;
}

.benefit-item i {
    color: #4caf50;
    font-size: 1.1rem;
}

/* ========================================
   Form Styles
   ======================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    /*display: grid;*/
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
}

.form-group-small {
    grid-column: span 1;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    font-weight: 500;
    color: #424242;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    margin-left: 7px;
}

.form-input,
.form-select,
select.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-input::placeholder {
    color: #9e9e9e;
}

/* ========================================
   Radio Groups
   ======================================== */

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
}

.radio-label:hover {
    border-color: #1976d2;
    background-color: #f5f9ff;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #1976d2;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #1976d2;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #1976d2;
    background-color: #e3f2fd;
}

.radio-label span {
    font-size: 0.95rem;
    color: #424242;
}

/* Mobile adjustments for radio groups */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ========================================
   Checkbox Groups
   ======================================== */

.checkbox-group {
    margin-bottom: 1.6rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 18px;
    margin-top: 0;
    zoom: 150%;
    margin-left: 0;
    float: left;
}

.checkbox-label span {
    flex: 1;
    font-size: 0.9rem;
    color: #424242;
    line-height: 2.1;
}

.checkbox-label a {
    color: #1976d2;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
}

/* ========================================
   Info Box
   ======================================== */

.info-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 1rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.info-box i {
    color: #f57c00;
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.info-box span {
    flex: 1;
    font-size: 0.9rem;
    color: #e65100;
    line-height: 1.5;
}

/* ========================================
   Form Errors
   ======================================== */

.form-error {
    background: #ffebee;
    color: #c62828;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid #ef9a9a;
}

.field-error {
    display: block;
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.form-input:invalid:not(:placeholder-shown),
.form-input.error {
    border-color: #ef5350;
}

/* ========================================
   Form Hints
   ======================================== */

.form-hint {
    display: block;
    color: #757575;
    font-size: 0.8rem;
    margin-top: 0.375rem;
    font-style: italic;
    margin-left: 7px;
}

/* ========================================
   Form Divider
   ======================================== */

.form-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 2rem 0 1.5rem;
}

.form-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #424242;
    margin-bottom: 1.25rem;
}

/* ========================================
   Form Footer
   ======================================== */

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
}

.link-secondary {
    color: #1976d2;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.link-secondary:hover {
    text-decoration: underline;
}

/* ========================================
   Loading States
   ======================================== */

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Address Display
   ======================================== */

.address-display {
    background: #f5f9ff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
    border: 2px solid #e3f2fd;
}

.address-display p {
    margin: 0.25rem 0;
    color: #424242;
    line-height: 1.6;
}

.address-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1976d2;
    margin-bottom: 0.5rem !important;
}

/* ========================================
   Checkbox Toggle
   ======================================== */

.checkbox-toggle {
    background: #f5f9ff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
}

.checkbox-toggle:hover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.checkbox-toggle input[type="checkbox"]:checked + span {
    color: #1976d2;
    font-weight: 600;
}

/* ========================================
   Shipping Methods Grid
   ======================================== */

.shipping-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .shipping-methods-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Shipping Method Card
   ======================================== */

.shipping-method-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    height: 100%;
}

.shipping-method-label {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
}

.shipping-method-card:hover .shipping-method-label {
    border-color: #1976d2;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.15);
    transform: translateY(-2px);
}

.shipping-method-card.selected .shipping-method-label {
    border-color: #1976d2;
    background: #e3f2fd;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.2);
}

.shipping-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.shipping-method-header i {
    font-size: 1.75rem;
    color: #757575;
    transition: color 0.3s ease;
}

.shipping-method-card.selected .shipping-method-header i {
    color: #1976d2;
}

.shipping-method-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212121;
}

.shipping-method-body {
    margin-bottom: 1rem;
}

.shipping-method-description {
    font-size: 0.9rem;
    color: #757575;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.shipping-method-cost {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212121;
}

.cost-free {
    color: #4caf50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cost-free i {
    font-size: 1.2rem;
}

.cost-amount {
    color: #1976d2;
}

.cost-surcharge {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #757575;
    margin-top: 0.25rem;
}

.shipping-method-delivery-time {
    font-size: 0.9rem;
    color: #ff6f00;
    margin-top: 0.75rem;
    font-weight: 500;
    padding: 0.5rem;
    background: #fff3e0;
    border-radius: 4px;
    border-left: 3px solid #ff6f00;
}

.shipping-method-checkmark {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.shipping-method-card.selected .shipping-method-checkmark {
    color: #4caf50;
    transform: scale(1.2);
}

/* ========================================
   No Shipping Methods
   ======================================== */

.no-shipping-methods {
    text-align: center;
    padding: 2rem;
}

.no-shipping-methods .alert {
    margin-bottom: 1.5rem;
    text-align: left;
}

.no-shipping-methods .alert i {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.no-shipping-methods .alert div {
    flex: 1;
}

.no-shipping-methods .alert strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-shipping-methods .alert p {
    margin: 0.5rem 0;
}

/* ========================================
   Checkout Actions
   ======================================== */

.checkout-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkout-actions .btn {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 480px) {
    .checkout-actions {
        flex-direction: column;
    }
    
    .checkout-actions .btn {
        min-width: 88%;
    }
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
    box-shadow: 0 4px 12px rgba(117, 117, 117, 0.3);
}

/* ========================================
   Loading Animation
   ======================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease-in-out infinite;
}

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

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .checkout-progress,
    .btn,
    .card-icon {
        display: none;
    }
    
    .checkout-card {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        page-break-inside: avoid;
    }
}

label.checkbox-label.checkbox-toggle {
    margin-left: 0px;
    zoom: 120%;
}

/* ========================================
   Payment Method Disabled State
   ======================================== */

.shipping-method-label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.shipping-method-card:has(.shipping-method-label.disabled):hover .shipping-method-label {
    border-color: #e0e0e0;
    box-shadow: none;
    transform: none;
}

.payment-disabled-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #856404;
}

.payment-disabled-info i {
    color: #ffc107;
    margin-right: 0.5rem;
}

.payment-disabled-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.payment-disabled-link:hover {
    text-decoration: underline;
}

/* ========================================
   Birthdate Dropdowns
   ======================================== */

.birthdate-selects {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.birthdate-selects .birthdate-field {
    flex: 1;
    min-width: 0;
}

.birthdate-selects .birthdate-field.day-field {
    flex: 0.8;
}

.birthdate-selects .birthdate-field.month-field {
    flex: 1.4;
}

.birthdate-selects .birthdate-field.year-field {
    flex: 1;
}

.birthdate-selects label {
    display: block;
    font-size: 0.75rem;
    color: #757575;
    margin-bottom: 0.25rem;
    margin-left: 4px;
}

.birthdate-selects select {
    width: 100%;
    padding: 0.75rem 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    appearance: none;
    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='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.birthdate-selects select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

@media (max-width: 480px) {
    .birthdate-selects {
        gap: 0.5rem;
    }
    
    .birthdate-selects select {
        padding: 0.65rem 0.4rem;
        font-size: 0.95rem;
        padding-right: 1.25rem;
        background-position: right 0.35rem center;
    }
    
    .birthdate-selects label {
        font-size: 0.7rem;
    }
}