/* ============================================
   Achados do Lar — vitrine de casa e cozinha
   Paleta: creme quente, terracota e verde-sálvia
   ============================================ */

:root{
  --cream: #FBF6EE;
  --linen: #F3EADB;
  --terracotta: #C2603C;
  --terracotta-dark: #9E4A2B;
  --sage: #7C8C6B;
  --sage-soft: #E4E9DC;
  --ink: #2E2621;
  --muted: #6E6259;
  --line: rgba(46,38,33,0.12);
  --white: #FFFDF9;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 16px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3{ font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.15; }

.wrap{ max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px){ .wrap{ padding: 0 28px; } }

/* ===== botões ===== */
.btn{
  display: inline-block; font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-align: center;
  transition: background .15s ease, transform .12s ease, color .15s ease;
}
.btn:active{ transform: scale(.97); }
.btn-primary{ background: var(--terracotta); color: var(--white); }
.btn-primary:hover{ background: var(--terracotta-dark); }
.btn-soft{ background: var(--sage-soft); color: var(--ink); font-size: 14px; padding: 9px 18px; }
.btn-soft:hover{ background: #D6DECB; }
.btn-ghost{ border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover{ border-color: var(--ink); }
.btn-outline{ border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-block{ display: block; width: 100%; }

/* ===== header ===== */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,246,238,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner{ display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand{ display: flex; align-items: center; gap: 10px; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong{ font-family: var(--font-display); font-size: 19px; }
.brand-text small{ font-size: 12px; color: var(--muted); }

/* ===== hero ===== */
.hero{ padding: 48px 0 40px; }
.hero-inner{ display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px){ .hero-inner{ grid-template-columns: 1.2fr .8fr; } .hero{ padding: 72px 0 56px; } }
.eyebrow{ color: var(--sage); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.hero h1{ font-size: clamp(32px, 5vw, 52px); max-width: 16ch; }
.hero h1 em{ font-style: italic; color: var(--terracotta); }
.hero-sub{ color: var(--muted); font-size: 17px; max-width: 48ch; margin: 18px 0 26px; }
.hero-cards{ list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-cards li{
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 16px; font-size: 34px; display: flex; flex-direction: column; gap: 6px;
}
.hero-cards li:nth-child(2), .hero-cards li:nth-child(3){ background: var(--linen); }
.hero-cards span{ font-size: 14px; font-weight: 700; color: var(--ink); }

/* ===== catálogo ===== */
.catalog{ padding-top: 24px; padding-bottom: 32px; }
.section-head{ display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.section-head h2, .how h2{ font-size: clamp(26px, 3.4vw, 34px); }
.chips{ display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar{ display: none; }
.chip{
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
.chip.is-on{ background: var(--ink); color: var(--cream); border-color: var(--ink); }

.product-grid{ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (min-width: 700px){ .product-grid{ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; } }
.catalog-msg{ grid-column: 1 / -1; color: var(--muted); padding: 20px 0; }

.product-card{
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover{ transform: translateY(-3px); box-shadow: 0 10px 24px rgba(46,38,33,.08); }
.product-thumb{ position: relative; aspect-ratio: 1/1; background: var(--linen); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.product-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.tag{ position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.tag-ml{ background: #FFF1B8; color: #5A4A00; }
.tag-shopee{ background: #FFE2D9; color: #A3290F; }
.product-body{ padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3{ font-family: var(--font-body); font-size: 14px; font-weight: 500; line-height: 1.4; min-height: 2.8em; }
.price{ font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0; margin-top: auto; }
.price small{ font-family: var(--font-body); font-size: 12px; color: var(--muted); }
.product-body .btn{ font-size: 13.5px; padding: 10px 12px; }

/* ===== como funciona ===== */
.how{ padding-top: 32px; padding-bottom: 64px; }
.how-grid{ list-style: none; counter-reset: n; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px){ .how-grid{ grid-template-columns: repeat(3, 1fr); } }
.how-grid li{
  counter-increment: n; background: var(--sage-soft); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.how-grid li::before{ content: counter(n); font-family: var(--font-display); font-size: 28px; color: var(--sage); font-weight: 700; }
.how-grid span{ color: var(--muted); font-size: 15px; }

/* ===== rodapé ===== */
.site-footer{ background: var(--ink); color: var(--cream); padding: 40px 0 28px; }
.footer-brand{ font-family: var(--font-display); font-size: 22px; margin: 0 0 10px; }
.footer-note{ color: rgba(251,246,238,.6); font-size: 13.5px; max-width: 60ch; margin: 0; }
.footer-credit{ margin: 28px 0 0; padding-top: 18px; border-top: 1px solid rgba(251,246,238,.12); font-size: 12.5px; color: rgba(251,246,238,.5); text-align: center; }
.footer-credit a{ color: rgba(251,246,238,.85); font-weight: 700; }
.footer-credit .admin-link{ margin-left: 10px; font-weight: 400; color: rgba(251,246,238,.25); }
.footer-credit .admin-link:hover{ color: var(--linen); }

/* ===== PAINEL ADMIN ===== */
[hidden]{ display: none !important; }
.admin-body{ min-height: 100vh; }
.admin-login{ display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.admin-card{ background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.login-card{ width: 100%; max-width: 380px; }
.login-card .brand{ margin-bottom: 22px; }
.admin-card h2{ font-size: 22px; margin-bottom: 18px; }
.admin-card form{ display: flex; flex-direction: column; gap: 14px; }
.admin-card label{ display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.admin-card input[type=text], .admin-card input[type=email], .admin-card input[type=password],
.admin-card input[type=url], .admin-card input[type=number], .admin-card input[type=search], .admin-card select{
  font: inherit; font-weight: 400; font-size: 15px; width: 100%;
  padding: 11px 12px; border: 1px solid rgba(46,38,33,.22); border-radius: 10px; background: var(--cream); color: var(--ink);
}
.admin-card input:focus, .admin-card select:focus{ outline: 2px solid var(--terracotta); outline-offset: 1px; }
.admin-card label.check{ flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-buttons{ display: flex; gap: 10px; flex-wrap: wrap; }
.btn-full{ width: 100%; }
.btn:disabled{ opacity: .6; cursor: wait; }
.form-msg{ font-size: 13px; margin: 0; min-height: 1.2em; }
.form-msg.ok{ color: #3F6B2F; }
.form-msg.err{ color: #B3261E; }
.link-btn{ background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.img-preview{ aspect-ratio: 16/9; max-height: 180px; border-radius: 10px; background: var(--linen); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 12px; color: var(--muted); }
.img-preview img{ width: 100%; height: 100%; object-fit: contain; }
.admin-actions{ display: flex; gap: 8px; margin-left: auto; }
.header-cta{ padding: 8px 16px; font-size: 13px; }
.admin-grid{ display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 20px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.list-head{ display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.list-head h2{ margin: 0; }
.list-head input{ max-width: 200px; }
.cat-count{ font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 400; }
.admin-list{ display: flex; flex-direction: column; gap: 10px; }
.admin-item{ display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.admin-item.is-off{ opacity: .55; }
.admin-thumb{ width: 56px; height: 56px; border-radius: 10px; background: var(--linen); overflow: hidden; }
.admin-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.admin-info{ min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-info strong{ font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-info small{ font-size: 12px; color: var(--muted); }
.admin-btns{ display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-btns button{ font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(46,38,33,.22); background: var(--white); color: var(--ink); }
.admin-btns button:hover{ border-color: var(--ink); }
.admin-btns button.danger{ color: #B3261E; border-color: rgba(179,38,30,.35); }

@media (max-width: 860px){
  .admin-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 480px){
  .admin-card{ padding: 18px 16px; }
  .form-row{ grid-template-columns: 1fr; }
  .admin-item{ grid-template-columns: 48px minmax(0,1fr); }
  .admin-thumb{ width: 48px; height: 48px; }
  .admin-btns{ grid-column: 1 / -1; justify-content: flex-start; }
  .header-inner .btn-soft{ display: none; }
}

/* ===== título do topo: elegante, delicado e animado ===== */
.hero h1.hero-title{
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #4A3B34;
  max-width: none;
}
.hero-title .line{ display: block; overflow: hidden; padding-bottom: .08em; }
.hero-title .line > span{
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  animation: riseIn 1s cubic-bezier(.22,.8,.24,1) forwards;
}
.hero-title .line:nth-child(2) > span{ animation-delay: .15s; }
.hero-title .line:nth-child(3) > span{ animation-delay: .3s; }

.hero-title .sweet{
  position: relative;
  font-style: italic;
  font-weight: 500;
  color: #C9785D;
  white-space: nowrap;
}
.hero-title .swash{
  position: absolute; left: 0; right: 0; bottom: -0.02em;
  width: 100%; height: .22em; overflow: visible;
}
.hero-title .swash path{
  fill: none; stroke: #E8B4A0; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: drawLine 1.1s ease-out 1.05s forwards;
}
.hero .eyebrow{ animation: fadeSoft .8s ease-out both; }
.hero-sub{ animation: fadeSoft .9s ease-out .55s both; }
.hero .btn-primary{ animation: fadeSoft .9s ease-out .75s both; }

/* quadradinhos do topo flutuando de leve */
.hero-cards li{ animation: fadeSoft .8s ease-out both, floaty 6s ease-in-out 1.2s infinite; }
.hero-cards li:nth-child(2){ animation-delay: .1s, 1.8s; }
.hero-cards li:nth-child(3){ animation-delay: .2s, 2.4s; }
.hero-cards li:nth-child(4){ animation-delay: .3s, 3s; }

@keyframes riseIn{ to{ transform: translateY(0); opacity: 1; } }
@keyframes drawLine{ to{ stroke-dashoffset: 0; } }
@keyframes fadeSoft{ from{ opacity: 0; transform: translateY(10px); } to{ opacity: 1; transform: none; } }
@keyframes floaty{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce){
  .hero-title .line > span, .hero .eyebrow, .hero-sub, .hero .btn-primary, .hero-cards li{
    animation: none; opacity: 1; transform: none;
  }
  .hero-title .swash path{ animation: none; stroke-dashoffset: 0; }
}
