/* ============================================================
   responsive.css — mineralslanka.com
   Mobile-first media query overrides
   Breakpoints: 375px base → 480px → 640px → 768px → 1024px → 1280px → 1440px
   Max Minerals Pvt. Ltd. | IAMUVIN
   ============================================================ */


/* === GLOBAL: Prevent horizontal overflow on all devices === */

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}


/* ============================================================
   BASE: 375px+ (mobile default — styles already in main.css)
   These refinements ensure small phones look right.
   ============================================================ */

/* Section spacing — tighter on mobile */
.section {
  padding: var(--space-16) 0;
}

.section-header {
  margin-bottom: var(--space-8);
}

/* Ensure all images stay in bounds */
img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

/* Readable line lengths */
p {
  max-width: 65ch;
}

/* No horizontal scroll from full-bleed elements */
.container,
.container-sm,
.container-md,
.container-lg {
  width: 100%;
}


/* ============================================================
   sm: 480px+ (larger phones — iPhone Plus, Samsung Galaxy)
   ============================================================ */

@media (min-width: 480px) {
  /* Stats: ensure 2x2 grid has breathing room */
  .stats-grid {
    gap: var(--space-4);
  }

  /* Hero trust items fit better */
  .hero-trust {
    gap: var(--space-5);
  }

  /* Card actions can sit side-by-side comfortably */
  .card-actions {
    flex-direction: row;
    align-items: center;
  }

  /* Slightly larger section titles on bigger phones */
  .section-title {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  }
}


/* ============================================================
   sm-md: 640px+ (large phones / small tablets in portrait)
   ============================================================ */

@media (min-width: 640px) {
  /* Section spacing grows */
  .section {
    padding: var(--space-20) 0;
  }

  .section-header {
    margin-bottom: var(--space-10);
  }

  /* Stats grid: 2x2 → still 2x2 but with more gap */
  .stats-grid {
    gap: var(--space-6);
  }

  /* Industry grid: 2 col still, but comfortable */
  .industry-grid {
    gap: var(--space-5);
  }

  /* CTA band spacing grows */
  .cta-band {
    padding: var(--space-16) 0;
  }

  /* Form rows become 2-column */
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Export list 2-col is comfortable now */
  .export-list {
    gap: var(--space-3) var(--space-6);
  }

  /* Button sizes feel better with more padding */
  .btn-lg {
    padding: 1rem 2rem;
  }
}


/* ============================================================
   md: 768px+ (tablets — iPad Mini, iPad Air portrait)
   ============================================================ */

@media (min-width: 768px) {
  /* Section padding reaches desktop-like proportions */
  .section {
    padding: var(--space-24) 0;
  }

  .section-header {
    margin-bottom: var(--space-12);
  }

  /* Hero actions full-width row */
  .hero-actions {
    flex-wrap: nowrap;
  }

  /* Stats: move to 4 columns on tablet landscape */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }

  .stat-number {
    font-size: 2rem;
  }

  .stats-section {
    padding: var(--space-16) 0;
  }

  /* Why grid: side-by-side */
  .why-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  /* Quality grid: side-by-side */
  .quality-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  /* Export grid: side-by-side */
  .export-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-6);
  }

  /* Product cards: 2-column grid */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Product detail: side-by-side */
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  /* Stage grid: side-by-side */
  .stage-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  /* Contact grid: single column still on tablet portrait */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  /* Footer grid: 2x2 on tablet */
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--space-6);
  }

  .footer-col:first-child {
    grid-column: 1 / -1;
  }

  /* Team grid: always 2 col minimum on tablet */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Reserve cards side-by-side */
  .reserve-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Location cards: 2 col */
  .location-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Pack grid: 3 col */
  .pack-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Industry grid: 2 col with more room */
  .industry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  /* Hero: restore ghost button */
  .hero-actions .btn-hero-ghost {
    display: inline-flex;
  }

  /* Hero content text alignment */
  .hero-content {
    text-align: left;
  }

  .hero-trust {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* Page hero text alignment */
  .page-hero .hero-content {
    text-align: left;
  }

  /* Footer bottom: horizontal */
  .footer-bottom {
    flex-direction: row;
    text-align: left;
  }

  /* USP grid 2 col */
  .usp-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* CTA band spacing */
  .cta-band {
    padding: var(--space-20) 0;
  }

  /* Composition table: full width, no scroll needed */
  .comp-table {
    font-size: var(--text-sm);
  }
}


