/**
 * AEW Responsive Utilities
 * Shared responsive patterns for all Elementor widgets
 */

/* ============================================
   RESPONSIVE CONTAINERS
   ============================================ */

.aew-responsive-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.5rem;
}

@media (max-width: 1024px) {
    .aew-responsive-container {
        padding: 1.25rem;
    }
}

@media (max-width: 767px) {
    .aew-responsive-container {
        padding: 1rem;
    }
}

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

.aew-responsive-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    min-width: 0; /* Prevent grid blowout */
}

.aew-responsive-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aew-responsive-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aew-responsive-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aew-responsive-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .aew-responsive-grid-3,
    .aew-responsive-grid-4,
    .aew-responsive-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .aew-responsive-grid-2,
    .aew-responsive-grid-3,
    .aew-responsive-grid-4,
    .aew-responsive-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

.aew-responsive-heading {
    font-size: 1.5rem;
    line-height: 1.3;
}

.aew-responsive-subheading {
    font-size: 1.25rem;
    line-height: 1.4;
}

.aew-responsive-body {
    font-size: 1rem;
    line-height: 1.6;
}

.aew-responsive-small {
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .aew-responsive-heading {
        font-size: 1.35rem;
    }

    .aew-responsive-subheading {
        font-size: 1.15rem;
    }

    .aew-responsive-body {
        font-size: 0.95rem;
    }

    .aew-responsive-small {
        font-size: 0.825rem;
    }
}

@media (max-width: 767px) {
    .aew-responsive-heading {
        font-size: 1.25rem;
    }

    .aew-responsive-subheading {
        font-size: 1.1rem;
    }

    .aew-responsive-body {
        font-size: 0.9rem;
    }

    .aew-responsive-small {
        font-size: 0.8rem;
    }
}

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

.aew-responsive-spacing-xl {
    padding: 2rem;
}

.aew-responsive-spacing-lg {
    padding: 1.5rem;
}

.aew-responsive-spacing-md {
    padding: 1rem;
}

.aew-responsive-spacing-sm {
    padding: 0.75rem;
}

.aew-responsive-spacing-xs {
    padding: 0.5rem;
}

@media (max-width: 1024px) {
    .aew-responsive-spacing-xl {
        padding: 1.5rem;
    }

    .aew-responsive-spacing-lg {
        padding: 1.25rem;
    }

    .aew-responsive-spacing-md {
        padding: 0.875rem;
    }
}

@media (max-width: 767px) {
    .aew-responsive-spacing-xl {
        padding: 1rem;
    }

    .aew-responsive-spacing-lg {
        padding: 0.875rem;
    }

    .aew-responsive-spacing-md {
        padding: 0.75rem;
    }

    .aew-responsive-spacing-sm {
        padding: 0.5rem;
    }

    .aew-responsive-spacing-xs {
        padding: 0.375rem;
    }
}

/* ============================================
   RESPONSIVE VISIBILITY
   ============================================ */

.aew-hide-mobile {
    display: block;
}

.aew-hide-tablet {
    display: block;
}

.aew-hide-desktop {
    display: none;
}

@media (max-width: 1024px) {
    .aew-hide-tablet {
        display: none;
    }
}

@media (max-width: 767px) {
    .aew-hide-mobile {
        display: none;
    }

    .aew-hide-desktop {
        display: block;
    }
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */

.aew-responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.aew-responsive-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}

@media (max-width: 1024px) {
    .aew-responsive-table {
        font-size: 0.9rem;
    }

    .aew-responsive-table th,
    .aew-responsive-table td {
        padding: 0.5rem 0.7rem;
    }
}

@media (max-width: 767px) {
    .aew-responsive-table {
        font-size: 0.85rem;
    }

    .aew-responsive-table th,
    .aew-responsive-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* Card layout for very small screens */
@media (max-width: 480px) {
    .aew-responsive-table-card .aew-responsive-table thead {
        display: none;
    }

    .aew-responsive-table-card .aew-responsive-table tr {
        display: block;
        border: 1px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0.5rem;
        border-radius: 4px;
    }

    .aew-responsive-table-card .aew-responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .aew-responsive-table-card .aew-responsive-table td:last-child {
        border-bottom: none;
    }

    .aew-responsive-table-card .aew-responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }
}

/* ============================================
   RESPONSIVE FLEX UTILITIES
   ============================================ */

.aew-flex-responsive {
    display: flex;
    gap: 1rem;
}

@media (max-width: 767px) {
    .aew-flex-responsive {
        flex-direction: column;
    }
}

.aew-flex-wrap-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   RESPONSIVE TOUCH TARGETS
   ============================================ */

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

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

.aew-overflow-auto {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.aew-overflow-x-auto {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.aew-overflow-y-auto {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .aew-overflow-mobile {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}
