/* =========================================================================
   Bánh Mì Ship — mam-public.css
   Mobile-first. BEM naming. CSS variables cho theme color để dễ customize.
   ========================================================================= */

:root {
	/* ===== Navy — theo bộ nhận diện thương hiệu & logo ===== */
	--mam-navy: #022e83;             /* Navy chính — button, giá tiền, viền nhấn */
	--mam-navy-2: #003D8E;           /* Navy phụ — dùng cho gradient/hover, đồng bộ banner web */
	--mam-navy-dark: #04003D;        /* Navy đậm nhất — footer, thanh header cố định, trạng thái nhấn */
	--mam-navy-light: #E7E8F6;       /* Navy nhạt — nền trạng thái được chọn/áp dụng */
	--mam-navy-logo: #022e83;        /* Navy lấy đúng từ file logo — dùng cho chữ hero/tiêu đề section */
	--mam-gradient-navy: linear-gradient(135deg, var(--mam-navy), var(--mam-navy-2));

	/* ===== Gold — lấy theo tông vàng hổ phách trong logo ===== */
	--mam-gold: #FFD700;             /* Gold chính — chữ trên nền navy, CTA quan trọng */
	--mam-yellow: #FFC94D;           /* Vàng phụ — badge, viền nhấn, gradient nhẹ */
	--mam-gold-bright: #FFD93D;      /* Gold sáng — thanh giỏ hàng nổi bật */

	/* ===== Trung tính (tông kem/ivory đúng như nền logo) ===== */
	--mam-cream: #F5F7F9;
	--mam-cream-2: #C0F2F9;
	--mam-text: #1C1730;             /* Chữ chính — navy than, thay cho nâu cũ */
	--mam-text-muted: #6E6785;       /* Chữ phụ — xám navy, thay cho nâu nhạt cũ */
	--mam-white: #ffffff;
	--mam-green: #2e7d32;            /* Giữ nguyên — màu trạng thái "đang mở", không thuộc bộ nhận diện */
	--mam-disabled: #D6D2E8;         /* Nền nút vô hiệu hoá — tông navy nhạt, thay cho hồng cũ */
	--mam-border: #eadfce;
	--mam-radius: 14px;
	--mam-radius-lg: 22px;
	--mam-shadow: 0 4px 14px rgba(7, 0, 98, 0.10);
	--mam-zalo: #0068ff;             /* Giữ nguyên — màu thương hiệu Zalo, không đổi để giữ nhận diện đối tác */
	--mam-max-width: 480px;
	--mam-font: "Nunito", "Segoe UI", system-ui, sans-serif;
}

.mam-app {
	font-family: var(--mam-font);
	color: var(--mam-text);
	background: #E0F8FA;
	max-width: var(--mam-max-width);
	margin: 0 auto;
	min-height: 100vh;
	position: relative;
	box-shadow: var(--mam-shadow);
	padding-bottom: 76px;
}

.mam-app * { box-sizing: border-box; }
.mam-app img { max-width: 100%; display: block; }
.mam-app button { font-family: inherit; cursor: pointer; border: none; }
.mam-app input, .mam-app textarea, .mam-app select { font-family: inherit; font-size: 16px; }