/* ============================================================
   lg: 1024px+ (small laptops, iPad landscape)
   ============================================================ */

@media (min-width: 1024px) {
  /* Nav shows full links — height set in components.css */

  /* Stats: full 4-column with larger numbers */
  .stats-grid {
    gap: var(--space-6);
  }

  .stat-number {
    font-size: 2.25rem;
  }

  /* Why grid: more gap */
  .why-grid {
    gap: var(--space-12);
  }

  /* Quality grid: proper gap */
  .quality-grid {
    gap: var(--space-12);
  }

  /* Export grid: comfortable spacing */
  .export-grid {
    gap: var(--space-8);
  }

  /* Industry grid: 3 columns */
  .industry-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stage grid: generous gap */
  .stage-grid {
    gap: var(--space-12);
  }

  /* Product grid: comfortable */
  .product-grid {
    gap: var(--space-12);
  }

  /* Contact grid: side-by-side */
  .contact-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-12);
  }

  /* Footer grid: full 4-column */
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.25fr;
    gap: var(--space-8);
  }

  .footer-col:first-child {
    grid-column: auto;
  }

  /* Team grid: 3 columns */
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Location grid: 3 columns */
  .location-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* USP grid: 3 columns */
  .usp-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Process timeline: more space */
  .process-timeline {
    padding-left: var(--space-12);
  }

  /* Hero title — split layout active at 1024px */
  .hero-title {
    font-size: clamp(2.25rem, 3.5vw, 3.25rem);
  }

  /* Section title: slightly larger */
  .section-title {
    font-size: clamp(2rem, 3.5vw, 2.5rem);
  }
}


/* ============================================================
   xl: 1280px+ (standard desktop)
   ============================================================ */

@media (min-width: 1280px) {
  /* Hero: refined for split layout */
  .hero-inner {
    max-width: none;
  }

  .hero-title {
    font-size: 3.75rem;
  }

  .hero-sub {
    font-size: 1.1875rem;
    max-width: 520px;
  }

  /* Stat numbers at full display size */
  .stat-number {
    font-size: 2.5rem;
  }

  /* Data card: breathing room */
  .data-card-row--hero .data-card-value {
    font-size: 1.75rem;
  }

  /* Stage numbers full display */
  .stage-number {
    font-size: 4.5rem;
  }

  /* Section padding at peak */
  .section {
    padding: var(--space-24) 0;
  }

  /* Why grid comfortable */
  .why-grid {
    gap: var(--space-16);
  }

  /* Quality grid comfortable */
  .quality-grid {
    gap: var(--space-16);
  }
}


/* ============================================================
   2xl: 1440px+ (large desktop / external displays)
   ============================================================ */

@media (min-width: 1440px) {
  /* Slightly larger container max-width */
  .container {
    max-width: 1320px;
  }

  .container-lg {
    max-width: 1440px;
  }

  /* Hero display headline */
  .hero-title {
    font-size: 4rem;
    letter-spacing: -0.03em;
  }

  /* Section title at peak */
  .section-title {
    font-size: 2.75rem;
  }

  /* More generous section padding */
  .section {
    padding: var(--space-32) 0;
  }

  /* Stats section comfort */
  .stats-section {
    padding: var(--space-20) 0;
  }

  .stat-number {
    font-size: 2.75rem;
  }

  /* Footer: more breathing room */
  .footer-grid {
    gap: var(--space-12);
  }
}


/* ============================================================
   ULTRA-WIDE: 1920px+ (large external monitors)
   ============================================================ */

