/* Motor Tienda — public store. Colors come from the store palette (CSS variables). */
.mt-store, .mt-overlay {
	--mt-bg: #ffffff; --mt-primary: #333333; --mt-secondary: #666666; --mt-text: #1c1c1c;
}
.mt-store {
	background: var(--mt-bg); color: var(--mt-text);
	padding: 16px; border-radius: 12px; max-width: 1100px; margin: 0 auto; box-sizing: border-box;
	font-size: 16px; line-height: 1.45;
}
.mt-store *, .mt-overlay * { box-sizing: border-box; }
.mt-title { margin: 0 0 6px; color: var(--mt-primary); }
.mt-intro { color: var(--mt-secondary); margin-bottom: 12px; }
.mt-store-msg { padding: 12px; background: #fff7e6; border-radius: 8px; }
.mt-muted, .mt-help { color: var(--mt-secondary); font-size: .95em; }
.mt-ok { color: #1a7f37; font-weight: 600; }
.mt-err { color: #b42318; }
ul.mt-err { padding-left: 18px; }

.mt-cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; position: sticky; top: 0; background: var(--mt-bg); z-index: 5; }
.mt-cats a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--mt-primary); color: var(--mt-primary); text-decoration: none; }
.mt-cat { margin: 18px 0 8px; color: var(--mt-primary); scroll-margin-top: 56px; }
.mt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } /* Never more than 2 columns. */
.mt-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.mt-card img, .mt-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #eee; }
.mt-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.mt-card h4 { margin: 0 0 4px; font-size: 1.05em; }
.mt-desc { margin: 0 0 8px; color: var(--mt-secondary); font-size: .92em; }
.mt-card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt-price { font-weight: 700; }
.mt-soldout { opacity: .6; }
.mt-badge { background: #eee; border-radius: 6px; padding: 4px 8px; font-size: .85em; }

.mt-btn { background: var(--mt-primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; font-size: 1em; }
.mt-btn[disabled] { opacity: .5; cursor: default; }
.mt-btn-big { width: 100%; padding: 14px; font-size: 1.1em; margin-top: 12px; }
.mt-link { background: none; border: 0; color: var(--mt-primary); cursor: pointer; padding: 6px 0; font-size: 1em; text-decoration: underline; }

.mt-checkout { margin-top: 28px; padding: 16px; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); max-width: 640px; }
.mt-checkout h3 { margin-top: 0; }
.mt-cart { list-style: none; padding: 0; margin: 0 0 12px; }
.mt-cart li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; }
.mt-cart small { display: block; color: var(--mt-secondary); }
.mt-cart-name strong { display: block; }
.mt-cart-name .mt-link { display: block; margin-top: 6px; padding: 0; }
.mt-qty { display: inline-flex; align-items: center; gap: 6px; }
.mt-qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--mt-primary); background: #fff; color: var(--mt-primary); font-size: 1.1em; cursor: pointer; }
.mt-qty-n { min-width: 22px; text-align: center; }
.mt-r { text-align: right; white-space: nowrap; }
.mt-seg { display: flex; border: 1px solid var(--mt-primary); border-radius: 10px; overflow: hidden; margin: 12px 0; }
.mt-seg button { flex: 1; padding: 10px; border: 0; background: #fff; color: var(--mt-primary); font-weight: 600; cursor: pointer; font-size: 1em; }
.mt-seg button.is-on { background: var(--mt-primary); color: #fff; }
.mt-field { display: block; margin: 10px 0; }
.mt-field span { display: block; font-size: .9em; margin-bottom: 4px; color: var(--mt-secondary); }
.mt-field input, .mt-field select, .mt-field textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 1em; background: #fff; color: #111; }
.mt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-lines { width: 100%; border-collapse: collapse; margin-top: 12px; }
.mt-lines td { padding: 6px 0; border-bottom: 1px solid #eee; }
.mt-total td { font-weight: 700; font-size: 1.1em; border-bottom: 0; }
.mt-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.mt-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; background: var(--mt-primary, #333); color: #fff; border: 3px solid #fff; border-radius: 999px; padding: 18px 34px; min-width: 300px; max-width: calc(100% - 24px); font-weight: 800; font-size: 1.25em; box-shadow: 0 6px 22px rgba(0,0,0,.35); cursor: pointer; }
.mt-bar[hidden] { display: none; }
.mt-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100000; display: flex; align-items: flex-end; justify-content: center; }
.mt-dialog { background: #fff; color: #1c1c1c; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px; }
@media (min-width: 640px) { .mt-overlay { align-items: center; } .mt-dialog { border-radius: 16px; } }
.mt-dialog h3 { margin-top: 0; }
.mt-opt { border: 1px solid #eee; border-radius: 10px; margin: 10px 0; padding: 8px 12px; }
.mt-choice { display: block; padding: 6px 0; cursor: pointer; }
.mt-dialog-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }
body.mt-noscroll { overflow: hidden; }

/* Pickup point: big and in plain sight */
.mt-pickup { display: block; border: 2px solid var(--mt-primary); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: #fff; }
.mt-pickup-label { display: block; font-size: 1em; color: var(--mt-secondary); margin-bottom: 4px; }
.mt-pickup-name { display: block; font-size: 1.35em; color: var(--mt-primary); }
.mt-pickup-addr { display: block; font-size: 1.25em; font-weight: 600; margin-top: 2px; }

/* Cart button, toast and side panel */
.mt-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.mt-cartbtn { background: #fff; color: var(--mt-primary); border: 2px solid var(--mt-primary); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 1em; }
.mt-cartbtn[hidden] { display: none; }
.mt-toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: #1c1c1c; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; font-size: .95em; }
.mt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.mt-overlay.mt-side { justify-content: flex-end; align-items: stretch; }
.mt-drawer { background: #fff; color: #1c1c1c; width: 100%; max-width: 420px; height: 100%; overflow: auto; padding: 18px; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.mt-side.is-open .mt-drawer { transform: translateX(0); }
.mt-drawer-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.mt-drawer-head h3 { margin: 0 0 8px; }
.mt-close { background: none; border: 0; font-size: 2em; line-height: 1; cursor: pointer; color: #555; }
.mt-drawer-sub { display: flex; justify-content: space-between; font-size: 1.15em; padding: 12px 0; }
.mt-small { font-size: .88em; }
.mt-link.mt-block { display: block; margin: 10px auto 0; }
.mt-cart-ro { grid-template-columns: 1fr auto auto; }
.mt-checkout[hidden], .mt-menu[hidden] { display: none; }
@media (min-width: 640px) { .mt-overlay.mt-side { align-items: stretch; } }

.mt-confirm { max-width: 560px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 18px; }
.mt-number { font-size: 1.2em; }
.mt-paynote { background: #f4f4f4; padding: 10px; border-radius: 8px; }

/* Delivery address (autocomplete) */
.mt-places-wrap { position: relative; display: block; }
.mt-places-list { position: absolute; z-index: 30; left: 0; right: 0; margin: 2px 0 0; padding: 0; list-style: none; background: #fff; color: #1c1c1c; border: 1px solid #bbb; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.2); overflow: hidden; }
.mt-places-list li { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 1em; }
.mt-places-list li:last-child { border-bottom: 0; }
.mt-places-list li.is-active { background: #f3f3f3; }
.mt-places-list li span { color: #666; }
.mt-places-note { display: block; margin-top: 4px; color: #b42318; font-size: .92em; }
.mt-deliv { display: block; border: 2px solid #1a7f37; border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: #f2fbf4; }
.mt-deliv-addr { display: block; font-size: 1.1em; font-weight: 600; }
.mt-deliv-fee { display: block; font-size: 1.3em; font-weight: 800; color: #1a7f37; margin-top: 2px; }
.mt-deliv-out { display: block; border: 2px solid #b42318; border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: #fdf1f0; color: #b42318; font-size: 1.15em; font-weight: 700; }
/* Fields with a problem: red border and the reason under the field */
.mt-field input.mt-invalid, .mt-field select.mt-invalid, .mt-field textarea.mt-invalid { border: 2px solid #b42318; background: #fff6f5; }
.mt-field-err { display: block; color: #b42318; font-size: .95em; font-weight: 600; margin-top: 4px; }
.mt-consent { border: 1px solid #ddd; border-radius: 10px; padding: 10px 12px; margin: 12px 0; background: #fff; }
.mt-consent.is-invalid { border: 2px solid #b42318; background: #fff6f5; }
.mt-consent-line { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.mt-consent-line input { margin-top: 4px; width: 20px; height: 20px; flex: 0 0 auto; }
.mt-policy { margin-top: 8px; }
.mt-policy summary { cursor: pointer; color: var(--mt-primary); text-decoration: underline; }
.mt-policy-text { white-space: pre-line; max-height: 220px; overflow: auto; margin-top: 6px; padding: 8px; background: #f6f6f6; border-radius: 8px; font-size: .92em; }

/* Lost connection and "store did not load" fallbacks */
.mt-offline { border: 2px solid #b54708; background: #fffaeb; color: #7a2e0e; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.mt-offline .mt-btn { margin-top: 8px; margin-right: 10px; }
.mt-wa { display: inline-block; }
.mt-fallback-wa { visibility: hidden; animation: mt-reveal 0s linear 8s forwards; } /* Shown only if the store has not loaded after 8 s. */
@keyframes mt-reveal { to { visibility: visible; } }
.mt-soon-page { text-align: center; padding: 48px 16px; }
.mt-soon-page .mt-store-msg { display: inline-block; font-size: 1.2em; }
.mt-preview-note { margin: 8px 0; }

/* Coupon (C3) */
.mt-coupon { margin: 12px 0; }
.mt-coupon-row { display: flex; gap: 8px; }
.mt-coupon-row input { flex: 1 1 auto; min-width: 0; }
.mt-btn-light { background: #fff; color: var(--mt-primary); border: 2px solid var(--mt-primary); }
.mt-coupon.is-invalid input { border-color: #b42318; }
.mt-lines .mt-discount td { color: #15803d; font-weight: 600; }
