@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:wght@700&display=swap');

:root {
  --bg-papel: #f4ecd8;
  --papel-claro: #fffaf0;
  --dourado: #c9972b;
  --dourado-escuro: #a97b1e;
  --texto-marrom: #5c3b00;
  --texto-corpo: #3e3a30;
  --borda: #dcd3b8;
}

:root[data-theme="dark"] {
  --bg-papel: #15120e;
  --papel-claro: #211b14;
  --dourado: #d6a536;
  --dourado-escuro: #b98523;
  --texto-marrom: #f0d398;
  --texto-corpo: #eadfca;
  --borda: #403527;
}

/* ==========================
   RESET / BASE
========================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-papel);
  font-family: 'Lato', sans-serif;
  color: var(--texto-corpo);
}

main { flex: 1; }

a { text-decoration: none; color: inherit; }

.container{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-notices {
  display: grid;
  gap: 10px;
  position: fixed;
  right: 18px;
  top: 116px;
  width: min(360px, calc(100vw - 36px));
  z-index: 2500;
}

.site-notice {
  background: #fffaf0;
  border: 1px solid #dcd3b8;
  border-left: 5px solid #c9972b;
  border-radius: 8px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.16);
  color: #2f1b0c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  padding: 13px 14px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-notice-success { border-left-color: #2f8f46; }
.site-notice-warning { border-left-color: #c9972b; }
.site-notice-error { border-left-color: #b3261e; }

.site-notice.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

/* ==========================
   TOP BAR
========================== */
.top-bar{
  background: var(--dourado-escuro);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
}

/* ==========================
   HEADER
========================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #fffaf0 0%, #f4ecd8 100%);
}

.main-header{ border-bottom: 1px solid #dcd3b8; }

:root[data-theme="dark"] .site-header {
  background: linear-gradient(180deg, #211b14 0%, #15120e 100%);
}

:root[data-theme="dark"] .main-header {
  border-color: #403527;
}

.header-grid{
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  height: 96px;
  column-gap: 24px;
}

.logo img{ height: 110px; display: block; }

.nav-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  position: relative;
}

.nav-right ul{
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
  color: var(--texto-marrom);
}

.icons{
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon{
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  position: relative;
}

#cartCount,
.cart-count,
[data-cart-count]{
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--dourado-escuro);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* hamburguer (só mobile) */
.menu-toggle{
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* ==========================
   FOOTER
========================== */
.main-footer{
  background: #2f1b0c;
  color: #fff;
  padding: 60px 0 40px;
}

.footer-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
}

.footer-logo{ width: 180px; }

