/*
Theme Name: Mengopi D'Rumah
Theme URI: https://mengopidirumah.my/
Author: Codex
Description: Mobile-first cafe ordering theme recreated for Mengopi D'Rumah with menu cards, cart, WhatsApp checkout, reviews, beans, setup, and team sections.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: mengopi-drumah
*/

:root {
  --mdr-bg: #fbf7f0;
  --mdr-bg-2: #eadbc7;
  --mdr-paper: rgba(255, 255, 255, .78);
  --mdr-card: rgba(255, 255, 255, .88);
  --mdr-ink: #2f251d;
  --mdr-muted: #746657;
  --mdr-soft: #eadfce;
  --mdr-gold: #a8752d;
  --mdr-gold-2: #c48a3a;
  --mdr-cream: #fff7ed;
  --mdr-line: rgba(168, 117, 45, .16);
  --mdr-red: #d94848;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--mdr-ink);
  background:
    radial-gradient(circle at top left, rgba(168,117,45,.10), transparent 28%),
    radial-gradient(circle at bottom right, rgba(91,67,38,.07), transparent 26%),
    linear-gradient(180deg, var(--mdr-bg) 0%, var(--mdr-bg-2) 100%);
}

body.mdr-lock { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.mdr-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 96px;
}

.mdr-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 16px 14px;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid rgba(255,255,255,.62);
  box-shadow: 0 8px 20px rgba(91,67,38,.08);
  backdrop-filter: blur(14px);
}

.mdr-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mdr-logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 9px 20px rgba(91,67,38,.16);
}
.mdr-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mdr-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}
.mdr-tagline { margin: 5px 0 0; color: var(--mdr-muted); font-size: 12px; }
.mdr-socials { display: flex; gap: 7px; }
.mdr-socials a {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #8b8176;
  border-radius: 7px;
  background: rgba(255,255,255,.54);
  text-decoration: none;
}
.mdr-socials svg { width: 14px; height: 14px; }

.mdr-status-sign {
  position: fixed;
  right: max(10px, calc(50vw - 220px));
  top: 8px;
  z-index: 50;
  width: 78px;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.24));
  animation: mdrSwing 3s ease-in-out infinite;
  transform-origin: top center;
}

