/* ============================================
   CHECKOUT RESPONSIVE & ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* ============================================
   TABLET DEVICES (768px and below)
   ============================================ */

@media (max-width: 991.98px) {
    /* Adjust sticky sidebar on tablets */
   

    /* Improve spacing on tablet */
    .checkout_accountBox,
    .checkout_billingBox,
    .checkout_paymentBox {
        padding: 1.5rem !important;
    }

    /* Reduce form padding */
    .form-group {
        margin-bottom: 1rem;
    }

    /* Better button sizing */
    .btn-third,
    .membershipFormBtn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }

    /* Improve progress bar visibility */
    .progress {
        height: 7px;
    }

    /* Better spacing for order summary */
    .checkout-form-col {
        display: block;
    }

    .checkout-form-column {
        min-height: auto;
    }

    #DivOrderSummary {
        margin-top: 0;
        padding-top: 0;
    }

    .checkout_orderSumaryMain {
        margin-top: 1.5rem;
        padding: 1.5rem;
    }
}

/* ============================================
   MOBILE DEVICES (576px and below)
   ============================================ */

@media (max-width: 575.98px) {
    /* Ensure readable text on small screens */
    body {
        font-size: 14px;
    }

    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 1rem;
    }

    /* Banner adjustments */
    .banner-heading {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    /* Stack form sections */
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Reduce form padding significantly */
    .checkout_accountBox,
    .checkout_billingBox,
    .checkout_paymentBox {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    /* Form input sizing */
    .form-control,
    .form-select,
    .stripe-input {
        font-size: 16px !important;
        padding: 0.6rem 0.75rem !important;
        border-radius: 4px;
    }

    /* Label sizing */
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    /* Button full width on mobile */
    .btn-third,
    .membershipFormBtn,
    button[type="submit"],
    button[type="button"] {
        width: 100% !important;
        padding: 0.7rem 1rem !important;
        font-size: 0.85rem !important;
        min-height: 42px;
    }

    /* Full width inputs */
    .couponCodeForm,
    .giftCardCodeForm {
        flex-direction: column;
        gap: 0.5rem;
    }

    .couponCodeForm input,
    .giftCardCodeForm input {
        width: 100% !important;
    }

    .couponCodeForm button,
    .giftCardCodeForm button {
        width: 100% !important;
    }

    /* Progress text smaller */
    .progressText {
        font-size: 0.85rem;
    }

    .progressText span {
        font-size: 1rem;
    }

    /* Progress bar height */
    .progress {
        height: 6px;
        margin-bottom: 1.5rem;
    }

    /* Order summary adjustments */
    .checkout_orderSumaryMain {
        padding: 1rem;
        margin-top: 1.5rem;
    }

    .checkout_orderSumaryMain table {
        font-size: 0.8rem;
    }

    .checkout_orderSumaryMain th,
    .checkout_orderSumaryMain td {
        padding: 0.5rem 0;
    }

    /* List items in benefits */
    .inner-content ul li {
        padding-left: 1.25rem;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    /* Reduce gap in payment method item */
    .payment-method-item {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    /* Alerts on mobile */
    .alert {
        padding: 0.75rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    /* Icons sizing */
    .svg-size,
    .plus-icon,
    .status-icon {
        max-width: 20px;
    }

    .svg-60 {
        max-width: 50px;
    }

    /* Hide secondary text on mobile */
    .inner-content p small,
    .checkout_orderSumaryMain small {
        font-size: 0.75rem;
    }

    /* Improve touchable areas */
    .form-check-input {
        width: 1.1rem;
        height: 1.1rem;
        margin-right: 0.5rem;
    }

    /* Reduce margins for compact layout */
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .pt-3 {
        padding-top: 0.75rem !important;
    }

    .pt-4 {
        padding-top: 1rem !important;
    }

    /* Better section spacing */
    section.packages-page {
        padding: 1rem 0 !important;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ============================================
   SMALL MOBILE DEVICES (320px - 374px)
   ============================================ */

@media (max-width: 374px) {
    /* Extremely compact layout */
    body {
        font-size: 13px;
    }

    .banner-heading {
        font-size: 1.25rem !important;
    }

    /* Minimal padding */
    .checkout_accountBox,
    .checkout_billingBox,
    .checkout_paymentBox {
        padding: 0.75rem !important;
    }

    /* Smaller buttons */
    .btn-third,
    .membershipFormBtn {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    /* Reduce form spacing */
    .form-group {
        margin-bottom: 0.75rem;
    }

    /* Single column layout */
    .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Tiny text for labels */
    .form-label {
        font-size: 0.8rem;
    }

    /* Reduce icon sizes */
    .status-icon {
        width: 18px;
        height: 18px;
        font-size: 0.75rem;
    }

    /* Hide non-essential text */
    .inner-content p:not(.mb-3) {
        display: none;
    }
}


/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Better focus states */
:focus-visible {
    outline: 2px solid var(--checkout-primary);
    outline-offset: 2px;
}

button:focus-visible,
.btn-third:focus-visible,
.btn-link-style:focus-visible {
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .form-control,
    .form-select {
        border-width: 3px;
    }

    .btn-third,
    .membershipFormBtn {
        border-width: 3px;
    }

    .progress-bar {
        background: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {

    .form-control,
    .form-select,
    .stripe-input {
        border-color: var(--color--primary) !important;
    }

    .checkout_orderSumaryMain {
        background: #fff;
        border-color: var(--checkout-border);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .hero-section,
    .btn,
    .btn-primary,
    .btn-third {
        display: none;
    }

    .checkout_orderSumaryMain {
        page-break-inside: avoid;
        border: 1px solid #000;
        padding: 0.5rem;
    }

    body {
        font-size: 12pt;
    }
}

/* ============================================
   UTILITY CLASSES FOR BETTER SPACING
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.gap-2 {
    gap: 0.5rem;
}

/* Better link styling for accessibility */
a[role="button"] {
    cursor: pointer;
    display: inline-block;
}

a[role="button"]:not([href]) {
    text-decoration: underline;
}

/* Loading state styles */
[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Form tooltip */
.form-tooltip {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    display: none;
    background: #f0f0f0;
    padding: 0.4rem;
    border-radius: 4px;
    border-left: 3px solid var(--checkout-primary);
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--checkout-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Better error message styling */
.invalid-feedback {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved form control interactions */
.form-control:disabled,
.form-select:disabled {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
}

/* Better placeholder styling */
::placeholder {
    opacity: 0.7;
}

/* Smooth transitions for all interactive elements */
button,
a,
input,
select,
textarea {
    transition: all 0.2s ease;
}

/* Better dropdown arrow on mobile */
@media (max-width: 575px) {
    .form-select {
        background-size: 14px 10px;
    }
}
