/* ================================================================
   ATELIÊ NAZARÉ — FOLHA DE ESTILOS
   Organiza tema, layout, componentes, modais e responsividade.
   ================================================================ */

/* Variáveis reutilizáveis do tema claro. */
:root {
  --brown: #6a4028;
  --deep: #3e2517;
  --beige: #f1e2ca;
  --cream: #fff9ef;
  --paper: #fffdf8;
  --ink: #302119;
  --muted: #766256;
  --line: #ddc5a5;
  --gold: #b78342;
  --shadow: 0 14px 38px #4b2d1b24;
}

/* Normalização e comportamento global da página. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--beige);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Faixa de aviso e cabeçalho fixo. */
.notice {
  padding: .65rem;
  background: var(--deep);
  color: #fff7e9;
  text-align: center;
  font-size: .78rem;
  letter-spacing: .06em;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1.2rem, 5vw, 5rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--brown);
  font: 700 1.55rem "Cormorant Garamond", serif;
  text-decoration: none;
}
.brand span { color: var(--gold); }
.main-navigation { display: flex; gap: 2rem; }
.main-navigation a { color: var(--ink); font-size: .9rem; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.icon-button, .cart-button, .account-button, .admin-link {
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--cream);
  color: var(--brown);
}
.cart-button span {
  display: inline-grid;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: .25rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brown);
  color: #fff;
  font-size: .72rem;
}
.account-button { white-space: nowrap; }

