/* ==========================================================================
   EasyRentalGuru - Mobile-First Responsive CSS
   Breakpoints:
   - xs: 0-575px (mobile portrait)
   - sm: 576-767px (mobile landscape)
   - md: 768-991px (tablet)
   - lg: 992-1199px (desktop)
   - xl: 1200px+ (large desktop)
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties for Responsive Design
   ========================================================================== */
:root {
    /* Touch target sizes */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
    
    /* Container padding */
    --container-padding-x: 16px;
    --container-padding-y: 16px;
    
    /* Grid gaps */
    --grid-gap-xs: 8px;
    --grid-gap-sm: 12px;
    --grid-gap-md: 16px;
    --grid-gap-lg: 24px;
    
    /* Safe areas for notched devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   Base Mobile Styles (xs: 0-575px)
   ========================================================================== */

/* Container - full width on mobile with safe padding */
.container {
    width: 100%;
    padding-left: var(--container-padding-x);
    padding-right: var(--container-padding-x);
    margin-left: auto;
    margin-right: auto;
}

.container-fluid {
    width: 100%;
    padding-left: var(--container-padding-x);
    padding-right: var(--container-padding-x);
}

/* Responsive Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: calc(var(--grid-gap-xs) * -1);
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding: var(--grid-gap-xs);
}

/* Column utilities for mobile */
.col { flex: 1 0 0%; padding: var(--grid-gap-xs); }
.col-auto { flex: 0 0 auto; width: auto; padding: var(--grid-gap-xs); }
.col-1 { flex: 0 0 auto; width: 8.333333%; padding: var(--grid-gap-xs); }
.col-2 { flex: 0 0 auto; width: 16.666667%; padding: var(--grid-gap-xs); }
.col-3 { flex: 0 0 auto; width: 25%; padding: var(--grid-gap-xs); }
.col-4 { flex: 0 0 auto; width: 33.333333%; padding: var(--grid-gap-xs); }
.col-5 { flex: 0 0 auto; width: 41.666667%; padding: var(--grid-gap-xs); }
.col-6 { flex: 0 0 auto; width: 50%; padding: var(--grid-gap-xs); }
.col-7 { flex: 0 0 auto; width: 58.333333%; padding: var(--grid-gap-xs); }
.col-8 { flex: 0 0 auto; width: 66.666667%; padding: var(--grid-gap-xs); }
.col-9 { flex: 0 0 auto; width: 75%; padding: var(--grid-gap-xs); }
.col-10 { flex: 0 0 auto; width: 83.333333%; padding: var(--grid-gap-xs); }
.col-11 { flex: 0 0 auto; width: 91.666667%; padding: var(--grid-gap-xs); }
.col-12 { flex: 0 0 auto; width: 100%; padding: var(--grid-gap-xs); }

/* Offset columns */
.offset-1 { margin-left: 8.333333%; }
.offset-2 { margin-left: 16.666667%; }
.offset-3 { margin-left: 25%; }
.offset-4 { margin-left: 33.333333%; }
.offset-5 { margin-left: 41.666667%; }
.offset-6 { margin-left: 50%; }
.offset-7 { margin-left: 58.333333%; }
.offset-8 { margin-left: 66.666667%; }
.offset-9 { margin-left: 75%; }
.offset-10 { margin-left: 83.333333%; }
.offset-11 { margin-left: 91.666667%; }

/* ==========================================================================
   Touch Target Improvements (Accessibility)
   Ensures all interactive elements are at least 44x44px
   ========================================================================== */

/* Base touch target sizing */
button, 
[role="button"],
.btn,
.nav-link,
.navbar-toggler,
.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
.custom-select,
.dropdown-toggle,
.pagination .page-link,
.list-group-item-action {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
}

/* Checkbox and radio touch targets */
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
}