/* ---------- Loading ---------- */
.mam-app__loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 20px; color: var(--mam-text-muted); }
.mam-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--mam-border); border-top-color: var(--mam-navy); animation: mam-spin 0.8s linear infinite; }
@keyframes mam-spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.mam-header { position: sticky; top: 0; z-index: 40; background: var(--mam-navy); color: var(--mam-white); display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--mam-navy-dark); }
.mam-header__badge { font-size: 12px; color: #7FE39B; display: flex; align-items: center; gap: 4px; }
.mam-header__badge::before { content: "●"; color: #7FE39B; }
.mam-header__badge--closed { color: rgba(255,255,255,0.6); }
.mam-header__badge--closed::before { color: rgba(255,255,255,0.6); }
.mam-header__actions { display: flex; gap: 12px; align-items: center; }
.mam-cart-btn { position: relative; font-size: 20px; color: var(--mam-gold); }
.mam-cart-btn__badge { position: absolute; top: -6px; right: -8px; background: var(--mam-gold); color: var(--mam-navy-dark); font-size: 11px; line-height: 1; border-radius: 999px; padding: 2px 5px; min-width: 16px; text-align: center; font-weight: 800; }

/* ---------- Hero ---------- */
.mam-hero { text-align: center; padding: 16px; }
.mam-hero__logo { font-size: 26px; font-weight: 800; letter-spacing: 2px; color: var(--mam-navy-logo); margin: 0; }
.mam-hero__tagline { color: var(--mam-text-muted); font-size: 13px; margin: 4px 0 12px; }
.mam-hero__banner { border-radius: var(--mam-radius-lg); overflow: hidden; }
.mam-hero__banner img { width: 100%; height: 200px; object-fit: cover; }

/* ---------- Section ---------- */
.mam-section { padding: 16px; }
.mam-section__title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.mam-section__title h2 { font-size: 18px; font-weight: 800; margin: 0; text-transform: uppercase; color: var(--mam-navy-logo); }
.mam-section__hint { font-size: 11px; color: var(--mam-text-muted); text-transform: uppercase; }
.mam-section__title--accent { display: block; position: relative; padding-bottom: 10px; }
.mam-section__title--accent::after { content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--mam-navy), var(--mam-yellow)); }

/* ---------- Product grid & card ---------- */
.mam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .mam-grid { grid-template-columns: repeat(4, 1fr); } }
.mam-card { background: var(--mam-white); border-radius: var(--mam-radius); overflow: hidden; box-shadow: var(--mam-shadow); display: flex; flex-direction: column; }
.mam-card__img-wrap { aspect-ratio: 1 / 1; overflow: hidden; cursor: pointer; }
.mam-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.mam-card__body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mam-card__name { font-weight: 700; font-size: 14px; cursor: pointer; }
.mam-card__name-sub { font-size: 10px; color: var(--mam-text-muted); margin-top: 2px; line-height: 1.3; }
.mam-card__desc { font-size: 12px; color: var(--mam-text-muted); }
.mam-card__price { color: var(--mam-navy); font-weight: 800; font-size: 15px; margin-top: auto; }
.mam-card__add-btn,.mam-card__add-btn:hover { background: var(--mam-navy); color: var(--mam-gold); font-weight: 700; font-size: 13px; padding: 8px; border-radius: 999px; text-align: center; margin-top: 6px; }
.mam-card__add-btn:active { background: var(--mam-navy-dark); }

