/* MyFarmBox Singapore — Products page
   Uses /shared.css for global typography, buttons, forms, colours and header.
*/

[hidden] {
  display: none !important;
}

body {
  padding-bottom: 98px;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: 72px;
}

.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 18px;
}

.page-intro h1 {
  max-width: 820px;
  margin-bottom: 0;
}

.cart-shortcut {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-white);
  box-shadow: var(--mfb-shadow-sm);
}

.cart-shortcut:hover {
  border-color: rgba(67, 141, 53, 0.35);
  transform: translateY(-1px);
}

.cart-shortcut strong {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 11px;
  font-weight: 700;
}

.minimum-card {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--mfb-shadow-sm);
}

.minimum-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.minimum-copy small,
.minimum-copy strong {
  display: block;
}

.minimum-copy small {
  margin-bottom: 3px;
  color: var(--mfb-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.minimum-copy strong {
  color: var(--mfb-deep);
  font-size: 16px;
}

.minimum-copy > span {
  color: var(--mfb-green-dark);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eadf;
}

.progress-track.compact {
  height: 6px;
  margin-top: 0;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mfb-green), #6aa956);
  transition: width 240ms ease;
}

/* Sticky search and filter bar
   The header scrolls away, so this must stick at the actual viewport top.
*/
.catalog-tools {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 0 calc(clamp(18px, 4vw, 58px) * -1);
  padding: 10px clamp(18px, 4vw, 58px) 9px;
  border-bottom: 1px solid rgba(24, 51, 35, 0.08);
  background: var(--mfb-cream);
  box-shadow: 0 8px 22px rgba(24, 51, 35, 0.07);
}

.search-box {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-white);
  box-shadow: var(--mfb-shadow-sm);
}

.search-box span {
  color: var(--mfb-green);
  font-size: 21px;
}

.search-box input {
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}

.search-box input:focus {
  border: 0;
  box-shadow: none;
}

.category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 9px 0 1px;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--mfb-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--mfb-green-dark);
  font-size: 13px;
  font-weight: 700;
}

.filter-chip:hover {
  border-color: rgba(67, 141, 53, 0.35);
  background: var(--mfb-green-light);
}

.filter-chip.active {
  border-color: var(--mfb-green);
  background: var(--mfb-green);
  color: var(--mfb-white);
}

.catalog-status {
  padding: 13px 0 11px;
}

.catalog-status p {
  margin: 0;
  font-size: 14px;
}

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

.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius);
  background: var(--mfb-white);
  box-shadow: var(--mfb-shadow-sm);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.product-card.in-cart {
  border-color: var(--mfb-green);
  background: #f6fbf4;
}

.product-card:hover {
  box-shadow: var(--mfb-shadow);
  transform: translateY(-2px);
}

.in-harvest-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(36, 91, 43, 0.22);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 243, 220, 0.9), transparent 27%),
    linear-gradient(145deg, #e8f0dd, #d5e4c8);
}

.product-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.product-image.loaded {
  opacity: 1;
}

.image-loading {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      100deg,
      rgba(225, 230, 222, 0.75) 20%,
      rgba(244, 246, 241, 0.94) 40%,
      rgba(225, 230, 222, 0.75) 60%
    );
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.product-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--mfb-green-dark);
  text-align: center;
}

.product-placeholder span {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
}

.product-placeholder strong {
  font-family: var(--mfb-font-heading);
  font-size: 12px;
}

.product-category {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--mfb-green-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.product-body {
  padding: 16px;
}

.product-title {
  min-height: 48px;
  margin: 0;
  color: var(--mfb-deep);
  font-family: var(--mfb-font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.32;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-description{
    margin:6px 0 10px;
    font-size:13px;
    font-weight:400;
    color:#6f7d72;
    line-height:1.45;

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;

    min-height:38px;
}

.product-native {
  display: none;
}

.product-unit {
  display: block;
  margin-top: 12px;
  color: var(--mfb-muted);
  font-size: 13px;
}

.product-price {
  display: block;
  margin-top: 4px;
  color: var(--mfb-green-dark);
  font-family: var(--mfb-font-heading);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
}

.selection-copy {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--mfb-green-dark);
  font-size: 12px;
  font-weight: 700;
}

.product-controls {
  margin-top: 10px;
}

.add-control {
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mfb-green);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 14px;
  font-weight: 700;
}

.add-control:hover {
  background: var(--mfb-green-dark);
}

.quantity-control {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--mfb-green);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-white);
}