.footer-col h4{ margin-bottom: 16px; }
.footer-col ul{ list-style: none; }
.footer-col ul li{ margin-bottom: 10px; }
.footer-col ul li a{ color: #ddd; }

.payment-icons{
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.payment-icons img{
  max-height: 32px;
  width: auto;
  object-fit: contain;
}

.footer-bottom{
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #bbb;
}

/* ==========================
   OVERLAYS
========================== */
.cart-overlay,
.login-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1998;
}

.cart-overlay.open,
.login-overlay.open{
  opacity: 1;
  pointer-events: all;
}

/* ==========================
   DRAWERS (CART / LOGIN)
========================== */
.cart-drawer,
.login-drawer{
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 1999;
  transition: right .30s ease;
  display: flex;
  flex-direction: column;
}

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

:root[data-theme="dark"] .cart-drawer,
:root[data-theme="dark"] .login-drawer {
  background: #1d1812;
  color: #eadfca;
}

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

.cart-header h3,
.login-header h3{
  font-size: 18px;
  color: var(--texto-marrom);
}

:root[data-theme="dark"] .cart-header,
:root[data-theme="dark"] .login-header,
:root[data-theme="dark"] .cart-item,
:root[data-theme="dark"] .cart-footer {
  border-color: #403527;
}

:root[data-theme="dark"] .close,
:root[data-theme="dark"] .cart-item-info p {
  color: #f0d398;
}

.close{
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #333;
}

/* ===== CART CONTENT ===== */
.cart-items{
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.cart-item{
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.cart-item img{
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
}

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

.cart-item-info p{
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #222;
}

.cart-item-info span{
  display: inline-block;
  font-size: 13px;
  color: #555;
}

:root[data-theme="dark"] .cart-item-info span,
:root[data-theme="dark"] .subtotal span,
:root[data-theme="dark"] .login-form label,
:root[data-theme="dark"] .forgot-password {
  color: #cbbfaa;
}

.cart-qty{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.qty-btn,
.cart-qty button{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s ease;
}

.qty-btn:hover,
.cart-qty button:hover{
  background: #c9972b;
  color: #fff;
  border-color: #c9972b;
}

.qty-number,
.cart-qty span{
  min-width: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

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

:root[data-theme="dark"] .qty-btn,
:root[data-theme="dark"] .cart-qty button,
:root[data-theme="dark"] .btn-clear-cart {
  background: #211b14;
  border-color: #403527;
  color: #eadfca;
}

.btn-clear-cart{
  align-items: center;
  background: #fff8ed;
  border: 1px solid #eadfca;
  border-radius: 10px;
  cursor: pointer;
  color: #5c3b00;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 38px;
  padding: 0 14px;
}

.btn-clear-cart:hover{
  background: #f6efe3;
  color: #2f1b0c;
}

.subtotal{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.subtotal span {
  font-size: 14px;
  color: #555;
}

.subtotal strong {
  font-size: 16px;
}

.btn-checkout{
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5c451, #c9972b);
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-checkout:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ===== LOGIN CONTENT ===== */
.login-form{
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .form-group{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label{
  font-size: 13px;
  color: #444;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"]{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

:root[data-theme="dark"] .login-form input[type="text"],
:root[data-theme="dark"] .login-form input[type="email"],
:root[data-theme="dark"] .login-form input[type="password"] {
  background: #15120e;
  border-color: #403527;
  color: #eadfca;
}

:root[data-theme="dark"] .password-toggle {
  color: #f0d398;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 54px !important;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
}

.password-toggle:hover {
  background: #f6efe3;
}

.password-toggle svg {
  display: block;
  height: 25px;
  width: 25px;
}

.password-toggle svg path,
.password-toggle svg circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.password-toggle svg circle {
  fill: currentColor;
  stroke: none;
}

.form-options{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.remember-me{
  display: flex;
  align-items: center;
  gap: 8px;
}

.forgot-password{
  color: #555;
}

.forgot-password:hover{ text-decoration: underline; }

.btn-login{
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, #f5c451, #c9972b);
  color: #1a1a1a;
}

/* ==========================
   SEÇÕES (ex: home)
========================== */
.products-preview {
  background: linear-gradient(135deg, #2f1b0c, #5a3a1a);
  padding: 60px 0;
}

:root[data-theme="dark"] .shop-hero,
:root[data-theme="dark"] .benefits,
:root[data-theme="dark"] .about-summary,
:root[data-theme="dark"] .trust-strip,
:root[data-theme="dark"] .form-section,
:root[data-theme="dark"] .order-summary,
:root[data-theme="dark"] .payment-result-panel,
:root[data-theme="dark"] .shop-card,
:root[data-theme="dark"] .product-wrap {
  background: #211b14;
  border-color: #403527;
  color: #eadfca;
}

:root[data-theme="dark"] .shop-grid-section,
:root[data-theme="dark"] .product-page,
:root[data-theme="dark"] .checkout-container,
:root[data-theme="dark"] .payment-result {
  background: #15120e;
}

:root[data-theme="dark"] .shop-card-body h3,
:root[data-theme="dark"] .shop-price,
:root[data-theme="dark"] .product-info h1,
:root[data-theme="dark"] .product-price,
:root[data-theme="dark"] .order-summary h2,
:root[data-theme="dark"] .form-section h2,
:root[data-theme="dark"] .payment-result-panel h1,
:root[data-theme="dark"] .trust-strip-grid span {
  color: #f0d398;
}

:root[data-theme="dark"] .shop-card-body p,
:root[data-theme="dark"] .shop-hero p,
:root[data-theme="dark"] .product-info p,
:root[data-theme="dark"] .product-desc,
:root[data-theme="dark"] .payment-result-panel p,
:root[data-theme="dark"] .checkout-help p,
:root[data-theme="dark"] .summary-row,
:root[data-theme="dark"] .secure-badge {
  color: #cbbfaa;
}

:root[data-theme="dark"] .btn-outline,
:root[data-theme="dark"] .btn-addcart,
:root[data-theme="dark"] .shop-badges span,
:root[data-theme="dark"] .product-badges span,
:root[data-theme="dark"] .product-specs div,
:root[data-theme="dark"] .checkout-help,
:root[data-theme="dark"] .payment-result-summary div {
  background: #1b1711;
  border-color: #403527;
  color: #eadfca;
}

:root[data-theme="dark"] input {
  background: #15120e;
  border-color: #403527;
  color: #eadfca;
}

/* ==========================
   RESPONSIVO
========================== */
@media (max-width: 900px){
  .menu-toggle{ display: block; }

  .nav-right ul{
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: min(420px, calc(100vw - 48px));
    flex-direction: column;
    gap: 18px;
    padding: 18px 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0,0,0,.18);
    z-index: 1500;
  }

  .nav-right ul.active{ display: flex; }

  .footer-grid{
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px){
  .cart-drawer,
  .login-drawer{
    width: 100vw;
    right: -100vw;
  }

  .footer-grid{ grid-template-columns: 1fr; gap: 24px; }
}
