/* =============================================
   RESPONSIVE UTILITIES & MEDIA QUERIES
   Mobile-First Approach
   ============================================= */

/* ─────────────────────────────────────────────
   BREAKPOINTS
   ───────────────────────────────────────────── */
:root {
    --breakpoint-xs: 320px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* ─────────────────────────────────────────────
   MOBILE-FIRST TYPOGRAPHY
   ───────────────────────────────────────────── */
html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 576px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 17px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────────
   RESPONSIVE CONTAINERS
   ───────────────────────────────────────────── */
.container-responsive {
    width: 100%;
    padding: var(--spacing-md);
    margin: 0 auto;
}

@media (min-width: 576px) {
    .container-responsive {
        max-width: 540px;
        padding: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container-responsive {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container-responsive {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container-responsive {
        max-width: 1320px;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE GRID LAYOUTS
   ───────────────────────────────────────────── */
.grid-auto {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .grid-auto {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    .grid-auto {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-auto {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .grid-auto {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Two-column grid */
.grid-2 {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Three-column grid */
.grid-3 {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE FLEXBOX UTILITIES
   ───────────────────────────────────────────── */
.flex-responsive {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .flex-responsive {
        flex-direction: row;
        gap: var(--spacing-lg);
    }
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

/* ─────────────────────────────────────────────
   RESPONSIVE PADDING & MARGINS
   ───────────────────────────────────────────── */
.px-responsive {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

@media (min-width: 576px) {
    .px-responsive {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    .px-responsive {
        padding-left: var(--spacing-xl);
        padding-right: var(--spacing-xl);
    }
}

.py-responsive {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
    .py-responsive {
        padding-top: var(--spacing-2xl);
        padding-bottom: var(--spacing-2xl);
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE TYPOGRAPHY SIZES
   ───────────────────────────────────────────── */
h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    line-height: 1.2;
    font-weight: 800;
}

h2 {
    font-size: clamp(1.3rem, 4vw, 2.2rem);
    line-height: 1.3;
    font-weight: 700;
}

h3 {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    line-height: 1.4;
    font-weight: 600;
}

h4, h5, h6 {
    line-height: 1.5;
    font-weight: 600;
}

.text-sm {
    font-size: clamp(0.75rem, 1vw, 0.875rem);
}

.text-base {
    font-size: clamp(0.875rem, 1.2vw, 1rem);
}

.text-lg {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
}

/* ─────────────────────────────────────────────
   RESPONSIVE BUTTONS
   ───────────────────────────────────────────── */
.btn-responsive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    font-size: clamp(0.875rem, 1vw, 1rem);
    border-radius: 8px;
    transition: all 0.25s;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 575px) {
    .btn-responsive {
        width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE IMAGES
   ───────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.img-thumbnail {
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* ─────────────────────────────────────────────
   RESPONSIVE TABLES
   ───────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 767px) {
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem !important;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE FORMS
   ───────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.25s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #E23428);
    box-shadow: 0 0 0 3px rgba(226, 52, 40, 0.1);
}

@media (min-width: 768px) {
    .form-group {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-lg);
    }

    .form-group label {
        min-width: 150px;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE CARDS
   ───────────────────────────────────────────── */
.card-responsive {
    background: #fff;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .card-responsive {
        padding: var(--spacing-xl);
    }
}

.card-responsive:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────
   HIDE/SHOW UTILITIES
   ───────────────────────────────────────────── */
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
}

.hidden-desktop {
    display: block;
}

@media (min-width: 768px) {
    .hidden-desktop {
        display: none;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE SECTIONS
   ───────────────────────────────────────────── */
section {
    padding: var(--spacing-2xl) var(--spacing-md);
}

@media (min-width: 576px) {
    section {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
}

@media (min-width: 768px) {
    section {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE HERO SECTIONS
   ───────────────────────────────────────────── */
.hero-responsive {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-md);
}

@media (min-width: 768px) {
    .hero-responsive {
        min-height: 100vh;
        padding: var(--spacing-2xl) var(--spacing-xl);
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE NAVIGATION
   ───────────────────────────────────────────── */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
}

@media (min-width: 768px) {
    nav {
        gap: var(--spacing-lg);
    }
}

.nav-hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .nav-hamburger {
        display: none;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE MODALS & OVERLAYS
   ───────────────────────────────────────────── */
.modal-responsive {
    width: 100%;
    max-width: 90vw;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 576px) {
    .modal-responsive {
        max-width: 500px;
    }
}

@media (min-width: 768px) {
    .modal-responsive {
        max-width: 600px;
    }
}

@media (min-width: 992px) {
    .modal-responsive {
        max-width: 800px;
    }
}

/* ─────────────────────────────────────────────
   ACCESSIBILITY & TOUCH TARGETS
   ───────────────────────────────────────────── */
button, a {
    min-height: 44px;
    min-width: 44px;
}

@media (min-width: 768px) {
    button, a {
        min-height: 40px;
        min-width: 40px;
    }
}

/* ─────────────────────────────────────────────
   PRINT STYLES
   ───────────────────────────────────────────── */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
        line-height: 1.5;
    }

    .no-print, .navbar, .sidebar, .footer {
        display: none !important;
    }

    a {
        text-decoration: underline;
    }

    img {
        max-width: 100%;
    }

    section {
        page-break-inside: avoid;
    }
}

/* ─────────────────────────────────────────────
   SCROLL & OVERFLOW HANDLING
   ───────────────────────────────────────────── */
* {
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}