.mdr-notice,
.mdr-section,
.mdr-loyalty {
  margin: 14px 16px 0;
  border-radius: 18px;
  border: 1px solid var(--mdr-line);
  background: var(--mdr-paper);
  box-shadow: 0 12px 28px rgba(91,67,38,.08);
  backdrop-filter: blur(10px);
}
.mdr-notice { padding: 14px; display: flex; gap: 10px; color: #5b5349; }
.mdr-notice strong { display: block; font-size: 14px; margin-bottom: 4px; color: #34302b; }
.mdr-notice p { margin: 0; font-size: 12px; line-height: 1.5; }

.mdr-loyalty {
  position: relative;
  min-height: 88px;
  padding: 17px 14px 14px;
  overflow: visible;
  background: var(--mdr-cream);
}
.mdr-loyalty h2 { margin: 0; color: var(--mdr-gold); font-size: 15px; line-height: 1.2; }
.mdr-loyalty p { margin: 8px 0 0; color: var(--mdr-muted); font-size: 12px; }
.mdr-loyalty a,
.mdr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--mdr-gold-2), var(--mdr-gold));
  box-shadow: 0 8px 16px rgba(168,117,45,.22);
}
.mdr-loyalty .mdr-row { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 98px; }
.mdr-loyalty-cup {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: -35px;
  width: 142px;
  transform: translateX(-44%) rotate(-5deg);
  filter: drop-shadow(0 15px 18px rgba(91,67,38,.22));
  animation: mdrFloat 3s ease-in-out infinite;
  pointer-events: none;
}
.mdr-spark { position: absolute; z-index: 2; color: #e8ad2e; font-size: 12px; }

.mdr-section { padding: 16px; }
.mdr-section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.mdr-eyebrow {
  margin: 0 0 5px;
  color: var(--mdr-gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.mdr-section h2 { margin: 0; font-size: 20px; line-height: 1.16; letter-spacing: 0; }
.mdr-section p { color: var(--mdr-muted); }
.mdr-stack { display: grid; gap: 10px; }

.mdr-menu-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 106px;
  border: 1px solid rgba(234,223,206,.8);
  border-radius: 14px;
  padding: 12px;
  background: var(--mdr-card);
  box-shadow: 0 9px 22px rgba(91,67,38,.07);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}
.mdr-menu-card:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 14px 28px rgba(91,67,38,.11); }
.mdr-menu-card:active { transform: scale(.97); }
.mdr-menu-card[disabled] { opacity: .66; cursor: not-allowed; }
.mdr-menu-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mdr-product-img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 14px;
  background: #f4eee7;
  box-shadow: 0 7px 16px rgba(91,67,38,.10);
  flex: 0 0 auto;
}
.mdr-menu-name { margin: 0; font-size: 15px; line-height: 1.2; font-weight: 800; }
.mdr-kcal { margin-top: 6px; display: grid; gap: 2px; color: #968b7f; font-size: 10px; }
.mdr-price-grid { display: flex; justify-content: flex-end; gap: 14px; }
.mdr-price { text-align: right; min-width: 48px; white-space: nowrap; }
.mdr-price span { display: block; color: #968b7f; font-size: 10px; }
.mdr-price del { display: block; color: #9a9085; font-size: 10px; text-decoration-thickness: 1px; }
.mdr-price strong { display: block; color: var(--mdr-gold); font-size: 15px; }
.mdr-badge {
  position: absolute;
  right: -6px;
  top: -9px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(91,67,38,.15);
  background: #2fb465;
}
.mdr-badge.hot { background: linear-gradient(135deg, #f7c12f, #ef7d2d); animation: mdrPulse 2.2s infinite; }
.mdr-badge.blue { background: #3d83e6; }
.mdr-sold {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  background: rgba(43,37,31,.58);
}

.mdr-grid-2,
.mdr-grid-3 { display: grid; gap: 12px; }
.mdr-grid-2 { grid-template-columns: 1fr; }
.mdr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mdr-info-card {
  overflow: hidden;
  border: 1px solid var(--mdr-line);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 22px rgba(91,67,38,.07);
}
.mdr-info-card img { width: 100%; height: 130px; object-fit: cover; }
.mdr-info-body { padding: 12px; }
.mdr-info-body h3 { margin: 0 0 5px; font-size: 15px; }
.mdr-info-body p { margin: 0; font-size: 12px; line-height: 1.45; }
.mdr-mini-card {
  border: 1px solid var(--mdr-line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.70);
}
.mdr-mini-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.mdr-mini-card h3 { margin: 0 0 4px; font-size: 12px; line-height: 1.2; }
.mdr-mini-card p { margin: 0; font-size: 10px; line-height: 1.35; }

.mdr-video {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  object-fit: cover;
  background: #16110d;
}
.mdr-prep { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mdr-prep-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 74px;
  border: 1px solid var(--mdr-line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.70);
}
.mdr-prep-card img { width: 42px; height: 42px; object-fit: cover; border-radius: 11px; }
.mdr-prep-card strong { display: block; font-size: 11px; line-height: 1.25; }
.mdr-prep-card span { display: block; margin-top: 3px; color: var(--mdr-muted); font-size: 10px; line-height: 1.25; }

.mdr-review {
  min-height: 154px;
  display: none;
  place-items: center;
  text-align: center;
  border-radius: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--mdr-line);
}
.mdr-review.active { display: grid; }
.mdr-review blockquote { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; }
.mdr-review cite { display: block; margin-top: 14px; color: var(--mdr-muted); font-style: normal; font-size: 13px; }
.mdr-review-nav { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.mdr-icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--mdr-ink);
  background: #f3ede6;
}

.mdr-poster-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.mdr-poster-strip img {
  height: 300px;
  width: 100%;
  object-fit: cover;
  border-radius: 18px;
  scroll-snap-align: start;
  box-shadow: 0 12px 24px rgba(91,67,38,.12);
}

.mdr-cart-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 428px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--mdr-line);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 36px rgba(91,67,38,.18);
  backdrop-filter: blur(12px);
}
.mdr-cart-mini { display: flex; gap: 11px; align-items: center; }
.mdr-cart-icon {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--mdr-gold);
}
.mdr-cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--mdr-red);
  font-size: 11px;
  font-weight: 900;
}
.mdr-cart-total { color: var(--mdr-gold); font-weight: 900; }

