:root {
  --green-dark: #1f4d2c;
  --green: #2e7d47;
  --green-light: #6fbf73;
  --cream: #f6f5ef;
  --white: #ffffff;
  --text: #22301f;
  --muted: #6b7a68;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
}

/* Header */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
}

.menu-btn {
  border: none;
  background: var(--cream);
  color: var(--green-dark);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: 0.2s;
}

.menu-btn:hover { background: #e8e6db; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  border: none;
  background: var(--cream);
  color: var(--green-dark);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: 0.2s;
}

.icon-btn:hover { background: #e8e6db; }

.search-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 14px;
}

.search-row input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  font-family: inherit;
}

.search-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,71,0.15);
}

.delivery-banner {
  background: var(--green-dark);
  color: var(--white);
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

.delivery-badge {
  display: inline-block;
  background: #eaf7ea;
  color: var(--green-dark);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.cart-btn {
  border: none;
  background: var(--green-dark);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-count {
  background: var(--white);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 20px 32px;
  background: linear-gradient(180deg, #eaf5ea, var(--cream));
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: var(--green-dark);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Main */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Back link */
.back-link {
  display: inline-block;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
}
.back-link:hover { text-decoration: underline; }

/* Product detail page */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 48px;
}

.detail-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
}

.detail-icon {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
}

.detail-name {
  font-size: 1.8rem;
  color: var(--green-dark);
  margin: 0 0 12px;
}

.detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 16px;
}

.detail-desc {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.care-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.care-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--cream);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
}

.care-item strong {
  color: var(--green-dark);
  font-size: 0.8rem;
}

.care-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.care-item.pet-ok { background: #eaf7ea; }
.care-item.pet-warn { background: #fdeeea; }

@media (max-width: 480px) {
  .care-info { grid-template-columns: 1fr; }
}

.detail-qty {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  font-weight: 600;
}

.detail-qty .qty-controls button {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
}

.detail-add-btn {
  padding: 14px;
  font-size: 1.05rem;
  margin-top: auto;
}

.related-section {
  margin-top: 24px;
}

.not-found {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .product-detail {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .detail-photo, .detail-icon {
    min-height: 240px;
  }
}

.section-title {
  font-size: 1.3rem;
  color: var(--green-dark);
  margin-bottom: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  justify-content: center;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s;
}

.product-card:hover { transform: translateY(-3px); }

.product-link {
  display: contents;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ff7a3d;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-beginner {
  background: var(--green-light);
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: none;
  background: rgba(255,255,255,0.9);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}

.fav-btn:hover { transform: scale(1.1); }

.stock-label {
  font-size: 0.8rem;
  font-weight: 700;
  margin: -6px 0 10px;
}

.stock-label.ok { color: var(--green); }
.stock-label.low { color: #c96a1f; }
.stock-label.out { color: #d24949; }

.add-btn:disabled {
  background: #b7c6b8;
  cursor: not-allowed;
}
.add-btn:disabled:hover { background: #b7c6b8; }

.product-icon {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  margin-bottom: 12px;
}

img.product-icon {
  object-fit: cover;
}

img.cart-item-icon {
  object-fit: cover;
}

.stock-photo-tag {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: italic;
  margin: -8px 0 8px;
}

.detail-stock-photo-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  background: rgba(0,0,0,0.55);
  color: var(--white);
  padding: 8px 12px;
  font-size: 0.78rem;
}

.product-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.product-desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 12px;
  flex-grow: 1;
}

.product-price {
  font-weight: 700;
  color: var(--green-dark);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.add-btn {
  border: none;
  background: var(--green);
  color: var(--white);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.add-btn:hover { background: var(--green-dark); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-admin a {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: underline;
}

/* Cart Drawer */
.overlay, .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 30;
}

.overlay.show, .modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 31;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
}

.cart-drawer.open { right: 0; }

/* Category Drawer (menu lateral, estilo YouTube) */
.category-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--white);
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  z-index: 31;
  display: flex;
  flex-direction: column;
  transition: left 0.25s ease;
}

.category-drawer.open { left: 0; }

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.category-item {
  border: none;
  background: none;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.category-item:hover { background: var(--cream); }

.category-item.active {
  background: #e6f4ea;
  color: var(--green-dark);
}

.category-subtitle {
  padding: 14px 22px 4px;
  margin: 8px 0 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  border-top: 1px solid #eee;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #eee;
}

.close-btn {
  border: none;
  background: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-icon {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; }

.cart-item-name { font-weight: 600; font-size: 0.92rem; }

.cart-item-price { color: var(--muted); font-size: 0.82rem; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-controls button {
  width: 24px;
  height: 24px;
  border: 1px solid #ddd;
  background: var(--white);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.remove-btn {
  background: none;
  border: none;
  color: #d24949;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 6px;
}

.empty-cart {
  color: var(--muted);
  text-align: center;
  margin: 40px auto;
  max-width: 480px;
  grid-column: 1 / -1;
}

.cart-footer {
  padding: 18px;
  border-top: 1px solid #eee;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--green-dark);
}

.checkout-btn {
  width: 100%;
  border: none;
  background: var(--green-dark);
  color: var(--white);
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

.checkout-btn:disabled {
  background: #b7c6b8;
  cursor: not-allowed;
}

/* Checkout Modal */
.modal {
  background: var(--white);
  max-width: 420px;
  width: 90vw;
  margin: 8vh auto;
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin-top: 0;
  color: var(--green-dark);
}

.modal-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: -8px;
}

.modal .close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
}

#checkoutForm, .auth-form, #profileForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

#checkoutForm label, .auth-form label, #profileForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

#checkoutForm input, #checkoutForm textarea, .auth-form input, #profileForm input {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

#checkoutForm textarea {
  resize: vertical;
  min-height: 60px;
}

.whatsapp-btn {
  border: none;
  background: #25D366;
  color: var(--white);
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 4px;
}

.whatsapp-btn:hover { background: #1ebe5b; }

@media (max-width: 640px) {
  .header-inner { justify-content: space-between; }
}

/* ---- Admin ---- */
.admin-container { max-width: 800px; }

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 380px;
  margin: 40px auto;
  text-align: center;
}

.admin-card input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  margin: 16px 0;
  font-family: inherit;
}

.pin-error {
  color: #d24949;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.admin-panel .modal-sub {
  margin-top: 0;
  margin-bottom: 20px;
  line-height: 1.5;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-logout {
  width: auto;
  margin-top: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-row-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  object-fit: cover;
}

.admin-row-info { flex: 1; min-width: 0; }
.admin-row-name { font-weight: 700; font-size: 0.92rem; }

.admin-row-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-row-stock input {
  width: 72px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.admin-row-saved {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  width: 56px;
}

/* ---- Conta ---- */
.account-page {
  text-align: center;
}

.account-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 480px;
  margin: -8px auto 20px;
}

.account-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

.account-card h3 { margin-top: 0; color: var(--green-dark); }

.account-email {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: -8px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: var(--cream);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-tab.active {
  background: var(--green);
  color: var(--white);
}

.auth-error {
  color: #d24949;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0;
}

.remove-btn-outline {
  border: 1px solid #d24949;
  background: none;
  color: #d24949;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 10px;
  width: 100%;
}

.orders-title { margin-top: 28px; }

.order-row {
  border-top: 1px solid #eee;
  padding: 10px 0;
  font-size: 0.88rem;
}

.order-row-date { font-weight: 700; color: var(--green-dark); }
.order-row-items { color: var(--muted); margin: 2px 0; }
.order-row-total { font-weight: 700; }

/* ---- Consultoria ---- */
.consultoria-page { max-width: 720px; }

.consultoria-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  line-height: 1.6;
}

.consultoria-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 24px;
}

.consultoria-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.consultoria-cta {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  width: 100%;
}
