/* ============================================================
   MóvelShop — CSS Público
   ============================================================ */

:root {
  --wood-900: #2C1810; --wood-800: #3D261A; --wood-700: #5C3A24;
  --wood-600: #7A4E30; --wood-500: #96623E; --wood-400: #B8845C;
  --wood-300: #D4A87A; --wood-200: #E8CBA8; --wood-100: #F5E6D3;
  --wood-50: #FBF4EC; --cream: #FDFAF5;
  --green-ok: #2D7A4F; --red-alert: #C0392B;
  --text-primary: #1A1A1A; --text-secondary: #5A5A5A; --text-muted: #8A8A8A;
  --border: #E0D5C8;
  --shadow-sm: 0 1px 3px rgba(44,24,16,0.08);
  --shadow-md: 0 4px 12px rgba(44,24,16,0.1);
  --shadow-lg: 0 8px 32px rgba(44,24,16,0.12);
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--text-primary); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--wood-900);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.header-inner .logo {
  font-family: 'Playfair Display', serif; color: var(--wood-200);
  font-size: 18px; font-weight: 700; letter-spacing: 0.5px;
}
.header-nav { display: flex; gap: 24px; }
.header-nav a { color: var(--wood-300); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.header-nav a:hover { color: #fff; }
.cart-toggle {
  background: none; border: none; color: var(--wood-200); font-size: 20px;
  cursor: pointer; position: relative; padding: 4px;
}
.cart-badge {
  position: absolute; top: -6px; right: -8px; background: var(--red-alert);
  color: #fff; width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; font-family: 'DM Sans', sans-serif;
}

/* --- Hero --- */
.catalog-hero {
  max-width: 1280px; margin: 24px auto; border-radius: 16px;
  padding: 48px 40px; color: #fff;
  background: linear-gradient(135deg, var(--wood-800) 0%, var(--wood-600) 100%);
  position: relative; overflow: hidden;
}
.catalog-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.catalog-hero > * { position: relative; z-index: 1; }
.catalog-hero h1 { font-family: 'Playfair Display', serif; font-size: 34px; margin-bottom: 10px; }
.catalog-hero p { color: var(--wood-200); font-size: 15px; max-width: 500px; }
.catalog-search { margin-top: 24px; display: flex; gap: 0; max-width: 480px; }
.catalog-search input {
  flex: 1; padding: 12px 18px; border: none; border-radius: 8px 0 0 8px;
  font-size: 14px; font-family: 'DM Sans', sans-serif;
}
.catalog-search button {
  padding: 12px 24px; background: var(--wood-400); color: #fff; border: none;
  border-radius: 0 8px 8px 0; font-weight: 600; font-size: 14px; cursor: pointer;
}

/* --- Categorias --- */
.catalog-cats {
  max-width: 1280px; margin: 0 auto 28px; padding: 0 24px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.cat-pill {
  padding: 8px 18px; border-radius: 24px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text-secondary); transition: all 0.15s; display: inline-block;
}
.cat-pill.active, .cat-pill:hover { background: var(--wood-700); color: #fff; border-color: var(--wood-700); }

/* --- Grid de produtos --- */
.product-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 24px 60px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}
.product-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card .img-wrap { height: 220px; overflow: hidden; position: relative; background: var(--wood-100); }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform 0.4s; }
.product-card:hover .img-wrap img { transform: scale(1.05); }
.product-card .img-placeholder-text {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--wood-400); font-size: 14px;
}
.product-card .promo-tag {
  position: absolute; top: 12px; left: 12px; background: var(--red-alert);
  color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; z-index: 2;
}
.product-card .info { padding: 16px; }
.product-card .cat-label { font-size: 11px; color: var(--wood-500); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.product-card .name { font-weight: 600; font-size: 15px; margin-bottom: 6px; line-height: 1.35; }
.product-card .price { font-size: 20px; font-weight: 700; color: var(--wood-700); }
.product-card .price-old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; margin-left: 8px; font-weight: 400; }
.product-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #F0EBE4;
}
.product-card .meta span { font-size: 12px; color: var(--text-muted); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* --- Botões --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 600; border: none;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.btn-primary { background: var(--wood-700); color: #fff; }
.btn-primary:hover { background: var(--wood-800); }
.btn-outline { background: #fff; color: var(--wood-700); border: 1.5px solid var(--wood-400); }
.btn-outline:hover { background: var(--wood-50); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }

/* --- Carrinho panel --- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 250; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-panel {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 90vw;
  height: 100vh; background: #fff; z-index: 300;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transition: right 0.3s ease; display: flex; flex-direction: column;
}
.cart-panel.open { right: 0; }
.cart-panel-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-panel-header h2 { font-family: 'Playfair Display', serif; font-size: 20px; }
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #F0EBE4; align-items: center; }
.cart-item img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info .ci-name { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.cart-item-info .ci-price { color: var(--wood-700); font-weight: 700; font-size: 15px; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-qty span { font-weight: 600; min-width: 18px; text-align: center; }
.cart-footer { padding: 20px 24px; border-top: 2px solid var(--border); background: var(--wood-50); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cart-total .label { font-size: 14px; color: var(--text-secondary); }
.cart-total .val { font-size: 24px; font-weight: 700; color: var(--wood-900); }

/* --- Footer --- */
.site-footer { background: var(--wood-900); color: var(--wood-200); margin-top: 40px; }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 40px 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px;
}
.footer-col h4 { font-family: 'Playfair Display', serif; font-size: 16px; margin-bottom: 12px; color: #fff; }
.footer-col p, .footer-col a { display: block; font-size: 13px; color: var(--wood-300); margin-bottom: 6px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--wood-700); text-align: center; padding: 16px 24px; }
.footer-bottom p { font-size: 12px; color: var(--wood-400); }
.footer-bottom a { color: var(--wood-300); }
.footer-bottom a:hover { color: #fff; }

/* --- Responsivo --- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .catalog-hero { margin: 16px; padding: 32px 24px; }
  .catalog-hero h1 { font-size: 24px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px 40px; }
  .product-card .img-wrap { height: 160px; }
  .catalog-cats { padding: 0 16px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
