/* ===================================================
   Da Terra — Catálogo Público
   Estilo: iFood / Shopee / Marketplace moderno
   =================================================== */

:root {
  --verde:         #4A7A1E;
  --verde-escuro:  #2E5010;
  --verde-claro:   #6FA832;
  --dourado:       #D4A833;
  --dourado-esc:   #A67C1A;
  --bege:          #F4E2C8;
  --bege-esc:      #E8CFA8;
  --marrom:        #7A5230;
  --bg:            #F7F3EE;
  --radius:        10px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); margin: 0; }

/* ── NAVBAR ──────────────────────────────────────── */
.cat-navbar {
  background: linear-gradient(90deg, var(--verde-escuro), var(--verde));
  border-bottom: 3px solid var(--dourado);
  padding: .6rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.cat-brand { display: flex; flex-direction: column; line-height: 1.1; }
.cat-brand .da-terra {
  font-family: 'Georgia', serif; font-style: italic;
  color: var(--dourado); font-size: 1.4rem; font-weight: 700;
}
.cat-brand .chips { font-size: .62rem; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.6); }

.cat-nav-actions { display: flex; align-items: center; gap: .65rem; }
.cat-nav-link { color: rgba(255,255,255,.85); font-size: .82rem; text-decoration: none; padding: .3rem .6rem; border-radius: 6px; transition: all .15s; }
.cat-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }

.cart-float-btn {
  position: relative;
  background: var(--dourado);
  border: none; border-radius: 8px;
  padding: .4rem .85rem;
  color: #fff; font-size: .82rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: .4rem;
  transition: background .15s;
}
.cart-float-btn:hover { background: var(--dourado-esc); }
.cart-float-btn .cart-count {
  background: #fff; color: var(--verde);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── HERO ─────────────────────────────────────────── */
.cat-hero {
  background: linear-gradient(135deg, var(--verde-escuro) 0%, var(--verde) 55%, var(--verde-claro) 100%);
  padding: 3rem 1.5rem;
  text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute; top: -60px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%; background: rgba(212,168,51,.12);
  pointer-events: none;
}
.cat-hero .hero-title {
  font-family: 'Georgia', serif; font-style: italic;
  color: var(--dourado); font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700; line-height: 1; margin-bottom: .25rem;
}
.cat-hero .hero-sub {
  font-size: .72rem; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,.7); margin-bottom: 1rem;
}
.cat-hero .hero-desc { font-size: .95rem; opacity: .85; margin-bottom: 1.5rem; }

.cat-search {
  display: flex; gap: .5rem; justify-content: center;
  flex-wrap: wrap; padding: 0 1rem;
}
.cat-search input {
  padding: .55rem 1rem; border-radius: 8px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15); color: #fff; font-size: .88rem;
  width: min(340px, 100%); outline: none; backdrop-filter: blur(4px);
  transition: border .15s;
}
.cat-search input::placeholder { color: rgba(255,255,255,.6); }
.cat-search input:focus { border-color: var(--dourado); background: rgba(255,255,255,.2); }
.cat-search button {
  padding: .55rem 1.1rem; border-radius: 8px; border: none;
  background: var(--dourado); color: #fff; font-weight: 700; font-size: .85rem;
  cursor: pointer; transition: background .15s;
}
.cat-search button:hover { background: var(--dourado-esc); }

/* ── CATEGORY PILLS ───────────────────────────────── */
.cat-filters {
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding: 1rem 1.25rem .5rem;
  justify-content: center;
}
.cat-pill {
  padding: .3rem .9rem; border-radius: 20px; font-size: .78rem; font-weight: 700;
  border: 1.5px solid #ddd; background: #fff; color: #666;
  text-decoration: none; transition: all .15s; cursor: pointer;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--verde); border-color: var(--verde); color: #fff;
}

/* ── PRODUCT GRID ─────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 220px));
  gap: 1rem;
  padding: .75rem 1.25rem 1.5rem;
  justify-content: center;
}

.prod-card {
  background: #fff; border-radius: var(--radius);
  border: 1.5px solid #ede8e0; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column;
}
.prod-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(46,80,16,.14);
  border-color: var(--verde-claro);
}
.prod-card-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  transition: transform .3s;
}
.prod-card:hover .prod-card-img { transform: scale(1.04); }
.prod-card-img-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bege), var(--bege-esc));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.prod-card-body {
  padding: .75rem .9rem .5rem; flex: 1;
}
.prod-card-cat {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .5px;
  font-weight: 700; color: var(--marrom); background: var(--bege);
  border-radius: 20px; padding: .1rem .5rem;
  display: inline-block; margin-bottom: .35rem;
}
.prod-card-name {
  font-size: .9rem; font-weight: 700; color: #1f1f1f;
  margin-bottom: .25rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.prod-card-desc {
  font-size: .75rem; color: #999; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: .4rem;
}
.prod-card-price {
  font-size: 1.1rem; font-weight: 800; color: var(--verde);
}
.prod-card-footer {
  padding: .6rem .9rem .9rem;
}
.btn-add {
  width: 100%; padding: .45rem; border-radius: 8px;
  background: var(--verde); color: #fff; border: none;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  transition: background .15s;
}
.btn-add:hover { background: var(--verde-escuro); }

/* ── CARRINHO MODAL ───────────────────────────────── */
.cart-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 900;
  backdrop-filter: blur(2px);
}
.cart-backdrop.open { display: block; }