@media (min-width: 1920px) {
  /* Cap container so content doesn't spread too wide */
  .container {
    max-width: 1400px;
  }

  .container-lg {
    max-width: 1600px;
  }

  /* Larger body text for readability on big screens */
  body {
    font-size: 1.0625rem;
  }
}


/* ============================================================
   MOBILE-SPECIFIC REFINEMENTS (max-width queries)
   These fix specific issues on small screens.
   ============================================================ */

/* --- Small phones: 375px and below --- */
@media (max-width: 389px) {
  /* Hero eyebrow smaller */
  .hero-eyebrow {
    font-size: 0.6875rem;
  }

  /* Hero title minimum size */
  .hero-title {
    font-size: 1.875rem;
  }

  /* Buttons go full width */
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  /* Stats: single column on tiny phones */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .stat-item {
    padding: var(--space-4);
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-desc {
    display: none;
  }

  /* Industry grid: single column */
  .industry-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* Card specs: stack vertically */
  .card-specs {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  /* Smaller section titles */
  .section-title {
    font-size: 1.5rem;
  }

  /* FAQ question size */
  .faq-question {
    font-size: 0.9375rem;
  }

  /* Footer cert badges: stack */
  .footer-certifications {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Footer bottom: tighter */
  .footer-bottom-left {
    flex-direction: column;
    gap: var(--space-1);
  }
}


/* --- Phones in landscape orientation --- */
@media (max-width: 767px) and (orientation: landscape) {
  /* Hero: shorter to avoid scroll past fold */
  .hero {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: var(--space-8);
  }

  .hero-content {
    padding: var(--space-8) 0;
  }

  /* Page hero: shorter in landscape */
  .page-hero {
    min-height: 35vh;
  }

  /* Stats: 4 inline in landscape */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
  }

  .stat-desc {
    display: none;
  }
}


/* --- Tablets in portrait (768-1023px) specific fixes --- */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Nav: hide desktop links, show hamburger */
  /* (already handled in components.css) */

  /* Stats: 4 col but compact */
  .stat-item {
    padding: var(--space-4);
  }

  /* Export map: stack on narrow tablet */
  .export-grid {
    grid-template-columns: 1fr;
  }

  /* Contact: stack form and panel */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    position: static;
  }

  /* Process step text: readable width */
  .process-body p {
    max-width: 45ch;
  }
}


/* ============================================================
   TABLE RESPONSIVENESS
   Composition table horizontal scroll on small screens
   ============================================================ */

@media (max-width: 640px) {
  .comp-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comp-table thead,
  .comp-table tbody,
  .comp-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .comp-table thead th,
  .comp-table tbody td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}


/* ============================================================
   FLOW DIAGRAM RESPONSIVENESS
   ============================================================ */