/* Larger checkbox/radio labels for easier touch */
.form-check-label {
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

/* Icon buttons */
.btn-icon {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Increase padding for mobile buttons */
.btn {
    padding: 12px 20px;
    font-size: 16px; /* Prevent zoom on iOS */
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 18px;
}

/* ==========================================================================
   Form Mobile Optimizations
   ========================================================================== */

/* Form layout for mobile */
.form-layout {
    display: grid;
    gap: var(--grid-gap-md);
}

/* Mobile: single column (default) */
.form-layout {
    grid-template-columns: 1fr;
}

.form-field {
    margin-bottom: var(--grid-gap-md);
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
}

/* Inputs - 16px font-size prevents zoom on iOS */
.form-field input,
.form-field select,
.form-field textarea,
.form-control,
.form-select {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    background: var(--color-bg-elevated, #ffffff);
    color: var(--color-text-primary, #0f172a);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus states */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form groups */
.form-group {
    margin-bottom: var(--grid-gap-md);
}

/* Input groups */
.input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* Floating labels for mobile */
.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* ==========================================================================
   Table Responsive Styles
   ========================================================================== */

/* Table wrapper for horizontal scroll */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Horizontal scroll table */
.table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    min-width: 600px;
}

/* Mobile card view for tables */
.table-mobile .mobile-card {
    background: var(--color-bg-elevated, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
}

.table-mobile .mobile-card:last-child {
    margin-bottom: 0;
}

.table-mobile .mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
}

.table-mobile .mobile-card-row:last-child {
    border-bottom: none;
}

.table-mobile .mobile-card-label {
    font-size: 12px;
    color: var(--color-text-tertiary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-mobile .mobile-card-value {
    font-weight: 500;
    color: var(--color-text-primary, #0f172a);
}

/* ==========================================================================
   Display Utilities (Bootstrap-compatible)
   ========================================================================== */

.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }
.d-table { display: table !important; }
.d-table-row { display: table-row !important; }
.d-table-cell { display: table-cell !important; }

/* ==========================================================================
   Flexbox Utilities
   ========================================================================== */

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-wrap-reverse { flex-wrap: wrap-reverse !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-evenly { justify-content: space-evenly !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.align-content-start { align-content: flex-start !important; }
.align-content-end { align-content: flex-end !important; }
.align-content-center { align-content: center !important; }
.align-content-between { align-content: space-between !important; }
.align-content-around { align-content: space-around !important; }
.align-content-stretch { align-content: stretch !important; }

/* ==========================================================================
   Spacing Utilities (Bootstrap-compatible)
   ========================================================================== */

/* Margin utilities */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-4 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-5 { margin-left: 3rem !important; margin-right: 3rem !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }

/* Padding utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: 0.25rem !important; }
.ps-2 { padding-left: 0.5rem !important; }
.ps-3 { padding-left: 1rem !important; }
.ps-4 { padding-left: 1.5rem !important; }
.ps-5 { padding-left: 3rem !important; }

.pe-0 { padding-right: 0 !important; }
.pe-1 { padding-right: 0.25rem !important; }
.pe-2 { padding-right: 0.5rem !important; }
.pe-3 { padding-right: 1rem !important; }
.pe-4 { padding-right: 1.5rem !important; }
.pe-5 { padding-right: 3rem !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* ==========================================================================
   Text Utilities
   ========================================================================== */

.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }

.text-wrap { white-space: normal !important; }
.text-nowrap { white-space: nowrap !important; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Gap Utilities
   ========================================================================== */

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* ==========================================================================
   Image Responsive
   ========================================================================== */

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Mobile Navigation Styles
   ========================================================================== */

/* Mobile menu toggle button */
.menu-toggle {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: var(--color-bg-secondary);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Mobile navigation */
.nav-mobile {
    display: block;
}

.nav-desktop {
    display: none;
}

/* Mobile menu overlay and drawer */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-open {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-menu-drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: min(280px, 80vw);
    height: 100%;
    background: var(--color-bg-elevated, #ffffff);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

.mobile-menu-open .mobile-menu-drawer {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.mobile-menu-footer {
    padding: 16px;
    border-top: 1px solid var(--color-border, #e2e8f0);
}

.mobile-menu-close {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
}

/* Mobile navigation items */
.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    min-height: var(--touch-target-comfortable);
    transition: background-color 0.2s ease;
}

.mobile-nav-item:hover {
    background-color: var(--color-bg-secondary);
    text-decoration: none;
}

.mobile-nav-item.active {
    background-color: var(--color-primary-light, rgba(59, 130, 246, 0.1));
    color: var(--color-primary);
}

.mobile-nav-item i,
.mobile-nav-item .icon {
    margin-right: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   Bottom Sheet Styles (Mobile Actions)
   ========================================================================== */

.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 1050;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-open {
    visibility: visible;
    opacity: 1;
}

.bottom-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-elevated, #ffffff);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-area-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet-open .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--color-border, #e2e8f0);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 0 8px;
}

.bottom-sheet-action {
    display: flex;
    align-items: center;
    padding: 16px;
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    min-height: var(--touch-target-comfortable);
    transition: background-color 0.2s ease;
}

.bottom-sheet-action:hover {
    background-color: var(--color-bg-secondary);
    text-decoration: none;
}

.bottom-sheet-action i,
.bottom-sheet-action .icon {
    margin-right: 16px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.bottom-sheet-action.danger {
    color: var(--color-error);
}

.bottom-sheet-action.danger i,
.bottom-sheet-action.danger .icon {
    color: var(--color-error);
}

.bottom-sheet-divider {
    height: 1px;
    background: var(--color-border, #e2e8f0);
    margin: 8px 0;
}

/* ==========================================================================
   sm breakpoint (576px+)
   Mobile landscape
   ========================================================================== */
@media (min-width: 576px) {
    /* Container */
    .container {
        max-width: 540px;
    }
    
    /* Grid columns */
    .col-sm { flex: 1 0 0%; }
    .col-sm-auto { flex: 0 0 auto; width: auto; }
    .col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
    
    /* Display utilities */
    .d-sm-none { display: none !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline-flex { display: inline-flex !important; }
    
    /* Form layout */
    .form-layout-sm-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   md breakpoint (768px+)
   Tablet
   ========================================================================== */
@media (min-width: 768px) {
    /* Container */
    .container {
        max-width: 720px;
    }
    
    /* Hide mobile nav, show desktop nav */
    .nav-mobile {
        display: none;
    }
    
    .nav-desktop {
        display: flex;
    }
    
    /* Grid columns */
    .col-md { flex: 1 0 0%; }
    .col-md-auto { flex: 0 0 auto; width: auto; }
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
    
    /* Display utilities */
    .d-md-none { display: none !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline-flex { display: inline-flex !important; }
    
    /* Table display */
    .table-desktop {
        display: block;
    }
    
    .table-mobile {
        display: none;
    }
    
    /* Form layout - 2 columns on tablet */
    .form-layout-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Toast position adjustment */
    .toast-container {
        left: auto;
        right: 20px;
        top: 20px;
    }
}

/* ==========================================================================
   lg breakpoint (992px+)
   Desktop
   ========================================================================== */
@media (min-width: 992px) {
    /* Container */
    .container {
        max-width: 960px;
    }
    
    /* Grid columns */
    .col-lg { flex: 1 0 0%; }
    .col-lg-auto { flex: 0 0 auto; width: auto; }
    .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
    
    /* Display utilities */
    .d-lg-none { display: none !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-inline-flex { display: inline-flex !important; }
    
    /* Form layout - 3 columns on desktop */
    .form-layout-columns {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Container padding adjustment */
    :root {
        --container-padding-x: 24px;
    }
}

/* ==========================================================================
   xl breakpoint (1200px+)
   Large Desktop
   ========================================================================== */
@media (min-width: 1200px) {
    /* Container */
    .container {
        max-width: 1140px;
    }
    
    /* Grid columns */
    .col-xl { flex: 1 0 0%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; }
    .col-xl-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xl-9 { flex: 0 0 auto; width: 75%; }
    .col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-xl-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
    
    /* Display utilities */
    .d-xl-none { display: none !important; }
    .d-xl-inline { display: inline !important; }
    .d-xl-inline-block { display: inline-block !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
    .d-xl-inline-flex { display: inline-flex !important; }
}

/* ==========================================================================
   xxl breakpoint (1400px+)
   Extra Large Desktop
   ========================================================================== */
@media (min-width: 1400px) {
    /* Container */
    .container {
        max-width: 1320px;
    }
    
    /* Grid columns */
    .col-xxl { flex: 1 0 0%; }
    .col-xxl-auto { flex: 0 0 auto; width: auto; }
    .col-xxl-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-xxl-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-xxl-3 { flex: 0 0 auto; width: 25%; }
    .col-xxl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xxl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xxl-6 { flex: 0 0 auto; width: 50%; }
    .col-xxl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xxl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xxl-9 { flex: 0 0 auto; width: 75%; }
    .col-xxl-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-xxl-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-xxl-12 { flex: 0 0 auto; width: 100%; }
    
    /* Display utilities */
    .d-xxl-none { display: none !important; }
    .d-xxl-inline { display: inline !important; }
    .d-xxl-inline-block { display: inline-block !important; }
    .d-xxl-block { display: block !important; }
    .d-xxl-flex { display: flex !important; }
    .d-xxl-inline-flex { display: inline-flex !important; }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .nav-mobile,
    .mobile-menu,
    .bottom-sheet,
    .menu-toggle {
        display: none !important;
    }
    
    .nav-desktop {
        display: block !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Reduced Motion Preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu-drawer,
    .bottom-sheet,
    .bottom-sheet-content {
        transition: none !important;
    }
    
    .mobile-menu-open .mobile-menu-drawer,
    .bottom-sheet-open .bottom-sheet-content {
        transition: none !important;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
html.dark,
[data-theme="dark"] {
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .mobile-nav-item.active,
    .bottom-sheet-action:hover {
        outline: 2px solid currentColor;
    }
    
    .form-control:focus,
    .form-select:focus {
        outline: 3px solid var(--color-primary);
        outline-offset: 2px;
    }
}
