/* Homepage delivery categories. Scoped to category cards/section only. */
.md-home-categories-section {
  background: #fdf8f0;
  padding: clamp(52px, 6vw, 94px) 0 76px;
}

.md-home-categories-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
}

.md-home-categories-eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #86612b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.md-home-categories-heading h2 {
  margin: 0;
  color: #24201b;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(28px, 3.1vw, 44px);
  font-weight: 600;
  letter-spacing: -.025em;
}

.md-home-categories-heading > p {
  max-width: 290px;
  margin: 0 0 5px;
  color: #655f56;
  font-size: 14px;
  line-height: 1.5;
}

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

.md-home-category {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  color: #251f19;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e9e0d3;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(48, 35, 19, .045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.md-home-category:hover,
.md-home-category:focus-visible {
  transform: translateY(-3px);
  border-color: #d5bd93;
  box-shadow: 0 16px 34px rgba(48, 35, 19, .1);
}

.md-home-category:focus-visible {
  outline: 3px solid #ac813d;
  outline-offset: 3px;
}

.md-home-category-media {
  position: relative;
  height: clamp(132px, 15vw, 215px);
  overflow: hidden;
  background: linear-gradient(140deg, #d3c7af, #9a805e);
}

.md-home-category-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .32s ease;
}

.md-home-category:hover .md-home-category-media img { transform: scale(1.035); }

.md-home-category-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 65%, rgba(32, 21, 12, .14));
}

.md-home-category[data-home-category="food"] .md-home-category-media { background: linear-gradient(130deg, #e0b98c, #b57a59); }
.md-home-category[data-home-category="groceries"] .md-home-category-media { background: linear-gradient(135deg, #d3ddc8, #9fac87); }
.md-home-category[data-home-category="shops"] .md-home-category-media { background: linear-gradient(135deg, #d7c9b6, #98816e); }
.md-home-category[data-home-category="pharmacy-beauty"] .md-home-category-media { background: linear-gradient(135deg, #d4dfd7, #9bb5a7); }
.md-home-category[data-home-category="custom-delivery"] .md-home-category-media { background: linear-gradient(120deg, #d8c9a7, #9c8768); }

.md-home-category-symbol {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: .42;
}

.md-home-category-media:has(img) .md-home-category-symbol { display: none; }

.md-home-category-symbol::before {
  content: '';
  display: block;
  width: 88px;
  height: 88px;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  transform: rotate(-10deg);
}

.md-home-category-symbol--pharmacy-beauty::before {
  position: relative;
  width: 28px;
  height: 100px;
  border-radius: 8px;
  transform: none;
}

.md-home-category-symbol--pharmacy-beauty::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 8px;
}

.md-home-category-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 19px 17px;
}

.md-home-category-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
}

.md-home-category-copy h3 {
  margin: 0 0 6px;
  color: #221b17;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.md-home-category-copy p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  min-height: 6.2em;
  margin: 0 0 15px;
  color: #6f685d;
  font-size: 13px;
  line-height: 1.55;
}

.md-home-category-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: auto;
  padding: 12px 15px;
  color: #fff;
  background: #201a17;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  transition: background .18s ease;
}

.md-home-category:hover .md-home-category-cta,
.md-home-category:focus-visible .md-home-category-cta { background: #493525; }

.md-home-category-arrow { display: none; }

.md-home-category--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 38% 1fr;
  min-height: 170px;
}

.md-home-category--wide .md-home-category-media {
  height: 100%;
  min-height: 170px;
}

.md-home-category--wide .md-home-category-content {
  padding: 25px clamp(20px, 4vw, 52px);
}

.md-home-category--wide .md-home-category-copy h3 { font-size: clamp(23px, 3vw, 32px); }
.md-home-category--wide .md-home-category-copy p { min-height: 0; }

.md-home-category.is-disabled {
  cursor: default;
  transform: none !important;
  border-color: #e9e0d3;
  box-shadow: 0 8px 32px rgba(48, 35, 19, .045);
}

.md-home-category.is-disabled .md-home-category-media img { transform: none !important; }

.md-home-category.is-disabled .md-home-category-cta,
.md-home-category-cta.is-disabled {
  color: #756b60;
  background: #e7e0d7;
  border: 1px solid #d9cfc3;
  box-shadow: none;
  cursor: not-allowed;
}

.md-home-category.is-disabled:hover .md-home-category-cta { background: #e7e0d7; }
.md-home-category[hidden] { display: none !important; }

/* Match both diagonal How It Works surfaces to the surrounding page. */
#howitworks::before { background: linear-gradient(176deg, var(--color-cream) 0 49%, transparent 50%); }
#howitworks::after { background: linear-gradient(176deg, transparent 0 49%, var(--color-cream-dark) 50%); }
#howitworks .step-card { display: flex; flex-direction: column; min-height: 252px; }
#howitworks .step-num { color: #c39a65; opacity: .7; }
#howitworks .steps-grid::before,
#howitworks .step-card:not(:last-child)::after { display: none !important; }
#howitworks .step-title { line-height: 1.35; }

@media (max-width: 900px) {
  .md-home-categories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .md-home-category-media { height: 185px; }
  .md-home-categories-heading { align-items: start; flex-direction: column; gap: 9px; }
}

@media (max-width: 768px) {
  .md-home-categories-section { padding: 62px 0 64px; }
  .md-home-categories-heading { margin-bottom: 24px; }

  .md-home-categories-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 11px;
    padding: 5px 9px;
    color: #765126;
    background: #f3e6d4;
    border: 1px solid #ead8c0;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .13em;
  }

  .md-home-categories-heading h2 { font-size: clamp(30px, 8vw, 39px); }
  .md-home-categories-heading > p { max-width: 100%; font-size: 13px; }
}

@media (max-width: 520px) {
  .md-home-categories-section { padding-top: 56px; }
  .md-home-categories-grid { gap: 11px; }
  .md-home-category { border-radius: 15px; }
  .md-home-category-media { height: 140px; }
  .md-home-category-content { padding: 14px 13px 13px; }
  .md-home-category-copy h3 { min-height: 40px; font-size: 16px; }
  .md-home-category-copy p { min-height: 6em; margin-bottom: 12px; font-size: 11px; }
  .md-home-category-cta { min-height: 40px; padding: 10px 8px; font-size: 11px; }
  .md-home-category--wide { grid-template-columns: 35% 1fr; min-height: 165px; }
  .md-home-category--wide .md-home-category-media { min-height: 165px; }
  .md-home-category--wide .md-home-category-content { padding: 14px; }
  .md-home-category--wide .md-home-category-copy h3 { min-height: 0; font-size: 20px; }
  .md-home-category--wide .md-home-category-copy p { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .md-home-category,
  .md-home-category-media img,
  .md-home-category-cta { transition: none; }
  .md-home-category:hover { transform: none; }
}
