/* ============================================
   Responsive Design System - Mobile First
   Professional & Production Ready
   ============================================
   
   Breakpoints (Standard):
   - Mobile: 0-479px (Small phones)
   - Mobile Large: 480px-639px (Large phones)
   - Tablet: 640px-767px (Small tablets)
   - Tablet Large: 768px-1023px (Large tablets)
   - Desktop: 1024px-1279px (Small desktops)
   - Desktop Large: 1280px+ (Large desktops)
   
   Best Practices:
   - Mobile First Approach
   - Fluid Typography (clamp)
   - Flexible Grids
   - Touch-Friendly Targets (min 44px)
   - Performance Optimized
*/

/* ============================================
   Base Mobile Styles
   ============================================ */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll */
body {
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   Typography Responsive (Fluid)
   ============================================ */
h1 {
    font-size: clamp(1.75rem, 4vw + 1rem, 3rem);
    line-height: 1.2;
    font-weight: 800;
}

h2 {
    font-size: clamp(1.5rem, 3vw + 1rem, 2.5rem);
    line-height: 1.3;
    font-weight: 700;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw + 1rem, 2rem);
    line-height: 1.4;
    font-weight: 600;
}

h4 {
    font-size: clamp(1.1rem, 2vw + 1rem, 1.5rem);
    line-height: 1.4;
    font-weight: 600;
}

p {
    font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.125rem);
    line-height: 1.6;
}

/* ============================================
   Container Responsive
   ============================================ */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
        max-width: 1200px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 3rem;
        padding-right: 3rem;
        max-width: 1280px;
    }
}

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

/* ============================================
   Grid Responsive System
   ============================================ */
.grid {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.grid-cols-1 { 
    grid-template-columns: repeat(1, 1fr); 
}

.grid-cols-2 { 
    grid-template-columns: repeat(1, 1fr); 
}

.grid-cols-3 { 
    grid-template-columns: repeat(1, 1fr); 
}

.grid-cols-4 { 
    grid-template-columns: repeat(1, 1fr); 
}

/* Mobile Large (480px+) */
@media (min-width: 480px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet (640px+) */
@media (min-width: 640px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Large (768px+) */
@media (min-width: 768px) {
    .grid {
        gap: 1.5rem;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .grid {
        gap: 2rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Product Grid Responsive
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    width: 100%;
}

@media (min-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

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

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
}

/* ============================================
   Utility Classes Responsive
   ============================================ */
.hidden-mobile {
    display: none !important;
}

.hidden-desktop {
    display: block;
}

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

/* ============================================
   Spacing Responsive
   ============================================ */
@media (max-width: 639px) {
    .py-12 { 
        padding-top: 1.5rem; 
        padding-bottom: 1.5rem; 
    }
    
    .py-16 { 
        padding-top: 2rem; 
        padding-bottom: 2rem; 
    }
    
    .mb-8 { 
        margin-bottom: 1.5rem; 
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 640px) {
    .py-12 { 
        padding-top: 2rem; 
        padding-bottom: 2rem; 
    }
    
    .py-16 { 
        padding-top: 3rem; 
        padding-bottom: 3rem; 
    }
}

/* ============================================
   Touch-Friendly Targets
   ============================================ */
button, 
a.button,
input[type="button"],
input[type="submit"],
.btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    button, 
    a.button,
    input[type="button"],
    input[type="submit"],
    .btn {
        min-height: auto;
    }
}

/* ============================================
   Form Elements Responsive
   ============================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
}

/* ============================================
   Images & Media Responsive
   ============================================ */
img {
    height: auto;
    max-width: 100%;
    object-fit: cover;
}

video, iframe {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Flexbox Utilities Responsive
   ============================================ */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

@media (min-width: 768px) {
    .flex-row-md {
        flex-direction: row;
    }
}

/* ============================================
   Text Alignment Responsive
   ============================================ */
.text-center {
    text-align: center;
}

@media (min-width: 768px) {
    .text-left-md {
        text-align: left;
    }
    
    .text-right-md {
        text-align: right;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    @page {
        margin: 2cm;
    }
}