.quantity-control button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--mfb-green-dark);
  font-size: 19px;
  font-weight: 700;
}

.quantity-control button:hover {
  background: var(--mfb-green-light);
}

.quantity-control .remove-button {
  color: #8d3f35;
}

.quantity-value {
  text-align: center;
  color: var(--mfb-deep);
  font-size: 14px;
  font-weight: 700;
}

.skeleton-card {
  height: 330px;
  border-radius: var(--mfb-radius);
  background:
    linear-gradient(
      100deg,
      rgba(225, 230, 222, 0.8) 20%,
      rgba(244, 246, 241, 0.95) 40%,
      rgba(225, 230, 222, 0.8) 60%
    );
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.message-card {
  max-width: 520px;
  margin: 42px auto;
  padding: 32px;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius);
  background: var(--mfb-white);
  box-shadow: var(--mfb-shadow-sm);
  text-align: center;
}

.message-card > span {
  display: block;
  margin-bottom: 12px;
  font-size: 34px;
}

.message-card h2 {
  margin-bottom: 10px;
}

.message-card p {
  margin-bottom: 20px;
  font-size: 15px;
}

.message-card button {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 14px;
  font-weight: 700;
}

.cart-toast {
  position: fixed;
  right: 20px;
  bottom: 104px;
  z-index: 90;
  max-width: min(380px, calc(100vw - 30px));
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--mfb-border);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-white);
  box-shadow: var(--mfb-shadow-lg);
}

.cart-toast-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mfb-green-light);
  color: var(--mfb-green);
  font-weight: 800;
}

.cart-toast strong,
.cart-toast small {
  display: block;
}

.cart-toast strong {
  font-size: 13px;
}

.cart-toast small {
  margin-top: 2px;
  font-size: 11px;
}

.cart-toast a {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 11px;
  font-weight: 700;
}

.harvest-dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 80;
  width: min(1040px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr minmax(190px, 270px) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 51, 35, 0.14);
  border-radius: var(--mfb-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--mfb-shadow-lg);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.dock-copy small,
.dock-copy strong,
.dock-total small,
.dock-total strong {
  display: block;
}

.dock-copy small,
.dock-total small {
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.dock-copy strong {
  color: var(--mfb-deep);
  font-size: 14px;
}

.dock-total strong {
  color: var(--mfb-green-dark);
  font-size: 17px;
}

.dock-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
}

.dock-progress > span {
  color: var(--mfb-green-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.reset-cart-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(159, 67, 56, 0.24);
  border-radius: var(--mfb-radius-sm);
  background: #fff7f4;
  color: #9f4338;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.reset-cart-button:hover {
  border-color: #9f4338;
  background: #fff0ed;
}

.checkout-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 13px;
  font-weight: 700;
}

.checkout-button:hover {
  background: var(--mfb-green-dark);
}

.checkout-button.disabled {
  pointer-events: none;
  background: #b9c4b6;
}

