/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

/* Tablet & Mobile (768px and below) */
@media (max-width: 768px) {
  /* ===== TOUCH TARGETS ===== */
  button,
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ===== TEXT HANDLING ===== */
  h1, h2, h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* ===== HEADER ADJUSTMENTS ===== */
  header {
    padding: 20px 30px;
  }

  .header-classification {
    font-size: 7px;
    top: 8px;
    left: 30px;
  }

  .logo-text {
    font-size: 12px;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .header-location {
    font-size: 9px;
  }

  /* ===== HERO SECTION ===== */
  .hero {
    padding: 60px 30px 60px;
  }

  .hero-meta {
    flex-wrap: wrap;
    gap: 20px;
  }

  .hero-meta-item {
    flex: 1 1 45%;
    min-width: 120px;
  }

  h1 {
    font-size: 48px;
  }

  .hero-description {
    font-size: 15px;
  }

  .cta-row {
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }

  .btn-primary,
  .btn-link {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* ===== STATUS GRID ===== */
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 60px;
  }

  .status-card {
    padding: 30px 20px;
  }

  .status-value {
    font-size: 28px;
  }

  /* ===== SECTIONS ===== */
  .section {
    padding: 80px 30px;
  }

  .section-title {
    font-size: 36px;
  }

  /* ===== PRODUCTS GRID ===== */
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    padding: 40px 30px;
  }

  .product-name {
    font-size: 28px;
  }

  .specs-grid {
    gap: 15px 20px;
  }

  /* ===== MISSION GRID ===== */
  .mission-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .principles-list {
    padding: 40px 30px;
  }

  /* ===== FOOTER ===== */
  footer {
    padding: 60px 30px 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* ===== SCROLLING ===== */
  pre {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  /* ===== FORM INPUTS ===== */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* ===== EMAIL CAPTURE ===== */
  .email-capture-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .email-capture-benefits {
    gap: 20px;
  }

  /* ===== WAITLIST FORM ===== */
  .waitlist-form {
    flex-direction: column;
    gap: 15px;
  }

  .waitlist-form .email-input {
    width: 100%;
  }

  .waitlist-form .btn-primary {
    width: 100%;
  }

  /* ===== PRODUCT PAGE GALLERY ===== */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gallery-item img {
    max-height: 400px;
  }

  .gallery-placeholder {
    min-height: 300px;
  }

  /* ===== BLOG ===== */
  .blog-grid {
    gap: 30px;
  }

  .blog-placeholder {
    padding: 60px 30px;
  }

  /* ===== NAVIGATION ===== */
  .main-nav {
    gap: 15px;
  }

  .main-nav .nav-link {
    font-size: 11px;
    padding: 8px 12px;
  }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
  /* Header */
  header {
    padding: 15px 20px !important;
  }

  .header-classification {
    font-size: 6px;
    left: 20px;
  }

  .logo-text {
    font-size: 10px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .header-location {
    display: none;
  }

  /* Hero */
  .hero {
    padding: 40px 20px 40px !important;
  }

  .hero-meta {
    flex-direction: column;
    gap: 15px;
  }

  .hero-meta-item {
    flex: 1 1 100%;
  }

  h1 {
    font-size: 32px !important;
  }

  .hero-description {
    font-size: 14px;
  }

  /* Status Grid */
  .status-grid {
    grid-template-columns: 1fr !important;
    margin-top: 40px;
  }

  .status-card {
    padding: 25px 20px;
  }

  .status-label {
    font-size: 9px;
  }

  .status-value {
    font-size: 24px;
  }

  .status-subtext {
    font-size: 10px;
  }

  /* Sections */
  .section {
    padding: 60px 20px !important;
  }

  .section-number {
    font-size: 10px;
  }

  .section-title {
    font-size: 28px !important;
  }

  /* Product Cards */
  .product-card {
    padding: 30px 20px !important;
  }

  .product-id {
    font-size: 8px;
    top: 15px;
    right: 15px;
  }

  .product-status {
    font-size: 8px;
    padding: 3px 8px;
  }

  .product-name {
    font-size: 24px !important;
  }

  .product-category {
    font-size: 11px;
  }

  .product-description {
    font-size: 13px;
  }

  .specs-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .spec-label {
    font-size: 8px;
  }

  .spec-value {
    font-size: 12px;
  }

  /* Mission Section */
  .mission-grid {
    gap: 40px;
  }

  .mission-text p {
    font-size: 14px;
  }

  .principles-list {
    padding: 30px 20px !important;
  }

  .principle {
    margin-bottom: 25px;
    padding-bottom: 25px;
  }

  .principle-number {
    font-size: 10px;
  }

  .principle-title {
    font-size: 14px;
  }

  .principle-desc {
    font-size: 12px;
  }

  /* Footer */
  footer {
    padding: 40px 20px 30px !important;
  }

  .footer-grid {
    gap: 30px;
  }

  .footer-brand {
    font-size: 12px;
  }

  .footer-tagline {
    font-size: 12px;
  }

  .footer-section-title {
    font-size: 9px;
  }

  .footer-links a {
    font-size: 12px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    font-size: 9px;
  }

  .btn-primary {
    padding: 14px 30px;
    font-size: 11px;
  }

  /* Email Capture */
  .email-capture-section {
    padding: 50px 20px !important;
  }

  .email-capture-content {
    gap: 30px;
  }

  /* Blog */
  .blog-placeholder {
    padding: 40px 20px !important;
  }

  .placeholder-icon {
    font-size: 40px;
  }

  .placeholder-title {
    font-size: 18px;
  }

  .placeholder-text {
    font-size: 12px;
  }

  /* Gallery */
  .gallery-item img {
    max-height: 300px;
  }

  .gallery-placeholder {
    min-height: 250px;
  }

  /* Navigation */
  .main-nav .nav-link {
    font-size: 10px;
    padding: 6px 10px;
  }
}

/* ===== EXTRA SMALL (360px and below) ===== */
@media (max-width: 360px) {
  h1 {
    font-size: 28px !important;
  }

  .section-title {
    font-size: 24px !important;
  }

  .product-name {
    font-size: 20px !important;
  }

  .status-value {
    font-size: 20px;
  }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce vertical padding in landscape */
  .hero {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  .section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  header {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
  }

  /* Adjust hero layout for landscape */
  .hero-meta {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover states on touch devices */
  .btn-primary:hover,
  .btn-link:hover,
  .product-link:hover,
  .footer-links a:hover {
    background: transparent;
    color: inherit;
    border-color: inherit;
  }

  /* Add active states for touch feedback */
  button:active,
  a:active,
  .btn-primary:active,
  .btn-link:active {
    opacity: 0.7;
    transform: scale(0.98);
    transition: all 0.1s;
  }

  /* Larger tap targets for links */
  .footer-links a {
    padding: 8px 0;
    display: block;
  }

  /* Better spacing for touch */
  .cta-row {
    gap: 20px;
  }
}

/* ===== PREVENT TEXT SELECTION ON DOUBLE TAP ===== */
@media (max-width: 768px) {
  button,
  .btn-primary,
  .logo-mark {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ===== SAFE AREA INSETS (iPhone X+) ===== */
@supports (padding: max(0px)) {
  header {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .hero,
  .section,
  footer {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp text on retina displays */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
