/* =========================================================
   GLOBAL SAFETY
========================================================= */
html, body {
  overflow-x: hidden;
}

/* =========================================================
   GRID
========================================================= */
.m28-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;

  width: 100%;
  max-width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

/* =========================================================
   CARD
========================================================= */
.m28-item {
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  box-sizing: border-box;
  max-width: 100%;
}

/* Force children to respect width */
.m28-item * {
  box-sizing: border-box;
  max-width: 100%;
}

/* =========================================================
   IMAGE WRAPPER (LINK)
========================================================= */
.m28-item > a {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
}

/* IMAGE */
.m28-item > a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   ADD / QTY CONTROLS (BOTTOM-RIGHT ON IMAGE)
========================================================= */
.m28-qty {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 5;
  max-width: calc(100% - 16px);
  font-family: inherit;
}

/* ADD BUTTON */
.m28-qty .add-btn {
  background: #28a745;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* STEPPER (HIDDEN INITIALLY) */
.m28-qty .stepper {
  display: none;
  align-items: center;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* STEPPER BUTTONS */
.m28-qty .stepper button {
  width: 28px;
  height: 28px;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.m28-qty .plus {
  background: #28a745;
  color: #ffffff;
}

.m28-qty .minus {
  background: #dc3545;
  color: #ffffff;
}

.m28-qty .qty {
  width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
}

/* ACTIVE STATE */
.m28-qty.active .add-btn {
  display: none;
}

.m28-qty.active .stepper {
  display: flex;
}

/* =========================================================
   TITLE + PRICE (ONE LINE)
========================================================= */
.m28-title-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* TITLE */
.m28-title-price h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

/* PRICE */
.m28-title-price .price {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================
   RESPONSIVE
========================================================= */

/* Tablets */
@media (max-width: 1024px) {
  .m28-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* Mobile */
@media (max-width: 600px) {
  .m28-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
  }

  .m28-title-price h3,
  .m28-title-price .price {
    font-size: 13px;
  }
}