/* ---------- Kitchen note / features ---------- */
.mam-note-box { background: #fff; border-radius: var(--mam-radius-lg); padding: 18px; }
.mam-note-box__cta,.mam-note-box__cta:hover { display: inline-block; margin-top: 10px; background: var(--mam-navy);color: var(--mam-gold); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.mam-features { display: flex; gap: 10px; padding: 0 16px 16px; }
.mam-features__card { flex: 1; background: var(--mam-white); border: 1px solid var(--mam-border); border-radius: var(--mam-radius); padding: 16px 6px; text-align: center; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mam-features__icon { font-size: 22px; }

.mam-zalo-box { display: block; background: var(--mam-white); border: 1px solid var(--mam-border); border-radius: var(--mam-radius-lg); padding: 18px; text-align: center; }
.mam-zalo-box__label { display: block; font-size: 11px; letter-spacing: 2px; color: var(--mam-text-muted); font-weight: 700; margin-bottom: 6px; }
.mam-zalo-box__cta { display: inline-block; font-weight: 800; font-style: italic; color: var(--mam-navy); text-decoration: underline; font-size: 15px; }

/* ---------- Accordion ---------- */
body .mam-accordion { display: flex; flex-direction: column; gap: 10px; margin: 15px; }
.mam-accordion__item { background: var(--mam-white); border: 1.5px solid var(--mam-border); border-radius: var(--mam-radius); overflow: hidden; }
.mam-accordion__item--open { border-color: var(--mam-yellow); }
.mam-accordion__header { background: var(--mam-cream-2)!important; display: flex; align-items: center; gap: 10px; padding: 14px 16px; width: 100%; font-weight: 800; text-align: left; }
.mam-accordion__icon-box { background: none; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.mam-accordion__name { flex: 1; font-size: 14px; text-transform: uppercase; }
.mam-accordion__count { background: var(--mam-cream-2); color: var(--mam-text); border-radius: 999px; font-size: 12px; font-weight: 800; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.mam-accordion__toggle { font-size: 18px; font-weight: 800; color: var(--mam-navy); width: 20px; text-align: center; }
.mam-accordion__body { display: none; padding: 0 16px 12px; border-top: 1px solid var(--mam-border); }
.mam-accordion__item--open .mam-accordion__body { display: block; }

/* ---------- Compact row ---------- */
.mam-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mam-border); }
.mam-row:last-child { border-bottom: none; }
.mam-row__img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.mam-row__info { flex: 1; min-width: 0; }
.mam-row__name { font-size: 13px; font-weight: 700; }
.mam-row__name-sub { font-size: 11px; color: var(--mam-text-muted); margin-top: 1px; line-height: 1.3; }
.mam-row__price { font-size: 12px; color: var(--mam-navy); }
.mam-row__add { width: 30px; height: 30px; border-radius: 50%; background: var(--mam-navy); color: var(--mam-white); font-weight: 800; flex-shrink: 0; }
.mam-row__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Sold out state & badge pills ---------- */
.mam-row--sold-out .mam-row__img { opacity: 0.45; filter: grayscale(1); }
.mam-row--sold-out .mam-row__name { color: var(--mam-text-muted); text-decoration: line-through; }
.mam-card--sold-out .mam-card__img-wrap img { opacity: 0.45; filter: grayscale(1); }
.mam-card--sold-out .mam-card__name { color: var(--mam-text-muted); text-decoration: line-through; }
.mam-badge-pill { display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--mam-cream-2); color: var(--mam-text-muted); border: 1px solid var(--mam-border); }
.mam-badge-pill--soldout { background: var(--mam-navy-light); color: var(--mam-navy); border-color: var(--mam-navy-light); }

/* ---------- Fixed cart bar ---------- */
.mam-fixed-cart {
	position: fixed;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	width: calc(var(--mam-max-width) - 24px);
	max-width: calc(100vw - 24px);
	background: #F5F7F9;
	color: var(--mam-text);
	border-radius: 999px;
	padding: 12px 8px 12px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	box-shadow: 0 8px 20px rgba(7, 0, 98, 0.28);
	z-index: 60;
	cursor: pointer;
	font-weight: 800;
	font-size: 13px;
}
.mam-fixed-cart__total { color: var(--mam-navy); font-size: 15px; }
.mam-fixed-cart__btn { background: var(--mam-navy); color: var(--mam-white); border-radius: 999px; padding: 8px 16px; white-space: nowrap; }

/* ---------- Footer ---------- */
.mam-footer { background: var(--mam-gradient-navy); color: var(--mam-white); padding: 20px 16px; text-align: center; font-size: 13px; }
.mam-footer__social { display: flex; justify-content: center; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.mam-footer__links { display: flex; justify-content: center; gap: 12px; font-size: 12px; opacity: 0.85; }

/* ---------- Sticky bottom promo ---------- */
.mam-promo-banner { position: sticky; bottom: 0; background: var(--mam-navy-dark); color: var(--mam-white); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.mam-promo-banner__close { font-size: 18px; opacity: 0.7; color: var(--mam-navy);}
.mam-promo-banner__cta { background: var(--mam-yellow); color: var(--mam-text); border-radius: 999px; padding: 6px 12px; font-weight: 700; white-space: nowrap; }

/* ---------- Modal ---------- */
.mam-modal-overlay { position: fixed; inset: 0; background: rgba(4, 0, 40, 0.55); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
@media (min-width: 560px) { .mam-modal-overlay { align-items: center; } }
.mam-modal { background: var(--mam-white); width: 100%; max-width: var(--mam-max-width); max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; position: relative; }
@media (min-width: 560px) { .mam-modal { border-radius: var(--mam-radius-lg); } }
.mam-modal__close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,0.45); color: var(--mam-white); font-size: 16px; z-index: 2; }
.mam-modal__img { width: 100%; height: 260px; object-fit: cover; }
.mam-modal__body { padding: 20px; }
.mam-modal__tag { color: var(--mam-navy); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.mam-modal__title { font-size: 22px; font-weight: 800; margin: 6px 0 10px; }
.mam-modal__name-sub { font-size: 14px; color: var(--mam-text-muted); margin: -6px 0 10px; line-height: 1.4; }
.mam-modal__desc { font-size: 14px; color: var(--mam-text-muted); line-height: 1.5; }
.mam-modal__label { font-weight: 800; font-size: 13px; margin: 18px 0 10px; text-transform: uppercase; }

.mam-option { display: flex; align-items: center; justify-content: space-between; border: 1.5px solid var(--mam-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.mam-option--selected { border-color: var(--mam-navy); background: var(--mam-navy-light); }
.mam-option__radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mam-border); margin-right: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mam-option--selected .mam-option__radio { border-color: var(--mam-navy); }
.mam-option--selected .mam-option__radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mam-navy); }
.mam-option__left { display: flex; align-items: center; font-weight: 700; }
.mam-option__price { color: var(--mam-navy); font-weight: 700; }

.mam-stepper { display: flex; align-items: center; gap: 12px; background: var(--mam-white); border-radius: 999px; padding: 6px 14px; }
.mam-stepper__btn { width: 26px; height: 26px; font-size: 18px; font-weight: 700; }
.mam-stepper__value { min-width: 20px; text-align: center; font-weight: 700; }

.mam-modal__footer { display: flex; gap: 10px; padding: 16px 20px; position: sticky; bottom: 0; background: var(--mam-white); border-top: 1px solid var(--mam-border); }

/* ---------- Buttons shared ---------- */
.mam-btn-primary { flex: 1; background: var(--mam-navy); color: var(--mam-white); font-weight: 800; font-size: 15px; padding: 14px; border-radius: 999px; text-align: center; }
.mam-btn-primary:disabled { background: var(--mam-disabled); cursor: not-allowed; }
.mam-btn-secondary { background: var(--mam-cream-2); color: var(--mam-text); font-weight: 700; padding: 12px 16px; border-radius: 999px; }
.mam-btn-zalo { background: var(--mam-zalo); color: var(--mam-white); font-weight: 800; padding: 14px; border-radius: 999px; width: 100%; text-align: center; }

/* ---------- Step header ---------- */
.mam-step-header { position: sticky; top: 0; z-index: 30; background: var(--mam-gradient-navy); color: var(--mam-white); display: flex; align-items: center; gap: 12px; padding: 16px; }
.mam-step-header__back { font-size: 20px;color: var(--mam-navy); }
.mam-step-header__title { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Cart ---------- */
.mam-cart-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--mam-border); }
.mam-cart-item__img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.mam-cart-item__info { flex: 1; min-width: 0; }
.mam-cart-item__name { font-weight: 800; font-size: 14px; }
.mam-cart-item__option { font-size: 12px; color: var(--mam-text-muted); }
.mam-cart-item__price { font-weight: 700; font-size: 14px; white-space: nowrap; }

.mam-upsell-card { display: flex; align-items: center; gap: 10px; background: var(--mam-white); border: 1px solid var(--mam-border); border-radius: var(--mam-radius); padding: 12px; margin: 12px 16px; }
.mam-upsell-card__img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.mam-upsell-card__old-price { text-decoration: line-through; color: var(--mam-text-muted); font-size: 12px; }
.mam-badge-save { background: var(--mam-yellow); border-radius: 999px; font-size: 10px; padding: 2px 8px; font-weight: 700; }

.mam-voucher-item { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--mam-border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.mam-voucher-item--applied { border-color: var(--mam-navy); background: var(--mam-navy-light); }
.mam-voucher-item__icon-box { background: var(--mam-navy-light); color: var(--mam-navy); font-weight: 800; font-size: 11px; border-radius: 8px; padding: 8px; text-align: center; min-width: 46px; }
.mam-voucher-item__title { font-weight: 700; font-size: 13px; }
.mam-voucher-item__sub { font-size: 11px; color: var(--mam-text-muted); }
.mam-voucher-btn { background: var(--mam-yellow); font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.mam-voucher-btn:disabled { background: var(--mam-border); color: var(--mam-text-muted); }

.mam-bill { background: var(--mam-cream-2); border-radius: var(--mam-radius); padding: 16px; margin: 16px; }
.mam-bill__row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.mam-bill__row--discount { color: var(--mam-green); }
.mam-bill__row--total { font-weight: 800; font-size: 17px; color: var(--mam-navy); border-top: 1px dashed var(--mam-border); margin-top: 6px; padding-top: 10px; }

.mam-sticky-cta { position: sticky; bottom: 0; padding: 14px 16px; background: var(--mam-cream); border-top: 1px solid var(--mam-border); }

/* ---------- Delivery form ---------- */
.mam-form-card { background: var(--mam-white); border-radius: var(--mam-radius); margin: 16px; padding: 18px; }
.mam-field { margin-bottom: 16px; }
.mam-field label { display: block; font-size: 12px; font-weight: 700; color: var(--mam-navy); text-transform: uppercase; margin-bottom: 6px; }
.mam-field .mam-input-wrap { position: relative; }
.mam-field input, .mam-field textarea { width: 100%; padding: 12px 36px 12px 14px; border: 1px solid var(--mam-border); border-radius: 10px; background: var(--mam-cream-2); }
.mam-field--error input { border-color: #cc8b12; }
.mam-field__clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--mam-text-muted); }
.mam-field__error-msg { background: #fdf1d8; color: #8a5a00; font-size: 12px; padding: 8px 12px; border-radius: 8px; margin-top: 6px; }

.mam-time-card { background: var(--mam-white); border-radius: var(--mam-radius); margin: 0 16px 16px; padding: 16px; }
.mam-time-card__row { display: flex; align-items: center; justify-content: space-between; }
.mam-toggle { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--mam-border); }
.mam-toggle--on { background: var(--mam-navy); }
.mam-toggle__knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--mam-white); transition: transform 0.15s; }
.mam-toggle--on .mam-toggle__knob { transform: translateX(20px); }
.mam-kitchen-closed-banner { background: #fdf1d8; color: #8a5a00; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin: 12px 0; }
.mam-select-wrap select { width: 100%; padding: 12px 14px; border: 1px solid var(--mam-border); border-radius: 10px; background: var(--mam-white); appearance: none; }

/* ---------- Payment ---------- */
.mam-summary-card { background: var(--mam-cream-2); border-radius: var(--mam-radius); margin: 16px; padding: 16px; }
.mam-payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px 16px; }
.mam-payment-card { border: 1.5px solid var(--mam-border); border-radius: var(--mam-radius); padding: 14px; text-align: center; position: relative; cursor: pointer; }
.mam-payment-card--selected { border-color: var(--mam-navy); background: var(--mam-navy-light); }
.mam-payment-card__icon { font-size: 24px; margin-bottom: 6px; }
.mam-payment-card__label { font-weight: 800; font-size: 13px; }
.mam-payment-card__sub { font-size: 11px; color: var(--mam-text-muted); }
.mam-payment-card__dot { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mam-border); }
.mam-payment-card--selected .mam-payment-card__dot { border-color: var(--mam-navy); background: radial-gradient(var(--mam-navy) 45%, transparent 50%); }

/* ---------- MoMo QR ---------- */
.mam-momo-qr-box { background: var(--mam-white); border: 1px solid var(--mam-border); border-radius: var(--mam-radius); margin: 16px; padding: 20px; text-align: center; }
.mam-momo-qr-box canvas, .mam-momo-qr-box img { margin: 0 auto 14px; }
.mam-momo-amount-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--mam-border); font-weight: 700; }
.mam-polling-status { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--mam-white); border-radius: 999px; margin: 0 16px; padding: 12px; font-weight: 700; }
.mam-polling-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mam-navy); animation: mam-pulse 1s infinite; }
@keyframes mam-pulse { 50% { opacity: 0.2; } }

/* ---------- Cash confirmation ---------- */
.mam-confirm-box { text-align: center; padding: 40px 24px; }
.mam-confirm-box__code { font-size: 22px; font-weight: 800; color: var(--mam-navy); margin: 10px 0 16px; }
.mam-confirm-box__desc { color: var(--mam-text-muted); margin-bottom: 24px; font-size: 14px; }

/* ---------- Toast ---------- */
.mam-toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--mam-text); color: var(--mam-white); padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; transition: all 0.25s; z-index: 200; pointer-events: none; }
.mam-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.mam-hidden { display: none !important; }