.cart-panel {
  position: fixed; top: 0; right: -110%; bottom: 0;
  width: min(420px, 100vw);
  background: #fff; z-index: 901;
  display: flex; flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.cart-panel.open { right: 0; }

.cart-panel-header {
  background: var(--verde-escuro); color: #fff;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.cart-panel-header h5 { margin: 0; font-size: .95rem; font-weight: 700; }
.cart-close {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.cart-close:hover { background: rgba(255,255,255,.3); }

.cart-panel-body { flex: 1; overflow-y: auto; padding: 1rem; }

.cart-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .8rem 0; border-bottom: 1px solid #f0ece6;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
  border: 1px solid #eee; flex-shrink: 0;
}
.cart-item-img-ph {
  width: 60px; height: 60px; border-radius: 8px;
  background: var(--bege); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: .85rem; }
.cart-item-price { font-size: .78rem; color: #999; }
.cart-item-subtotal { font-weight: 800; color: var(--verde); font-size: .9rem; }

.cart-qty {
  display: flex; align-items: center; gap: .4rem; margin-top: .35rem;
}
.cart-qty button {
  width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid #ddd;
  background: #fff; color: #333; font-size: .9rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.cart-qty button:hover { background: var(--verde); color: #fff; border-color: var(--verde); }
.cart-qty .qty-val { font-weight: 700; font-size: .88rem; min-width: 24px; text-align: center; }

.cart-item-remove {
  background: none; border: none; color: #ccc; font-size: 1rem;
  cursor: pointer; padding: 0; transition: color .12s; align-self: flex-start;
}
.cart-item-remove:hover { color: #DC2626; }

.cart-panel-footer {
  border-top: 2px solid #f0ece6; padding: 1rem;
  flex-shrink: 0; background: #fff;
}
.cart-total-row {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: #888; margin-bottom: .3rem;
}
.cart-total-row.final {
  font-size: 1rem; font-weight: 800; color: #1f1f1f; margin-bottom: .75rem;
}
.btn-checkout {
  width: 100%; padding: .7rem; border-radius: 10px;
  background: var(--verde); color: #fff; border: none;
  font-size: .9rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  transition: background .15s;
}
.btn-checkout:hover { background: var(--verde-escuro); }
.btn-continue {
  width: 100%; padding: .5rem; border-radius: 10px; margin-top: .5rem;
  background: none; border: 1.5px solid #ddd; color: #666;
  font-size: .82rem; cursor: pointer; transition: all .15s;
}
.btn-continue:hover { border-color: var(--verde); color: var(--verde); }

/* ── CHECKOUT FORM (MODAL) ────────────────────────── */
.checkout-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 950;
  align-items: center; justify-content: center;
}
.checkout-modal-overlay.open { display: flex; }

.checkout-modal {
  background: #fff; border-radius: 14px;
  width: min(480px, 95vw); max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.checkout-modal-header {
  background: var(--verde-escuro); color: #fff; padding: 1rem 1.25rem;
  border-radius: 14px 14px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.checkout-modal-header h5 { margin: 0; font-size: .95rem; font-weight: 700; }
.checkout-modal-body { padding: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { font-size: .78rem; font-weight: 700; color: #444; display: block; margin-bottom: .3rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .5rem .8rem;
  border: 1.5px solid #ddd; border-radius: 8px; font-size: .85rem;
  transition: border .15s, box-shadow .15s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--verde-claro); box-shadow: 0 0 0 3px rgba(74,122,30,.1);
}

.forma-pag-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.forma-pag-opt {
  border: 2px solid #ddd; border-radius: 10px; padding: .65rem .5rem;
  text-align: center; cursor: pointer; transition: all .15s;
}
.forma-pag-opt:hover, .forma-pag-opt.selected {
  border-color: var(--verde); background: rgba(74,122,30,.06);
}
.forma-pag-opt .icon { font-size: 1.4rem; display: block; }
.forma-pag-opt .label { font-size: .72rem; font-weight: 700; color: #555; margin-top: .2rem; }

.order-summary { background: var(--bege); border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; }
.order-summary-item { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .2rem; color: #666; }
.order-summary-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1rem; color: var(--verde); margin-top: .5rem; border-top: 1px solid var(--bege-esc); padding-top: .5rem; }

/* ── FEATURES SECTION ─────────────────────────────── */
.features-section {
  background: var(--verde-escuro); color: #fff;
  padding: 2.5rem 1.25rem; margin-top: 2rem;
}
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; max-width: 800px; margin: 0 auto; text-align: center;
}
.feature-item .icon { font-size: 2rem; display: block; margin-bottom: .5rem; color: var(--dourado); }
.feature-item .feat-title { font-weight: 700; font-size: .88rem; }
.feature-item .feat-desc { font-size: .75rem; opacity: .7; margin-top: .2rem; }

/* ── HOW IT WORKS ─────────────────────────────────── */
.how-section { padding: 2rem 1.25rem; background: #fff; text-align: center; }
.how-steps { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.how-step { display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 100px; }
.how-step .step-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--bege); color: var(--verde); font-size: 1.4rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.how-step .step-txt { font-size: .75rem; color: #666; font-weight: 600; text-align: center; max-width: 90px; }
.how-arrow { color: #ccc; font-size: 1.2rem; }

/* ── FOOTER ───────────────────────────────────────── */
.cat-footer {
  background: var(--verde-escuro);
  border-top: 3px solid var(--dourado);
  color: rgba(255,255,255,.7); text-align: center;
  padding: 1.5rem 1.25rem; font-size: .78rem;
}
.cat-footer a { color: var(--bege); text-decoration: none; }
.cat-footer a:hover { color: #fff; }
.cat-footer .footer-brand {
  font-family: 'Georgia', serif; font-style: italic;
  color: var(--dourado); font-size: 1.3rem; font-weight: 700; display: block; margin-bottom: .25rem;
}

/* ── TOAST ────────────────────────────────────────── */
.cat-toast-container { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.cat-toast {
  background: #fff; border-radius: 10px; padding: .7rem 1.2rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: .6rem;
  font-size: .83rem; font-weight: 600;
  animation: toastIn .25s ease;
  white-space: nowrap;
}
@keyframes toastIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.cat-toast .t-icon { font-size: 1.1rem; }
.cat-toast.success .t-icon { color: var(--verde); }

/* ── EMPTY STATE ──────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: #bbb; }
.empty-state .empty-icon { font-size: 3rem; display: block; margin-bottom: .75rem; }

/* ══ RESPONSIVE ═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 210px)); justify-content: center; }
}

@media (max-width: 768px) {
  /* Navbar */
  .cat-navbar { padding: .5rem 1rem; }
  .cat-brand .da-terra { font-size: 1.1rem; }
  .cat-nav-link { display: none; } /* esconde links no mobile, fica só o carrinho */

  /* Hero */
  .cat-hero { padding: 2rem 1rem; border-radius: 0; }
  .cat-hero .hero-title { font-size: 2rem; }
  .cat-hero .hero-sub { font-size: .6rem; letter-spacing: 2px; }
  .cat-hero .hero-desc { font-size: .85rem; }
  .cat-search { padding: 0 .5rem; }
  .cat-search input { font-size: .82rem; }

  /* Filtros */
  .cat-filters { padding: .75rem .75rem .25rem; gap: .35rem; }
  .cat-pill { font-size: .72rem; padding: .25rem .7rem; }

  /* Grid */
  .cat-grid { grid-template-columns: repeat(2, minmax(150px, 180px)); padding: .75rem; gap: .65rem; justify-content: center; }

  /* Cards */
  .prod-card-name { font-size: .82rem; }
  .prod-card-price { font-size: .95rem; }
  .prod-card-body { padding: .65rem .75rem .4rem; }
  .prod-card-footer { padding: .5rem .75rem .75rem; }
  .btn-add { font-size: .78rem; padding: .4rem; }

  /* Carrinho */
  .cart-panel { width: 100vw; }

  /* Checkout modal */
  .checkout-modal { width: 100vw; max-height: 100vh; border-radius: 14px 14px 0 0; margin-top: auto; }
  .checkout-modal-overlay.open { align-items: flex-end; }

  /* How steps */
  .how-steps { gap: .75rem; }
  .how-arrow { display: none; }
  .how-steps { flex-wrap: wrap; justify-content: center; }
  .how-step { min-width: 120px; }

  /* Features */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Footer */
  .cat-footer { padding: 1.5rem 1rem; font-size: .76rem; }
  .cat-footer .footer-brand { font-size: 1.1rem; }
}

@media (max-width: 400px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: .5rem; padding: .5rem; justify-content: center; }
  .prod-card-img, .prod-card-img-placeholder { aspect-ratio: 1/1; }
  .prod-card-name { font-size: .78rem; -webkit-line-clamp: 1; }
  .cat-hero .hero-title { font-size: 1.6rem; }
  .forma-pag-grid { grid-template-columns: 1fr 1fr; }
}
