/* Mobile Enhancements for All Pages */

/* Prevent horizontal scrolling on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Improve button and link touch targets */
@media (max-width: 768px) {
    button, a.btn, a[role="button"], input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Form input improvements */
    input, textarea, select {
        min-height: 44px;
        font-size: 16px;
        padding: 12px;
    }

    /* Navigation link spacing */
    nav a, .nav-link {
        padding: 12px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Breadcrumb mobile improvements */
    .breadcrumb {
        flex-wrap: wrap;
        gap: 4px;
    }

    .breadcrumb-item {
        font-size: 12px;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 4px;
    }

    /* Header and hero banner adjustments */
    .hero, .banner, .jumbotron {
        padding: 30px 15px;
    }

    /* Product card responsive */
    .product-card, .card {
        margin-bottom: 12px;
    }

    /* Container padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Section padding */
    section {
        padding: 20px 0;
    }

    /* Heading sizes */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    /* List spacing */
    ul, ol {
        padding-left: 20px;
    }

    li {
        margin-bottom: 8px;
    }

    /* Modal improvements */
    .modal {
        padding: 0;
    }

    .modal-dialog {
        margin: 12px;
    }

    .modal-content {
        border-radius: 12px;
    }

    /* Dropdown menu mobile */
    .dropdown-menu {
        min-width: 180px;
        max-width: 90vw;
    }

    /* Table responsive */
    table {
        font-size: 13px;
    }

    td, th {
        padding: 8px 6px;
    }

    /* Improve form layout */
    .form-group {
        margin-bottom: 16px;
    }

    .form-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .form-row > * {
        flex: 1;
        min-width: 200px;
    }

    /* Badge and label sizing */
    .badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Alert box improvements */
    .alert {
        padding: 12px 15px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    /* Icon sizing */
    i, .icon {
        font-size: 18px;
    }

    /* Tooltip improvements */
    .tooltip {
        font-size: 12px;
    }

    /* Prevent zoom on input focus */
    input, textarea, select {
        font-size: 16px;
    }

    /* Shadow reduction for mobile */
    .shadow {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    .shadow-lg {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    }
}

/* Extra small devices (< 480px) */
@media (max-width: 480px) {
    /* Reduce padding on very small screens */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 16px;
    }

    h3 {
        font-size: 14px;
    }

    /* Reduce margins */
    p {
        margin-bottom: 10px;
    }

    /* Button stacking */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-group > .btn {
        flex: 1;
        min-width: 100px;
    }

    /* Row stacking */
    .row {
        gap: 8px;
    }

    .col {
        margin-bottom: 8px;
    }

    /* Image responsiveness */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Reduce spacing in cards */
    .card {
        margin-bottom: 12px;
        padding: 12px;
    }

    .card-body {
        padding: 12px;
    }

    /* Reduce list padding */
    ul, ol {
        padding-left: 20px;
        margin-bottom: 10px;
    }

    /* Footer adjustments */
    footer {
        padding: 20px 12px;
    }

    footer a {
        display: block;
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Sidebar full width on mobile */
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Main content full width */
    .main-content {
        width: 100%;
    }
}

/* Landscape mode adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .header {
        padding: 10px 0;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 5px;
    }

    section {
        padding: 15px 0;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for touch devices */
    button, a.btn, input[type="button"], input[type="submit"] {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }

    /* Remove hover effects on touch */
    a:hover, button:hover {
        text-decoration: none;
    }

    /* Add active state for touch */
    button:active, a.btn:active {
        opacity: 0.8;
    }
}

/* High DPI mobile devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    border {
        border-width: 0.5px;
    }
}
