/**
 * CHECKOUT STYLES - PROFESSIONAL & MODERN
 * Inspired by details page design
 *
 * Design principles:
 * - Clean, professional look
 * - Modern cards with subtle shadows
 * - Elegant color palette
 * - Clear visual hierarchy
 * - Smooth interactions
 */

/* ============================================================
   1. CSS VARIABLES - Professional Color Palette
   ============================================================ */
:root {
    /* Primary Colors - Professional Blues */
    --checkout-primary: #0066cc;
    --checkout-primary-light: #e6f2ff;
    --checkout-primary-dark: #004999;

    /* Success & Status */
    --checkout-success: #10b981;
    --checkout-success-light: #d1fae5;
    --checkout-warning: #f59e0b;
    --checkout-danger: #ef4444;
    --checkout-info: #0891b2;

    /* Neutrals - Sophisticated Grays */
    --checkout-white: #ffffff;
    --checkout-gray-50: #fafafa;
    --checkout-gray-100: #f5f5f5;
    --checkout-gray-200: #e5e5e5;
    --checkout-gray-300: #d4d4d4;
    --checkout-gray-400: #a3a3a3;
    --checkout-gray-500: #737373;
    --checkout-gray-600: #525252;
    --checkout-gray-700: #404040;
    --checkout-gray-800: #262626;
    --checkout-gray-900: #171717;

    /* Design Tokens */
    --checkout-radius-sm: 0.5rem;
    --checkout-radius-md: 0.75rem;
    --checkout-radius-lg: 1rem;
    --checkout-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --checkout-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --checkout-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --checkout-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.16);
    --checkout-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. LAYOUT & CONTAINER
   ============================================================ */
.checkout-container {
    min-height: 70vh;
    background: var(--checkout-gray-50);
    padding: 2rem 0;
}

.checkout-mob {
    position: relative;
}

/* Loading Overlay - Modern Spinner */
.checkout-overlay {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    cursor: wait;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-overlay::after {
    content: '';
    width: 48px;
    height: 48px;
    border: 4px solid var(--checkout-gray-200);
    border-top-color: var(--checkout-primary);
    border-radius: 50%;
    animation: checkout-spin 0.8s linear infinite;
}

/* ============================================================
   3. PROGRESS NAVIGATION - Bootstrap Grid Style
   ============================================================ */
#checkout_menu {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    border: none;
    width: 100%;
}

#checkout_menu > div {
    width: 100%;
}

.checkout-navlink {
    position: relative;
    padding: 1rem 0.875rem;
    background: var(--checkout-white);
    color: var(--checkout-gray-500);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--checkout-transition);
    text-align: center;
    border: none;
    text-transform: none;
    border-radius: var(--checkout-radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.checkout-navlink:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    color: var(--checkout-gray-700);
}

