/* ALIMENTACAO TEMPLATE - IFOOD STYLE, APP-LIKE, RED PRIMARY */
:root {
  --font: 'Poppins', sans-serif;
  --bg: #f7f7f7;
  --bg-card: #ffffff;
  --text: #3e3e3e;
  --text-dark: #1a1a1a;
  --text-muted: #717171;
  --primary: #ea1d2c; /* IFood Red */
  --primary-hover: #c91825;
  --border: #f0f0f0;
  --border-dark: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme='dark'] {
  --bg: #121212;
  --bg-card: #1e1e1e;
  --text: #e0e0e0;
  --text-dark: #ffffff;
  --text-muted: #a0a0a0;
  --border: #2a2a2a;
  --border-dark: #3a3a3a;
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; padding-bottom: 80px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--text-dark); font-weight: 600; }

.container { max-width: 800px; margin: 0 auto; padding: 0 16px; }

/* Header App-like */
.site-header { background: var(--bg-card); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.brand-logo { max-height: 30px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.btn-theme { background: transparent; border: none; color: var(--text-dark); cursor: pointer; display: flex; }
.btn-cart-header { background: transparent; border: none; color: var(--primary); cursor: pointer; position: relative; display: flex; }
.cart-badge { position: absolute; top: -8px; right: -8px; background: var(--primary); color: white; font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-card); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* Banner / Store Info */
.store-banner { background: var(--bg-card); padding-bottom: 24px; margin-bottom: 16px; }
.banner-bg { height: 120px; background: linear-gradient(135deg, #ea1d2c 0%, #ff5e62 100%); opacity: 0.8; }
.store-info { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -40px; position: relative; }
.store-avatar { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--bg-card); object-fit: cover; background: white; box-shadow: var(--shadow); }
.store-details h1 { font-size: 1.5rem; margin-top: 12px; }
.tagline { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.info-badges { display: flex; gap: 8px; justify-content: center; align-items: center; color: #f5a623; font-weight: 600; font-size: 0.85rem; margin-top: 8px; }
.info-badges span:last-child { color: var(--text-muted); font-weight: 400; }
.btn-whatsapp { display: inline-flex; margin-top: 16px; background: #25D366; color: white; font-weight: 600; font-size: 0.9rem; padding: 10px 24px; border-radius: 50px; }

/* Search & Categories */
.search-section { background: var(--bg-card); padding: 16px 0; margin-bottom: 16px; position: sticky; top: 60px; z-index: 99; }
.search-bar { display: flex; align-items: center; background: var(--bg); border-radius: 8px; padding: 0 16px; height: 48px; border: 1px solid var(--border); }
.search-bar svg { color: var(--text-muted); }
.search-bar input { flex: 1; border: none; background: transparent; padding: 0 12px; font-family: var(--font); font-size: 1rem; color: var(--text); outline: none; }

.cat-chips { display: flex; overflow-x: auto; gap: 12px; padding: 4px 0 16px; scrollbar-width: none; -ms-overflow-style: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 50px; font-size: 0.9rem; font-weight: 500; color: var(--text-dark); cursor: pointer; }
.chip.is-active { background: var(--primary); color: white; border-color: var(--primary); }

/* Products List (IFood style) */
.products-grouped { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.products-grid { display: flex; flex-direction: column; gap: 16px; } /* Override grid */

.card { display: flex; background: var(--bg-card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s; border: 1px solid var(--border); position: relative; }
.card:active { transform: scale(0.98); }
.card-body { flex: 1; padding-right: 16px; display: flex; flex-direction: column; justify-content: center; }
.card-body h3 { font-size: 1rem; margin-bottom: 4px; line-height: 1.3; }
.card-var { font-size: 0.8rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.card-price { font-weight: 600; font-size: 1rem; color: var(--text-dark); margin-top: auto; }
.card-thumb-wrap { width: 100px; height: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--bg); position: relative; }
.card-thumb { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; top: 0; left: 0; background: var(--primary); color: white; font-size: 0.6rem; padding: 2px 6px; border-radius: 0 0 8px 0; font-weight: 700; text-transform: uppercase; }
.card-actions { display: none; } /* Hide actions, full card is clickable */
.btn-add-modal { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; } /* Invisible button covering card */

/* Modals */
.modal-backdrop, .cart-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-backdrop.is-open, .cart-backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-radius: 24px 24px 0 0; max-height: 90vh; overflow-y: auto; z-index: 1001; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-backdrop.is-open .modal { transform: translateY(0); }
@media (min-width: 600px) {
  .modal { top: 50%; left: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%) scale(0.9); width: 100%; max-width: 480px; border-radius: 16px; }
  .modal-backdrop.is-open .modal { transform: translate(-50%, -50%) scale(1); }
}

.modal-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.8); border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #333; cursor: pointer; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.modal-product-img { width: 100%; height: 250px; object-fit: cover; }
.modal-content { padding: 24px; }
.modal-content h3 { font-size: 1.4rem; margin-bottom: 8px; }
.modal-price { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }

.btn-checkout { background: var(--primary); color: white; border: none; border-radius: 8px; padding: 16px; font-family: var(--font); font-size: 1rem; font-weight: 600; width: 100%; cursor: pointer; transition: background 0.2s; display: block; text-align: center; }
.btn-checkout:hover { background: var(--primary-hover); }

/* Variables Grid */
.var-grid { display: flex; flex-direction: column; gap: 8px; }
.var-opt { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: var(--font); font-size: 1rem; color: var(--text-dark); cursor: pointer; text-align: left; }
.var-opt.is-selected { border-color: var(--primary); background: rgba(234, 29, 44, 0.05); font-weight: 600; }
.var-opt.is-selected::after { content: '✓'; color: var(--primary); font-weight: bold; }

/* Cart Panel */
.cart-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 400px; background: var(--bg-card); z-index: 1001; transform: translateX(100%); transition: transform 0.3s; display: flex; flex-direction: column; }
.cart-panel.is-open { transform: translateX(0); }
.cart-head { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.btn-close-cart { background: transparent; border: none; font-size: 24px; color: var(--text-dark); cursor: pointer; }
.cart-body { flex: 1; overflow-y: auto; padding: 20px; }
.cart-foot { padding: 20px; border-top: 1px solid var(--border); background: var(--bg-card); box-shadow: 0 -4px 12px rgba(0,0,0,0.05); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }
.empty-state { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 1.1rem; }

.cart-item { display: flex; gap: 16px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px dashed var(--border); }
.cart-item-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-title { font-weight: 600; font-size: 0.95rem; }
.cart-item-var { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.cart-item-price { font-weight: 700; margin-top: 8px; }
.qty-ctrl { display: inline-flex; align-items: center; background: var(--bg); border-radius: 50px; margin-top: 8px; }
.qty-ctrl button { background: transparent; border: none; padding: 4px 12px; color: var(--primary); font-size: 1.2rem; cursor: pointer; font-weight: bold; }
.qty-ctrl span { padding: 0 4px; font-weight: 600; min-width: 24px; text-align: center; }

/* Form Fields in Checkout Modal */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--text-dark); }
.input { width: 100%; padding: 14px; border: 1px solid var(--border-dark); border-radius: 8px; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; transition: border-color 0.2s; }
.input:focus { outline: none; border-color: var(--primary); }

.site-footer { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 0.9rem; }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-weight: 600; }
