/* FALLSTOREE - responsive layout fix */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

img, video, canvas, iframe {
  max-width: 100%;
}

input, select, textarea, button {
  max-width: 100%;
}

main, section, footer {
  min-width: 0;
}

.topbar {
  width: 100%;
  max-width: 1200px;
  height: auto;
  min-height: 68px;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px clamp(12px, 3vw, 26px);
}

.topbar nav {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.topbar nav > a {
  display: inline-flex;
  align-items: center;
}

.section {
  width: 100%;
  min-width: 0;
}

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

.filters {
  min-width: 0;
  max-width: 100%;
}

.filters input,
.filters select {
  min-width: 0;
}

.admin-section,
.admin-form,
.stats-grid,
.orders-list,
.order-card,
.wallet-card,
.modal-card {
  min-width: 0;
  max-width: 100%;
}

.admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar nav {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar nav > a {
    display: inline-flex;
  }

  .hero {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    padding: 38px 18px;
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(34px, 8vw, 48px);
    overflow-wrap: anywhere;
  }

  .hero-panel {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .section {
    padding: 26px 16px 48px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .filters {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  .filters input {
    flex: 1 1 55%;
    width: 100%;
  }

  .filters select {
    flex: 1 1 35%;
    width: 100%;
    max-width: none;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card,
  .product-body {
    min-width: 0;
  }

  .product-image {
    height: clamp(100px, 24vw, 145px);
  }

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

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

  .admin-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-form > * {
    min-width: 0;
    grid-column: auto !important;
  }

  footer {
    flex-wrap: wrap;
    padding: 20px 16px;
  }

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

@media (max-width: 480px) {
  .topbar {
    gap: 10px;
  }

  .topbar nav {
    gap: 8px;
    font-size: 12px;
  }

  .topbar .btn {
    padding: 9px 11px;
  }

  .brand {
    max-width: 100%;
  }

  .hero h1 {
    letter-spacing: -1.5px;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-image {
    height: 170px;
  }

  .product-foot {
    flex-direction: row;
    align-items: center;
  }

  .product-foot .btn {
    width: auto;
  }

  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-top,
  .order-bottom {
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    padding: 22px 16px;
    max-height: 92dvh;
  }

  .quick-amounts button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