/* Tab Layout - Icon on Left */
.checkout-navlink {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Step Icons - Left aligned */
.checkout-navlink i {
    display: inline-block;
    margin-bottom: 0;
    font-size: 1.5rem;
    opacity: 0.5;
    transition: var(--checkout-transition);
    flex-shrink: 0;
}

/* Completed Step - Neutral Gray */
.checkout-navlink.completed {
    background: #f8f9fa;
    color: #495057;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.checkout-navlink.completed i {
    opacity: 1;
    color: #28a745;
}

/* Active Step - Light Blue-Gray with Gradient */
.checkout-navlink.active {
    background: linear-gradient(135deg, #8b9aab, #7d8a96);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(125, 138, 150, 0.2);
}

.checkout-navlink.active i {
    opacity: 1;
    color: white;
}

/* ============================================================
   4. CHECKOUT BOXES - Compact Cards
   ============================================================ */
.checkout-box {
    background: var(--checkout-white);
    border-radius: var(--checkout-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
    transition: var(--checkout-transition);
    width: 100%;
}

/* Compact rows */
.checkout-box .row {
    margin-top: 0.75rem !important;
    margin-bottom: 0 !important;
}

.checkout-box .row:first-child {
    margin-top: 0 !important;
}

.checkout-box:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Box Titles - Clear Hierarchy */
.checkout-box > .fw-bold:first-child,
.checkout-box > span.fw-bold:first-child {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--checkout-gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.checkout-box > .fw-bold:first-child i,
.checkout-box > span.fw-bold:first-child i {
    color: var(--checkout-primary);
    font-size: 1.5rem;
}

.checkout-box > .fs-12,
.checkout-box > p.fs-12 {
    color: var(--checkout-gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Highlighted Boxes */
.checkout-box.highlight-info {
    border-left: 4px solid var(--checkout-info);
    background: linear-gradient(to right, rgba(8, 145, 178, 0.03), var(--checkout-white));
}

/* ============================================================
   5. PAYMENT METHODS - Delicate Separator Style
   ============================================================ */
#accordionCheckoutPaymethods,
#accordionCheckoutShipMethods {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.accordion-item.checkout-choice {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--checkout-white);
    overflow: hidden;
    transition: var(--checkout-transition);
    cursor: pointer;
    box-shadow: none;
}

.accordion-item.checkout-choice:first-child {
    border-top-left-radius: var(--checkout-radius-md);
    border-top-right-radius: var(--checkout-radius-md);
}

.accordion-item.checkout-choice:last-child {
    border-bottom-left-radius: var(--checkout-radius-md);
    border-bottom-right-radius: var(--checkout-radius-md);
    border-bottom: none;
}

.accordion-item.checkout-choice:hover {
    background: rgba(147, 197, 253, 0.03);
}

.accordion-item.checkout-choice .accordion-button {
    background: transparent;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--checkout-gray-800);
    transition: var(--checkout-transition);
    box-shadow: none !important;
}

/* Shipping methods - even more compact */
#accordionCheckoutShipMethods .accordion-item.checkout-choice .accordion-button {
    padding: 0.875rem 1.25rem;
}

.accordion-item.checkout-choice .accordion-button:hover {
    background: transparent;
}

.accordion-item.checkout-choice .accordion-button::after {
    display: none; /* Remove default Bootstrap arrow */
}

/* Selected Payment Method - Subtle Blue Background */
.accordion-item.checkout-choice .accordion-button.selected {
    background: rgba(147, 197, 253, 0.15);
    color: #1e40af;
    font-weight: 700;
}

.accordion-item.checkout-choice:has(.accordion-button.selected) {
    background: rgba(147, 197, 253, 0.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* Check Icons - Modern Design */
.checkout-choice .check-icon {
    font-size: 1.5rem;
    transition: var(--checkout-transition);
    margin-left: auto;
}

.checkout-choice .check-icon.gray {
    color: var(--checkout-gray-300);
}

.checkout-choice .check-icon.blue {
    color: var(--checkout-primary);
    animation: checkout-pulse 0.6s ease-out;
}

.checkout-choice .check-icon.red {
    color: var(--checkout-danger);
}

/* Payment Method Icons - Larger and Clearer */
.accordion-button img {
    max-height: 32px;
    margin-left: 0.75rem;
}

/* ============================================================
   6. FAST CHECKOUT - Borderless Buttons
   ============================================================ */
.fast-pay-button {
    width: 100%;
    min-height: 72px;
    background: var(--checkout-white);
    border: none;
    border-radius: var(--checkout-radius-md);
    cursor: pointer;
    transition: var(--checkout-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.fast-pay-button:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.15);
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.04), var(--checkout-white));
}

.fast-pay-button img {
    max-height: 48px;
    max-width: 90%;
    object-fit: contain;
    filter: grayscale(0.2);
    transition: var(--checkout-transition);
}

.fast-pay-button:hover img {
    filter: grayscale(0);
    transform: scale(1.05);
}

/* ============================================================
   7. DELIVERY OPTIONS - Clean Minimal Cards
   ============================================================ */
.checkout-delivery-option,
[class*="deliverymode"] {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: none !important;
    border-radius: var(--checkout-radius-md);
    background: var(--checkout-white);
    transition: var(--checkout-transition);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.checkout-delivery-option:hover,
[class*="deliverymode"]:hover {
    background: rgba(147, 197, 253, 0.08);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.08);
}

.checkout-delivery-option.selected,
[class*="deliverymode"].selected {
    background: rgba(147, 197, 253, 0.15);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.12);
}

.checkout-delivery-option i {
    color: #3b82f6;
    font-size: 2rem;
}

.checkout-delivery-option.selected i {
    animation: checkout-bounce 0.5s ease-out;
}

/* ============================================================
   8. FORM ELEMENTS & ERRORS
   ============================================================ */

/* Form Labels - More space above input */
.checkout-box label,
.checkout-box .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

/* Form Inputs - Standard padding */
.checkout-box .form-control,
.checkout-box .form-select,
.checkout-box input[type="text"],
.checkout-box input[type="email"],
.checkout-box input[type="tel"],
.checkout-box select {
    border: 1px solid #e5e7eb;
    border-radius: var(--checkout-radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: var(--checkout-transition);
    background: var(--checkout-white);
    margin-bottom: 0.25rem;
}

.checkout-box .form-control:focus,
.checkout-box .form-select:focus,
.checkout-box input:focus,
.checkout-box select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.1);
    outline: none;
}

.checkout-box textarea.form-control {
    margin-bottom: 0.5rem;
}

.checkout-section-errors {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #fef3c7;
    border-left: 4px solid var(--checkout-warning);
    border-radius: var(--checkout-radius-sm);
    color: #92400e;
    font-weight: 500;
    display: none;
}

.checkout-section-errors:not(:empty) {
    display: block;
    animation: checkout-slide-in 0.4s ease-out;
}

/* Guest Checkout / Login Options - Soft Shadows */
.checkout-box label.btn {
    transition: var(--checkout-transition);
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.checkout-box label.btn:hover {
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.checkout-box label.btn:has(input:checked) {
    background: rgba(147, 197, 253, 0.15) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* ============================================================
   9. SUMMARY PAGE - Compact & Icons
   ============================================================ */

/* Order Amount - Compact */
.checkout-box .card-header.bg-secondary {
    background: #f8f9fa !important;
    border: none !important;
    border-radius: var(--checkout-radius-md);
    padding: 0.875rem 1rem !important;
    margin-bottom: 1rem;
}

.order-actions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-actions .section-title {
    display: block;
    font-size: 0.8125rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

/* Checkout-specific: larger font and compact spacing */
.checkout-box .order-actions .section-title {
    margin-bottom: 0.25rem;
}

.checkout-box .order-actions .section-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Section Titles with Icons - Very Compact */
.checkout-box .h6 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.checkout-box .h6 i {
    color: #8b9aab;
    font-size: 0.9375rem;
}

.checkout-box .h6:first-child {
    margin-top: 0;
}

/* Summary sections - very compact */
.checkout-box .col-sm-5,
.checkout-box .col-sm-7 {
    margin-bottom: 0.5rem;
    padding-top: 0;
    padding-bottom: 0;
}

/* Text Readability */
.checkout-box .text-muted.small {
    color: #495057 !important;
    font-size: 0.875rem !important;
    line-height: 1.5;
    margin-bottom: 0.375rem;
}

/* Payment Method Display */
.checkout-box h5 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.375rem;
    margin-bottom: 0.375rem;
}

/* Summary Sidebar - Clean & Sticky */
@media (min-width: 992px) {
    .checkout-summary-sticky {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

/* ============================================================
   10. MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    #checkout_menu {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .checkout-navlink {
        font-size: 0.8125rem;
        padding: 0.875rem 0.625rem;
        gap: 0.5rem;
    }

    .checkout-navlink i {
        font-size: 1.25rem;
    }

    .checkout-box {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .fast-pay-button {
        min-height: 60px;
    }

    .fast-pay-button img {
        max-height: 36px;
    }
}

@media (max-width: 767px) {
    #checkout_menu {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .checkout-navlink {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
        justify-content: flex-start;
        text-align: left;
        gap: 0.75rem;
    }

    .checkout-navlink i {
        font-size: 1.5rem;
    }

    .checkout-box {
        padding: 1rem;
    }

    .checkout-box > .fw-bold:first-child,
    .checkout-box > span.fw-bold:first-child {
        font-size: 1.125rem;
    }

    .accordion-item.checkout-choice .accordion-button {
        padding: 1.25rem;
        font-size: 0.9375rem;
    }

    .checkout-delivery-option {
        padding: 1rem;
    }

    .checkout-delivery-option i {
        font-size: 2rem;
    }
}

/* ============================================================
   11. ANIMATIONS - Smooth & Professional
   ============================================================ */
@keyframes checkout-spin {
    to { transform: rotate(360deg); }
}

@keyframes checkout-checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes checkout-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes checkout-slide-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes checkout-bounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.05);
    }
}

/* ============================================================
   12. UTILITY CLASSES
   ============================================================ */
.checkout-regular-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--checkout-radius-sm);
    text-decoration: none;
    transition: var(--checkout-transition);
    font-weight: 600;
}

.checkout-regular-login:hover {
    box-shadow: var(--checkout-shadow-md);
}

.checkout-account-register-box {
    padding: 1.5rem;
    background: var(--checkout-gray-50);
    border-radius: var(--checkout-radius-md);
    border: 2px dashed var(--checkout-gray-300);
}

/* Next Button - Primary CTA */
.checkout-box .btn-info,
.checkout-box .btn-primary {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--checkout-radius-sm);
    transition: var(--checkout-transition);
    box-shadow: var(--checkout-shadow-sm);
}

.checkout-box .btn-info:hover,
.checkout-box .btn-primary:hover {
    box-shadow: var(--checkout-shadow-md);
}