@media (max-width: 1040px) {
  .product-grid,
  .loading-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 84px;
  }

  .page-shell {
    padding: 8px 8px 58px;
  }

  .page-intro {
    padding: 11px 1px 10px;
  }

  .page-intro h1 {
    font-size: 28px;
    letter-spacing: -1.5px;
  }

  .cart-shortcut {
    width: 40px;
    height: 40px;
  }

  .minimum-card {
    margin-bottom: 7px;
    padding: 10px 11px;
    border-radius: 12px;
  }

  .minimum-copy small {
    font-size: 8px;
  }

  .minimum-copy strong {
    font-size: 10px;
  }

  .minimum-copy > span {
    font-size: 9px;
  }

  .catalog-tools {
    top: 0;
    margin: 0 -8px;
    padding: 6px 8px 5px;
  }

  .search-box {
    min-height: 38px;
    padding: 0 10px;
  }

  .search-box span {
    font-size: 17px;
  }

  .search-box input {
    min-height: 36px;
    font-size: 12px;
  }

  .category-filters {
    gap: 6px;
    padding-top: 6px;
  }

  .filter-chip {
    min-height: 30px;
    padding: 0 10px;
    font-size: 9px;
  }

  .catalog-status {
    padding: 7px 1px;
  }

  .catalog-status p {
    font-size: 10px;
  }

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

  .product-card {
    border-radius: 11px;
  }

  .product-image-wrap {
    aspect-ratio: 1 / 1;
  }

  .product-category {
    left: 4px;
    top: 4px;
    padding: 3px 4px;
    font-size: 5px;
  }

  .in-harvest-badge {
    top: 4px;
    right: 4px;
    padding: 3px 5px;
    font-size: 6px;
  }

  .product-placeholder {
    padding: 4px;
  }

  .product-placeholder span {
    margin-bottom: 2px;
    font-size: 20px;
  }

  .product-placeholder strong {
    font-size: 7px;
  }

  .product-body {
    padding: 7px;
  }

  .product-title {
    min-height: 34px;
    font-size: 12px;
    line-height: 1.3;
  }

   @media (max-width:820px){

   .product-description{
       margin:4px 0 8px;
       font-size:11px;
       line-height:1.35;
       min-height:30px;
   }

  .product-unit {
    margin-top: 6px;
    font-size: 8px;
  }

  .product-price {
    margin-top: 2px;
    font-size: 14px;
  }

  .selection-copy {
    min-height: 12px;
    margin-top: 4px;
    font-size: 7px;
  }

  .product-controls {
    margin-top: 5px;
  }

  .add-control {
    min-height: 30px;
    border-radius: 8px;
    font-size: 9px;
  }

  .quantity-control {
    min-height: 30px;
    grid-template-columns: 1fr 24px 1fr;
    border-radius: 8px;
  }

  .quantity-control button {
    min-height: 30px;
    font-size: 13px;
  }

  .quantity-value {
    font-size: 9px;
  }

  .skeleton-card {
    height: 205px;
    border-radius: 11px;
  }

  .harvest-dock {
    bottom: 7px;
    width: calc(100vw - 14px);
    grid-template-columns: 1fr auto auto auto;
    gap: 7px;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .dock-progress {
    display: none;
  }

  .dock-copy small,
  .dock-total small {
    font-size: 7px;
  }

  .dock-copy strong {
    font-size: 9px;
  }

  .dock-total strong {
    font-size: 11px;
  }

  .reset-cart-button,
  .checkout-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 8px;
  }

  .cart-toast {
    right: 9px;
    bottom: 76px;
  }
}

@media (max-width: 480px) {

  .harvest-dock {
    width: calc(100vw - 12px);
    padding: 9px;
    column-gap: 6px;
  }

  .dock-copy strong {
    font-size: 10px;
  }

  .dock-progress > span {
    font-size: 8px;
  }

  .reset-cart-button,
  .checkout-button {
    padding: 0 9px;
    font-size: 8px;
  }
}


/* Compatibility with the existing products/app.js card markup */

.add-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mfb-green);
  border-radius: var(--mfb-radius-sm);
  background: var(--mfb-green);
  color: var(--mfb-white);
  font-size: 14px;
  font-weight: 700;
}

.add-button:hover {
  background: var(--mfb-green-dark);
}

.product-total {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--mfb-green-dark);
  font-size: 12px;
  font-weight: 700;
}

.render-status {
  margin: 18px 0 0;
  color: var(--mfb-muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 820px) {
  .add-button {
    min-height: 30px;
    margin-top: 5px;
    border-radius: 8px;
    font-size: 9px;
  }

  .product-total {
    min-height: 12px;
    margin-top: 4px;
    font-size: 7px;
  }

  .render-status {
    margin-top: 10px;
    font-size: 9px;
  }
}

/* Products v39 — clean equal-height Add / quantity cards */

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

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

.product-card.in-cart {
  border-color: rgba(67, 141, 53, 0.52);
  background: #ffffff;
  box-shadow:
    0 16px 36px rgba(36, 91, 43, 0.15),
    0 0 0 1px rgba(67, 141, 53, 0.07);
}

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

.product-copy {
  min-height: 88px;
}

.product-title {
  min-height: 48px;
}

.product-description {
  min-height: 38px;
  margin: 5px 0 0;
  color: #748077;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.42;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-meta {
  margin-top: auto;
}

.selection-copy {
  min-height: 18px;
  margin: 7px 0 0;
}

.product-controls {
  margin-top: 10px;
}

.product-card.in-cart .selection-copy {
  color: var(--mfb-green-dark);
}

@media (max-width: 820px) {
  .product-copy {
    min-height: 64px;
  }

  .product-title {
    min-height: 34px;
  }

  .product-description {
    min-height: 27px;
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.35;
  }

  .selection-copy {
    min-height: 12px;
    margin-top: 4px;
    font-size: 7px;
  }
   @media (max-width: 480px) {
  .dock-total {
    display: none;
  }

  .harvest-dock {
    grid-template-columns: 1fr auto auto;
  }
}