/* Área de apresentação e suas chamadas comerciais. */
.hero { min-height: 590px; display: grid; grid-template-columns: 1.08fr .92fr; background: #eddbc0; }
.hero-copy { align-self: center; padding: clamp(3rem, 7vw, 7rem); }
.eyebrow {
  margin: 0 0 .8rem;
  color: #9a6341;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: "Cormorant Garamond", serif; }
.hero h1 {
  max-width: 650px;
  margin: .2rem 0 1.4rem;
  color: var(--deep);
  font-size: clamp(2.8rem, 5vw, 5.25rem);
  line-height: .91;
}
.hero-copy > p:not(.eyebrow) { max-width: 530px; color: var(--muted); line-height: 1.7; }
.hero-actions { display: flex; gap: .8rem; margin-top: 2rem; }
.button {
  display: inline-block;
  padding: .85rem 1.25rem;
  border: 1px solid var(--brown);
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
}
.primary { background: var(--brown); color: #fffaf0; }
.secondary { background: transparent; color: var(--brown); }
.hero-benefits { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2.4rem; color: var(--brown); font-size: .8rem; }
.hero-art {
  position: relative;
  min-height: 440px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, #b88352, #573126);
  color: #fff7e8;
  text-align: center;
}
.halo {
  position: absolute;
  width: min(35vw, 440px);
  aspect-ratio: 1;
  border: 1px solid #fff8;
  border-radius: 50%;
  box-shadow: 0 0 0 18px #fff2, 0 0 0 38px #fff1;
}
.statue {
  z-index: 1;
  width: 150px;
  height: 275px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 75px 75px 30px 30px;
  background: linear-gradient(110deg, #fff8, #fff, #d4bc9d);
  box-shadow: 0 20px 35px #29130e55;
  color: var(--brown);
}
.statue span { color: var(--gold); font-size: 2rem; }
.statue strong { font: 700 5rem "Cormorant Garamond", serif; }
.hero-art p { z-index: 1; font-size: .75rem; }

/* Seções de atacado, catálogo e apresentação do ateliê. */
.wholesale { padding: clamp(3.5rem, 7vw, 6rem) 1.5rem; background: var(--brown); color: #fff5e7; text-align: center; }
.wholesale .eyebrow, .text-link { color: #f2c47e; }
.wholesale h2, .section-heading h2, .about h2 { margin: .2rem 0 1rem; font-size: clamp(2.35rem, 4vw, 4rem); line-height: .95; }
.wholesale > p:not(.eyebrow) { max-width: 600px; margin: auto; color: #fff1dfd9; line-height: 1.7; }
.text-link { display: inline-block; margin-top: 1.5rem; text-decoration: none; }
.collection { padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 7rem); background: var(--cream); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-heading h2, .about h2 { color: var(--deep); }
.filters { display: flex; gap: .5rem; overflow: auto; padding: 2.5rem 0 1.5rem; }
.filters button { padding: .5rem .15rem; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; }
.filters button.active { border-color: var(--brown); color: var(--brown); font-weight: 700; }
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); transition: .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image { position: relative; height: 260px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #ead5bb, #966654); }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.mini-statue { width: 82px; height: 155px; display: grid; place-items: center; border-radius: 42px 42px 12px 12px; background: #fff9ed; box-shadow: 0 12px 24px #44221540; color: var(--brown); font: 700 3rem "Cormorant Garamond", serif; }
.product-image small { position: absolute; bottom: .7rem; left: .7rem; padding: .35rem .55rem; background: #fffdf9; color: var(--brown); font-size: .67rem; }
.card-body { padding: 1.25rem; }
.card h3 { margin: 0; color: var(--deep); font-size: 1.65rem; }
.card p, .detail-copy p { color: var(--muted); line-height: 1.6; }
.price { margin: 1.1rem 0; color: var(--brown); font-weight: 700; }
.card-actions { display: flex; gap: .6rem; }
.card-actions button { flex: 1; padding: .65rem; border: 1px solid var(--brown); background: var(--brown); color: #fff; }
.card-actions .details { background: transparent; color: var(--brown); }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: clamp(4rem, 8vw, 7rem); background: #dec092; }
.about > p { color: #604938; line-height: 1.8; }
.faq { padding: clamp(4rem, 7vw, 6rem) clamp(1.2rem, 6vw, 7rem); background: var(--paper); }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; margin-top: 2rem; }
.faq details { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.faq summary { color: var(--deep); font-weight: 700; cursor: pointer; }
.faq details p { color: var(--muted); line-height: 1.6; }
.site-footer { display: flex; justify-content: space-between; padding: 2rem clamp(1.2rem, 6vw, 7rem); background: var(--deep); color: #fff0da; font-size: .8rem; }
.site-footer button, .site-footer a { border: 0; background: none; color: inherit; text-decoration: underline; }

/* Sobreposição e gaveta lateral da sacola. */
.backdrop { position: fixed; inset: 0; z-index: 20; visibility: hidden; opacity: 0; background: #2b170c88; transition: .2s; }
.backdrop.visible { visibility: visible; opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(450px, 100%); height: 100%; display: flex; flex-direction: column; padding: 1.5rem; background: var(--paper); transform: translateX(100%); transition: .25s; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer h2, .modal h2 { color: var(--deep); font-size: 2.2rem; }
.close { border: 0; background: transparent; color: var(--brown); font-size: 2rem; }
#cart-items { flex: 1; overflow: auto; }
.cart-row { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart-row strong { color: var(--deep); font: 1.3rem "Cormorant Garamond", serif; }
.cart-row small { display: block; color: var(--muted); }
.cart-controls { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; }
.cart-controls select, .cart-controls button, .admin input, .admin select { padding: .5rem; border: 1px solid var(--line); background: var(--cream); color: var(--ink); }
.cart-controls .remove { margin-left: auto; color: var(--brown); }
.quantity-tiers { margin: .8rem 0; }
.quantity-tiers > div { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.quantity-tiers button {
  padding: .4rem;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--brown);
  font-size: .72rem;
  touch-action: manipulation;
  transition: background-color .08s, border-color .08s, color .08s, transform .08s;
}
.quantity-tiers button:active { transform: scale(.97); }
.quantity-tiers button.selected { border-color: var(--brown); background: var(--brown); color: #fff; }
.quantity-tiers b { display: block; }
.cart-footer { padding-top: 1rem; border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; }
.total strong { color: var(--brown); font: 700 1.8rem "Cormorant Garamond", serif; }
.wide { width: 100%; }

/* Janelas de detalhes, briefing e administração. */
.modal { width: min(760px, calc(100% - 2rem)); padding: 2rem; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: #2b170c88; }
.modal-close { position: absolute; top: 1.1rem; right: 1.1rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.detail-media { min-height: 300px; background: #ead5b6; }
.detail-media img, .detail-media iframe, .detail-media video { width: 100%; height: 100%; min-height: 300px; border: 0; object-fit: cover; }
.briefing label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.briefing textarea, .admin textarea { width: 100%; min-height: 160px; padding: .8rem; border: 1px solid var(--line); background: var(--cream); color: var(--ink); }
.briefing .button { margin-top: 1rem; }
.admin { width: min(1000px, calc(100% - 2rem)); max-height: 92vh; overflow: auto; }
.admin-head, .admin-row { display: flex; align-items: center; justify-content: space-between; }
.agent-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--cream);
}
.agent-tools h3 { margin: 0; color: var(--deep); font-size: 1.7rem; }
.agent-tools p { color: var(--muted); line-height: 1.5; }
.agent-tools label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.agent-tools input { display: block; width: 100%; margin-top: .35rem; }
.agent-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.agent-status { margin: 0; font-weight: 700; }
#gptmaker-chat-root iframe {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: min(390px, calc(100vw - 2rem));
  height: min(620px, calc(100vh - 2rem));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.admin form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.admin label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.admin label:not(.check) input, .admin label select, .admin label textarea { display: block; width: 100%; margin-top: .35rem; }
.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { width: auto; }
.admin-products { margin-top: 2rem; border-top: 1px solid var(--line); }
.admin-products h3 { color: var(--deep); font-size: 1.8rem; }
.admin-row { gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.admin-row button, .danger { padding: .35rem .6rem; border: 1px solid var(--line); background: transparent; color: var(--brown); }
.empty { color: var(--muted); line-height: 1.6; }
.legal-page { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) 0; }
.legal-page h1 { color: var(--deep); font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: .95; }
.legal-page > p:not(.eyebrow) { color: var(--muted); line-height: 1.8; }
.legal-page .button { margin-top: 1rem; }

/* Acesso e cadastro de clientes. */
.auth-modal { width: min(520px, calc(100% - 2rem)); }
.auth-intro { color: var(--muted); line-height: 1.6; }
.social-login { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.social-login button {
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
}
.auth-separator { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--muted); font-size: .75rem; }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.auth-tabs button { padding: .7rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.auth-tabs button.active { border-color: var(--brown); color: var(--brown); font-weight: 700; }
.auth-form { display: grid; gap: .85rem; }
.auth-form label, .profile-form label, .customer-chat-form label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.auth-form input, .profile-form input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
}
.privacy-consent { display: flex; align-items: start; gap: .5rem; line-height: 1.45; }
.privacy-consent input { width: auto; margin-top: .15rem; }
.text-action { border: 0; background: transparent; color: var(--brown); text-decoration: underline; }
.form-status { min-height: 1.4em; color: var(--brown); font-weight: 700; }

/* Área privada com perfil, histórico de compras e conversas. */
.customer-modal { width: min(860px, calc(100% - 2rem)); max-height: 92vh; overflow: auto; }
.customer-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.customer-tabs { display: flex; gap: .4rem; overflow-x: auto; margin: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.customer-tabs button { padding: .7rem 1rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; }
.customer-tabs button.active { border-color: var(--brown); color: var(--brown); font-weight: 700; }
.customer-panel h3 { margin-bottom: .3rem; color: var(--deep); font-size: 1.8rem; }
.customer-panel > p { color: var(--muted); line-height: 1.6; }
.profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.profile-form button { align-self: end; }
.birthday-benefit { padding: .8rem; border-left: 3px solid var(--gold); background: var(--cream); }
.history-card { margin-bottom: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: 5px; background: var(--cream); }
.history-card header { display: flex; justify-content: space-between; gap: 1rem; }
.history-card p { margin: .4rem 0 0; color: var(--muted); line-height: 1.5; }
.chat-history { max-height: 280px; overflow: auto; margin-bottom: 1rem; }
.chat-message { margin-bottom: .6rem; padding: .75rem; border-radius: 5px; background: var(--cream); }
.chat-message small { display: block; margin-top: .3rem; color: var(--muted); }
.customer-chat-form { display: grid; gap: .6rem; }
.customer-chat-form textarea { min-height: 100px; padding: .75rem; border: 1px solid var(--line); background: var(--cream); color: var(--ink); }

/* Sobrescritas ativadas pelo botão de tema escuro. */
body.dark {
  --brown: #c99264;
  --deep: #21150e;
  --beige: #281b14;
  --cream: #302017;
  --paper: #38271c;
  --ink: #f4e5d0;
  --muted: #d1bba2;
  --line: #70503a;
  --gold: #e2b36e;
  --shadow: 0 14px 38px #09050399;
}
body.dark .hero { background: #3a281d; }
body.dark .hero h1, body.dark .section-heading h2, body.dark .about h2, body.dark .card h3, body.dark .drawer h2, body.dark .modal h2, body.dark .cart-row strong, body.dark .admin-products h3 { color: #f4e5d0; }
body.dark .hero-art { background: linear-gradient(145deg, #72462e, #26150f); }
body.dark .product-image { background: linear-gradient(145deg, #60412c, #57302c); }
body.dark .about { background: #4a3424; }
body.dark .about > p { color: #ead3ba; }

/* Adapta o layout para tablets e celulares. */
@media (max-width: 800px) {
  .main-navigation { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 350px; grid-row: 1; }
  .hero-copy { padding: 3rem 1.5rem; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .about, .detail-grid { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 480px) {
  .site-header { height: 65px; padding: 0 1rem; }
  .brand { font-size: 1.25rem; }
  .products { grid-template-columns: 1fr; }
  .product-image { height: 230px; }
  .hero h1 { font-size: 3rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .admin form { grid-template-columns: 1fr; }
  .agent-tools { grid-template-columns: 1fr; }
  .agent-actions { justify-content: flex-start; }
  .account-button { padding-inline: .6rem; font-size: .8rem; }
  .social-login, .profile-form { grid-template-columns: 1fr; }
  .customer-heading { align-items: start; flex-direction: column; }
  .admin-head, .admin-row, .site-footer { align-items: start; flex-direction: column; gap: .7rem; }
}
