
/* Mobile optimization overrides */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Better tap targets */
button, a { min-height: 44px; }

/* Large tablets and below */
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Phones */
@media (max-width: 768px) {
  .container, [class*="max-w-"] { max-width: 100% !important; }
  .px-16, .px-14, .px-12, .px-10, .px-8, .px-6 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .py-16, .py-14, .py-12 { padding-top: 2rem !important; padding-bottom: 2rem !important; }

  .grid-cols-5, .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr !important; }
  .md\:grid-cols-2, .md\:grid-cols-3, .md\:grid-cols-4 { grid-template-columns: 1fr !important; }

  .text-6xl, .text-5xl { font-size: 2rem !important; line-height: 1.15 !important; }
  .text-4xl { font-size: 1.75rem !important; line-height: 1.2 !important; }
  .text-3xl { font-size: 1.5rem !important; line-height: 1.25 !important; }

  .h-96, .h-80, .h-72, .h-64 { height: auto !important; }

  /* Common product-card pattern */
  .product-card img,
  [class*="product"] img,
  [class*="card"] img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  /* Prevent cramped navbar rows */
  nav .gap-8, nav .gap-6, nav .gap-4 { gap: 0.5rem !important; }
  nav [class*="text-"] { font-size: 0.95rem !important; }
}

/* USDA badge mobile sizing/placement fix */
@media (max-width: 768px) {
  img[src*="usda-biopreferred"],
  img[src*="usda-biopreferred-logo"] {
    width: min(46vw, 180px) !important;
    height: auto !important;
    max-width: 180px !important;
    object-fit: contain !important;
  }

  /* If badge sits in an absolute-positioned wrapper, keep it lower-right and out of headline area */
  img[src*="usda-biopreferred"]:not(.no-mobile-fix),
  img[src*="usda-biopreferred-logo"]:not(.no-mobile-fix) {
    transform: scale(0.88);
    transform-origin: bottom right;
  }
}
