/* Tablet and desktop storefront refinements. Mobile <=640px remains untouched. */

@media (min-width: 641px) {
  html, body { max-width: 100%; overflow-x: hidden; }

  .catalog,
  .products-wrap {
    width: 100%;
  }

  .category-grid,
  .product-grid {
    align-items: stretch;
  }

  .category-card,
  .product-card {
    height: 100%;
  }

  .category-card {
    display: flex;
    flex-direction: column;
  }

  .category-card .category-body {
    flex: 1 1 auto;
  }

  .product-card {
    display: flex;
    flex-direction: column;
  }

  .product-card .category-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .product-card .button {
    width: 100%;
    margin-top: auto !important;
  }

  .modal {
    align-items: center;
    padding: 24px;
  }

  .modal-card {
    width: min(820px, calc(100vw - 48px));
    max-height: 90vh;
    border-radius: 22px;
    padding: 26px 28px 28px;
    box-shadow: 0 28px 80px rgba(20, 25, 21, .24);
  }

  #modalGallery.gallery img {
    max-height: min(54vh, 520px) !important;
  }

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

@media (min-width: 641px) and (max-width: 819px) {
  .utilitybar {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px 12px;
  }

  .topline {
    text-align: center;
    font-size: 14px;
  }

  .contactbar {
    justify-content: center;
  }

  .hero {
    padding: 10px 18px 24px;
  }

  .logo {
    width: min(430px, 62vw);
    max-height: 210px;
  }

  .hero h1 {
    font-size: clamp(34px, 6vw, 46px);
    line-height: 1;
  }

  .hero p {
    font-size: 16px;
  }

  .catalog,
  .products-wrap {
    max-width: 760px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

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

  .category-body {
    padding: 13px 11px 15px;
  }

  .category-body h3 {
    font-size: 16px;
    line-height: 1.08;
  }

  .category-body p {
    font-size: 12.5px;
    line-height: 1.3;
  }

  .product-card .category-body {
    min-height: 176px;
  }

  .products-head h2 {
    font-size: 27px;
  }

  .modal {
    padding: 18px;
  }

  .modal-card {
    width: min(720px, calc(100vw - 36px));
    padding: 24px;
  }
}

@media (min-width: 820px) and (max-width: 999px) {
  .utilitybar {
    flex-direction: row;
    gap: 18px;
    padding: 10px 24px;
  }

  .topline {
    flex: 1 1 auto;
    font-size: 14px;
  }

  .contactbar {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 12px;
  }

  .phone {
    font-size: 16px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

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

  .product-card .category-body {
    min-height: 178px;
  }
}

/* Laptop and desktop: compact premium header instead of the oversized stretched mobile-like hero. */
@media (min-width: 1000px) {
  .utilitybar {
    flex-direction: row;
    align-items: center;
    min-height: 44px;
    gap: 18px;
    padding: 7px clamp(28px, 5vw, 72px) !important;
  }

  .topline {
    font-size: 13px !important;
    line-height: 1.2;
  }

  .contactbar {
    gap: 10px !important;
  }

  .phone {
    font-size: 14px !important;
  }

  .hero {
    padding: 14px 24px 18px !important;
  }

  .logo {
    width: min(290px, 24vw) !important;
    max-height: 135px !important;
    margin-bottom: 4px !important;
  }

  .hero h1 {
    max-width: 760px;
    margin: 2px auto 6px !important;
    font-size: clamp(34px, 3.15vw, 46px) !important;
    line-height: .98 !important;
  }

  .hero p {
    margin: 0 auto !important;
    font-size: 15px !important;
    line-height: 1.25;
  }

  .catalog {
    padding-top: 18px !important;
  }

  .catalog > h2,
  .catalog-title {
    margin: 0 0 18px !important;
    font-size: clamp(34px, 3vw, 44px) !important;
    line-height: 1 !important;
  }

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

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

  .category-card,
  .product-card {
    transition: transform .16s ease, box-shadow .16s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    .category-card:hover,
    .product-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 17px 38px rgba(42, 48, 39, .11);
    }
  }

  .product-card .category-body {
    min-height: 190px;
  }

  .product-card .category-media {
    min-height: 0;
  }
}

@media (min-width: 1280px) {
  .catalog,
  .products-wrap,
  .divider {
    max-width: 1240px;
  }

  .category-grid,
  .product-grid {
    gap: 20px;
  }

  .modal-card {
    width: min(860px, calc(100vw - 64px));
  }
}