@media (max-width: 767px) {
  .flow-diagram {
    justify-content: flex-start;
    gap: 0;
    padding: var(--space-4) 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .flow-diagram::-webkit-scrollbar {
    display: none;
  }

  .flow-step {
    min-width: 80px;
  }

  .flow-arrow {
    width: 24px;
  }
}


/* ============================================================
   MAP CONTAINER (contact.html Google Maps)
   ============================================================ */

.map-container iframe {
  width: 100%;
  height: 400px;
  border: 0;
  display: block;
}

@media (max-width: 767px) {
  .map-container iframe {
    height: 280px;
  }
}

@media (min-width: 1024px) {
  .map-container iframe {
    height: 480px;
  }
}


/* ============================================================
   TYPOGRAPHY SCALE ADJUSTMENTS
   Ensure text is readable across all breakpoints
   ============================================================ */

@media (max-width: 767px) {
  /* Body text never below 14px */
  p,
  .faq-answer p,
  .quality-point p,
  .industry-desc,
  .team-bio,
  .usp-item p,
  .export-port-note p {
    font-size: max(var(--text-sm), 0.875rem);
    line-height: 1.65;
  }

  /* Eyebrow labels */
  .eyebrow {
    font-size: 0.6875rem;
  }

  /* Section lead text */
  .section-lead {
    font-size: var(--text-base);
  }

  /* Card body: comfortable padding */
  .card-body {
    padding: var(--space-5) var(--space-5) var(--space-6);
  }

  /* Card title: readable size */
  .card-title {
    font-size: 1.25rem;
  }

  /* Reserve numbers: responsive */
  .reserve-number {
    font-size: 2.25rem;
  }

  /* Stage number: responsive */
  .stage-number {
    font-size: 2.5rem;
  }
}


/* ============================================================
   TOUCH TARGET COMPLIANCE
   All interactive elements min 44x44px on touch devices
   ============================================================ */

@media (pointer: coarse) {
  /* Buttons: minimum touch height */
  .btn {
    min-height: 48px;
  }

  .btn-sm {
    min-height: 44px;
  }

  /* Nav links on mobile drawer */
  .mobile-menu-drawer ul a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* FAQ questions: generous tap target */
  .faq-question {
    min-height: 52px;
  }

  /* Footer nav links: spaced for thumbs */
  .footer-nav li a {
    padding: 0.375rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Language buttons */
  .lang-btn {
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Export list items */
  .export-list li {
    padding: var(--space-2) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}


/* ============================================================
   iOS SAFE AREA SUPPORT
   Handles notch, home indicator, and rounded corners
   ============================================================ */

@supports (padding: env(safe-area-inset-bottom)) {
  /* Mobile CTA bar: respect home indicator */
  .mobile-cta-bar {
    padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
  }

  /* Footer: bottom safe area */
  .footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Full viewport hero: account for top safe area */
  .hero {
    padding-top: calc(75px + env(safe-area-inset-top));
  }

  @media (max-width: 767px) {
    .hero {
      padding-top: calc(60px + env(safe-area-inset-top));
    }

    .page-hero {
      padding-top: calc(60px + env(safe-area-inset-top));
    }
  }
}


/* ============================================================
   HIGH-DPI / RETINA ADJUSTMENTS
   ============================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Thinner borders on retina — they appear at correct visual weight */
  .card,
  .data-card,
  .industry-cell,
  .usp-item,
  .pack-card,
  .location-card,
  .reserve-card,
  .team-card {
    border-width: 0.5px;
  }

  /* Thinner nav accent bar — 2px visual = 1px on retina */
  .nav-accent-bar {
    height: 2px;
  }
}


/* ============================================================
   PRINT STYLES
   Clean output for procurement teams printing spec sheets
   ============================================================ */

@media print {
  /* Remove fixed elements */
  .nav,
  .mobile-cta-bar,
  .footer-back-top,
  .nav-accent-bar {
    display: none !important;
  }

  /* Remove animations */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }

  /* White background */
  body {
    background: #FFFFFF;
    color: #000000;
    padding-bottom: 0;
  }

  .section,
  .section-alt,
  .section-dark,
  .stats-section {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 1rem 0;
  }

  .section-dark *,
  .stats-section * {
    color: #000000 !important;
  }

  /* Hero: collapsed for print */
  .hero,
  .page-hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-bg,
  .hero-overlay {
    display: none;
  }

  .hero-content {
    position: static;
    padding: 0;
  }

  .hero-title {
    color: #000000;
    font-size: 2rem;
  }

  /* Cards: no shadow, visible borders */
  .card,
  .data-card,
  .stat-item {
    box-shadow: none;
    border: 1px solid #CCCCCC;
    break-inside: avoid;
  }

  /* Links: show URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75rem;
    color: #666666;
  }

  .btn::after,
  .nav-link::after,
  .footer a::after {
    content: none;
  }

  /* Footer: simple */
  .footer {
    background: #FFFFFF;
    padding: 1rem 0;
    border-top: 1px solid #CCCCCC;
  }

  .footer * {
    color: #000000 !important;
  }

  /* Comp table: print-friendly */
  .comp-table {
    font-size: 0.75rem;
  }

  .comp-table thead th {
    background: #EEEEEE !important;
    color: #000000 !important;
  }

  /* Page breaks */
  .section {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }
}
