/* ========================================
   UTILITIES CSS - Classes utilitaires responsive
   ======================================== */

/* ========================================
   VISIBILITY HELPERS
   ======================================== */

.mobile-only {
    display: none;
}

.tablet-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }

    .tablet-only {
        display: none !important;
    }

    .desktop-only {
        display: none !important;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-only {
        display: none !important;
    }

    .tablet-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mobile-only {
        display: none !important;
    }

    .tablet-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }

    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   TOUCH-FRIENDLY SIZES
   ======================================== */

.touch-target {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.touch-target-sm {
    min-width: 36px !important;
    min-height: 36px !important;
}

.touch-target-lg {
    min-width: 48px !important;
    min-height: 48px !important;
}

/* ========================================
   RESPONSIVE SPACING
   ======================================== */

/* Margins */
.m-responsive-sm {
    margin: clamp(0.5rem, 2vw, 1rem) !important;
}

.m-responsive-md {
    margin: clamp(1rem, 3vw, 2rem) !important;
}

.m-responsive-lg {
    margin: clamp(1.5rem, 4vw, 3rem) !important;
}

/* Paddings */
.p-responsive-sm {
    padding: clamp(0.5rem, 2vw, 1rem) !important;
}

.p-responsive-md {
    padding: clamp(1rem, 3vw, 2rem) !important;
}

.p-responsive-lg {
    padding: clamp(1.5rem, 4vw, 3rem) !important;
}

/* Gap */
.gap-responsive-sm {
    gap: clamp(0.5rem, 2vw, 1rem) !important;
}

.gap-responsive-md {
    gap: clamp(1rem, 3vw, 2rem) !important;
}

.gap-responsive-lg {
    gap: clamp(1.5rem, 4vw, 3rem) !important;
}

/* ========================================
   CONTAINER HELPERS
   ======================================== */

.container-fluid {
    width: 100%;
    padding-left: clamp(1rem, 5vw, 2rem);
    padding-right: clamp(1rem, 5vw, 2rem);
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
}

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

/* ========================================
   RESPONSIVE FLEXBOX
   ======================================== */

.flex-mobile-column {
    display: flex;
}

@media (max-width: 768px) {
    .flex-mobile-column {
        flex-direction: column !important;
    }
}

.flex-mobile-wrap {
    display: flex;
}

@media (max-width: 768px) {
    .flex-mobile-wrap {
        flex-wrap: wrap !important;
    }
}

/* ========================================
   RESPONSIVE GRID
   ======================================== */

.grid-responsive {
    display: grid;
    gap: 1rem;
}

.grid-responsive-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-responsive-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-responsive-4 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (max-width: 768px) {
    .grid-responsive-2,
    .grid-responsive-3,
    .grid-responsive-4 {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-center-mobile {
    text-align: inherit;
}

@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

.text-left-mobile {
    text-align: inherit;
}

@media (max-width: 768px) {
    .text-left-mobile {
        text-align: left !important;
    }
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   WIDTH UTILITIES
   ======================================== */

.w-full {
    width: 100% !important;
}

.w-auto {
    width: auto !important;
}

.max-w-full {
    max-width: 100% !important;
}

@media (max-width: 768px) {
    .w-full-mobile {
        width: 100% !important;
    }
}

/* ========================================
   OVERFLOW UTILITIES
   ======================================== */

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-auto {
    overflow: auto !important;
}

.overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.overflow-y-auto {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* ========================================
   TABLE WRAPPER
   ======================================== */

.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.table-scroll-wrapper table {
    min-width: 600px;
}

/* ========================================
   ASPECT RATIO (for images/videos)
   ======================================== */

.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

.aspect-3-2 {
    aspect-ratio: 3 / 2;
}

/* ========================================
   IMAGE UTILITIES
   ======================================== */

.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

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

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   PRINT UTILITIES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        font-size: 12pt !important;
    }
}