.mdr-drawer,
.mdr-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(0,0,0,.46);
}
.mdr-drawer.open,
.mdr-modal.open { display: flex; }
.mdr-drawer { align-items: flex-end; }
.mdr-drawer-panel {
  width: min(100%, 460px);
  max-height: 82vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px;
  background: #fff;
}
.mdr-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mdr-drawer-head h2 { margin: 0; font-size: 20px; }
.mdr-cart-items { overflow: auto; display: grid; gap: 12px; padding-right: 2px; }
.mdr-cart-line {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
}
.mdr-cart-line img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.mdr-cart-line h3 { margin: 0; font-size: 14px; }
.mdr-cart-line p { margin: 3px 0 0; color: var(--mdr-muted); font-size: 12px; }
.mdr-qty { display: flex; gap: 7px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.mdr-qty button { width: 26px; height: 26px; border-radius: 8px; border: 0; background: #f3ede6; }
.mdr-drawer-total { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 14px; border-top: 1px solid #eee2d2; }
.mdr-form { display: grid; gap: 10px; margin-top: 14px; }
.mdr-form input,
.mdr-form select,
.mdr-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e1d5c7;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--mdr-ink);
  background: #fffaf4;
}
.mdr-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mdr-segment button {
  border: 1px solid #e1d5c7;
  border-radius: 12px;
  padding: 10px;
  background: #fffaf4;
  font-weight: 800;
}
.mdr-segment button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--mdr-gold-2), var(--mdr-gold)); }

.mdr-chat {
  position: fixed;
  right: max(14px, calc(50vw - 220px));
  bottom: 92px;
  z-index: 55;
}
.mdr-chat-toggle {
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  color: #fff;
  font-weight: 900;
  background: #2f251d;
  box-shadow: 0 14px 28px rgba(47,37,29,.24);
}
.mdr-chat-panel {
  position: absolute;
  right: 0;
  bottom: 54px;
  display: none;
  width: min(330px, calc(100vw - 28px));
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 40px rgba(47,37,29,.24);
}
.mdr-chat-panel.open { display: block; }
.mdr-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; color: #fff; background: #2f251d; }
.mdr-chat-messages { height: 230px; overflow: auto; display: grid; align-content: start; gap: 8px; padding: 12px; background: #fffaf4; }
.mdr-chat-bubble { max-width: 86%; padding: 9px 11px; border-radius: 14px; font-size: 12px; line-height: 1.35; background: #efe6da; }
.mdr-chat-bubble.user { justify-self: end; color: #fff; background: var(--mdr-gold); }
.mdr-chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid #eee2d2; }
.mdr-chat-input input { border: 1px solid #e1d5c7; border-radius: 11px; padding: 9px 10px; min-width: 0; }
.mdr-chat-input button { border: 0; border-radius: 11px; padding: 9px 12px; color: #fff; background: var(--mdr-gold); font-weight: 800; }

.mdr-modal { align-items: center; justify-content: center; padding: 18px; }
.mdr-modal-panel {
  width: min(100%, 390px);
  border-radius: 22px;
  padding: 20px;
  background: #fff;
  text-align: center;
}
.mdr-modal-panel h2 { margin: 0 0 8px; font-size: 19px; }
.mdr-modal-panel p { color: var(--mdr-muted); font-size: 13px; line-height: 1.5; }
.mdr-modal-actions { display: grid; gap: 8px; margin-top: 16px; }

@keyframes mdrSwing {
  0%, 100% { transform: rotate(2deg); }
  50% { transform: rotate(-2deg); }
}
@keyframes mdrFloat {
  0%, 100% { transform: translateX(-44%) translateY(0) rotate(-5deg); }
  50% { transform: translateX(-44%) translateY(-7px) rotate(-5deg); }
}
@keyframes mdrPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251,191,36,.55); }
  70% { transform: scale(1.04); box-shadow: 0 0 0 7px rgba(251,191,36,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}

@media (max-width: 390px) {
  .mdr-menu-card { grid-template-columns: 1fr; }
  .mdr-price-grid { justify-content: flex-start; padding-left: 90px; }
  .mdr-product-img { width: 72px; height: 72px; }
}

@media (min-width: 760px) {
  .mdr-shell {
    width: min(100%, 900px);
    display: grid;
    grid-template-columns: 460px 1fr;
    column-gap: 24px;
    padding: 0 18px 110px;
  }
  .mdr-topbar,
  .mdr-notice,
  .mdr-loyalty,
  .mdr-section { grid-column: 1; margin-left: 0; margin-right: 0; }
  .mdr-secondary { grid-column: 2; grid-row: 1 / span 20; padding-top: 18px; }
  .mdr-secondary .mdr-section { margin-top: 0; margin-bottom: 16px; }
  .mdr-cart-bar { width: min(calc(100% - 40px), 860px); }
}
