/* =====================================================
   GALINHAS DO FRADE — Design System Partilhado
   ===================================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── Design Tokens ── */
:root {
  --clr-soil:      #2d3a1e;
  --clr-bark:      #4a6741;
  --clr-straw:     #d4a24c;
  --clr-wheat:     #f0d07a;
  --clr-cream:     #fdf6e8;
  --clr-cream-dk:  #f5ebcf;
  --clr-sage:      #7a8c5c;
  --clr-moss:      #4d5e34;
  --clr-rust:      #c0382b;
  --clr-rust-lt:   #e05a4a;
  --clr-rust-dk:   #962b20;
  --clr-white:     #ffffff;
  --clr-text:      #1e2a14;
  --clr-muted:     #5a6848;
  --clr-border:    #d4e0c6;
  --clr-border-dk: #b0c8a0;
  --clr-success:   #2d7a3a;
  --clr-warn:      #b87800;
  --clr-danger:    #b82828;

  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', sans-serif;

  --radius-xs:  3px;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 4px rgba(59,42,26,.07);
  --shadow-sm: 0 2px 8px rgba(59,42,26,.09);
  --shadow-md: 0 6px 24px rgba(59,42,26,.13);
  --shadow-lg: 0 16px 48px rgba(59,42,26,.18);
  --shadow-xl: 0 32px 80px rgba(59,42,26,.22);

  --ease:      cubic-bezier(.4,0,.2,1);
  --trans:     .22s cubic-bezier(.4,0,.2,1);
  --trans-slow:.45s cubic-bezier(.4,0,.2,1);

  --max-w:   1200px;
  --header-h: 68px;

  /* Sidebar (áreas autenticadas) */
  --sidebar-w: 256px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--clr-cream);
  color: var(--clr-text);
  line-height: 1.65;
  overflow-x: hidden;
}
img  { display: block; max-width: 100%; height: auto; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--clr-text);
}
h1,h2,h3,h4,h5 { line-height: 1.2; }

/* ── Layout ── */
.container   { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container-sm{ max-width: 720px;  margin: 0 auto; padding: 0 1.5rem; }
.section     { padding: 5rem 0; }
.section-alt { background: var(--clr-white); }
.section-dark{ background: var(--clr-soil); color: var(--clr-white); }

/* ── Typography ── */
.section-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-rust);
  background: rgba(192,90,43,.1);
  padding: .28rem .75rem;
  border-radius: var(--radius-full);
  margin-bottom: .65rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--clr-soil);
  margin-bottom: .5rem;
}
.section-sub {
  color: var(--clr-muted);
  font-size: .95rem;
  max-width: 500px;
}
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .section-sub { margin: 0 auto; }
.section-dark .section-title { color: var(--clr-white); }
.section-dark .section-sub   { color: rgba(255,255,255,.6); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  padding: .62rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--trans);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  line-height: 1;
}
.btn:focus-visible { outline: 2px solid var(--clr-straw); outline-offset: 2px; }
.btn-primary   { background: var(--clr-rust); color: #fff; }
.btn-primary:hover { background: var(--clr-rust-dk); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--clr-rust); border: 1.5px solid var(--clr-rust); }
.btn-secondary:hover { background: var(--clr-rust); color: #fff; }
.btn-ghost     { background: transparent; color: var(--clr-muted); }
.btn-ghost:hover { background: rgba(0,0,0,.05); color: var(--clr-text); }
.btn-white     { background: #fff; color: var(--clr-rust); }
.btn-white:hover { background: var(--clr-cream); }
.btn-outline-white { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); }
.btn-outline-white:hover { background: rgba(255,255,255,.12); }
.btn-success   { background: var(--clr-success); color: #fff; }
.btn-danger    { background: var(--clr-danger); color: #fff; }
.btn-sm  { padding: .42rem .9rem; font-size: .82rem; }
.btn-lg  { padding: .85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge-green  { background: #d4f0d7; color: #1e5a28; }
.badge-red    { background: #fde8e0; color: #a83b1a; }
.badge-straw  { background: #fdf0ca; color: #8a6010; }
.badge-blue   { background: #dceeff; color: #1a4a8a; }
.badge-gray   { background: #e8e0d5; color: #5a4a38; }
.badge-moss   { background: #ddf0d0; color: #2d5a1e; }

/* ── Form Elements ── */
.form-group  { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-label  { font-size: .875rem; font-weight: 500; color: var(--clr-soil); }
.form-label .req { color: var(--clr-rust); margin-left: .2rem; }
.form-input,
.form-select,
.form-textarea {
  padding: .65rem 1rem;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-white);
  transition: border-color var(--trans);
  width: 100%;
  font-size: .925rem;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--clr-straw);
  box-shadow: 0 0 0 3px rgba(212,162,76,.15);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint     { font-size: .8rem; color: var(--clr-muted); }
.form-error    { font-size: .8rem; color: var(--clr-danger); }

/* ── Cards ── */
.card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  transition: var(--trans);
}
.card-body { padding: 1.5rem; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--clr-border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead tr { background: var(--clr-cream-dk); }
th { padding: .75rem 1rem; text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--clr-muted); white-space: nowrap; }
td { padding: .85rem 1rem; border-top: 1px solid var(--clr-border); vertical-align: middle; }
tbody tr:hover { background: rgba(253,246,232,.6); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--clr-border); margin: 1.5rem 0; }

/* ── Alerts ── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius-md); font-size: .9rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-info    { background: #e8f3ff; color: #1a4a8a; border-left: 3px solid #4a8acf; }
.alert-success { background: #e8f8ec; color: #1e5a28; border-left: 3px solid #4ab85c; }
.alert-warn    { background: #fff8e8; color: #7a5000; border-left: 3px solid var(--clr-straw); }
.alert-danger  { background: #fde8e8; color: #8a1a1a; border-left: 3px solid #cf4a4a; }

/* ── Page Hero (inner pages) ── */
.page-hero {
  background: linear-gradient(135deg, var(--clr-soil) 0%, var(--clr-bark) 60%, #4a3520 100%);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 80% 50%, rgba(212,162,76,.15) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-wheat);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.page-hero-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--clr-straw); }
.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  color: var(--clr-white);
  margin-bottom: .75rem;
}
.page-hero-sub { color: rgba(255,255,255,.65); font-size: 1rem; max-width: 520px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: rgba(255,255,255,.6); transition: var(--trans); }
.breadcrumb a:hover { color: var(--clr-wheat); }
.breadcrumb-sep { opacity: .4; }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, #e8d9b8 25%, #f0e5c8 50%, #e8d9b8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: var(--clr-soil);
  color: #fff;
  padding: .75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .55rem;
  animation: toastIn .28s var(--ease) forwards;
  max-width: 300px;
}
.toast.warn    { background: var(--clr-rust); }
.toast.success { background: var(--clr-success); }
@keyframes toastIn {
  from { opacity:0; transform: translateX(16px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: .35rem;
  justify-content: center;
  margin-top: 2.5rem;
}
.pagination button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--clr-muted);
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  transition: var(--trans);
}
.pagination button:hover,
.pagination button.active { background: var(--clr-rust); color: #fff; border-color: var(--clr-rust); }

/* ── HEADER ── */
#header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(253,246,232,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--clr-border);
  transition: box-shadow var(--trans);
  height: var(--header-h);
}
#header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--clr-rust);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-soil);
  line-height: 1.1;
}
.logo-text span {
  display: block;
  font-size: .6rem;
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--clr-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.nav { flex: 1; display: flex; justify-content: center; }
.nav-list { display: flex; gap: .2rem; }
.nav-list a {
  padding: .38rem .78rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--clr-muted);
  border-radius: var(--radius-full);
  transition: var(--trans);
}
.nav-list a:hover,
.nav-list a.active { color: var(--clr-rust); background: rgba(192,90,43,.09); }

.header-actions { display: flex; align-items: center; gap: .55rem; flex-shrink: 0; }

.cart-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-soil);
  font-size: 1rem;
  transition: var(--trans);
}
.cart-btn:hover { border-color: var(--clr-rust); color: var(--clr-rust); }
.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 17px; height: 17px;
  background: var(--clr-rust);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--clr-cream);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--clr-soil);
  border-radius: 2px;
  transition: var(--trans);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--clr-cream);
  border-top: 1px solid var(--clr-border);
  padding: 1rem 1.5rem 1.5rem;
  gap: .2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: .65rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--clr-soil);
  transition: var(--trans);
}
.mobile-nav a:hover { background: rgba(192,90,43,.08); color: var(--clr-rust); }
.mobile-nav-sep  { height: 1px; background: var(--clr-border); margin: .5rem 0; }
.mobile-nav-auth { display: flex; gap: .65rem; padding-top: .5rem; }

/* ── FOOTER ── */
#footer {
  background: var(--clr-soil);
  color: rgba(255,255,255,.65);
}
.footer-main { padding: 4rem 0 2.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-text { color: var(--clr-white); }
.footer-brand .logo-text span { color: rgba(255,255,255,.45); }
.footer-desc { font-size: .875rem; line-height: 1.75; margin-top: 1rem; color: rgba(255,255,255,.5); }
.footer-social { display: flex; gap: .45rem; margin-top: 1.5rem; }
.social-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
  transition: var(--trans);
  color: rgba(255,255,255,.6);
}
.social-btn:hover { background: var(--clr-rust); border-color: transparent; color: #fff; }

.footer-col-title {
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--clr-white);
  margin-bottom: 1.1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .55rem; }
.footer-links a { font-size: .875rem; color: rgba(255,255,255,.5); transition: var(--trans); }
.footer-links a:hover { color: var(--clr-wheat); }
.footer-contact-item {
  display: flex; gap: .55rem;
  font-size: .875rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .65rem;
  align-items: flex-start;
}
.footer-contact-item .ico { flex-shrink: 0; margin-top: .15rem; }

.footer-bottom {
  padding: 1.4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: rgba(255,255,255,.3);
}
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal a { color: rgba(255,255,255,.32); transition: var(--trans); }
.footer-legal a:hover { color: rgba(255,255,255,.6); }

/* ── SIDEBAR (áreas autenticadas) ── */
.auth-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--clr-white);
  border-right: 1px solid var(--clr-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-muted);
  padding: .9rem .75rem .4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  color: var(--clr-muted);
  transition: var(--trans);
}
.sidebar-link:hover { background: var(--clr-cream); color: var(--clr-soil); }
.sidebar-link.active { background: rgba(192,90,43,.1); color: var(--clr-rust); }
.sidebar-link .ico { font-size: 1.05rem; flex-shrink: 0; }
.sidebar-link .badge { margin-left: auto; }
.sidebar-sep { height: 1px; background: var(--clr-border); margin: .65rem 0; }

.auth-content { flex: 1; padding: 2rem 2.5rem; min-width: 0; }
.auth-content-inner { max-width: 960px; }

/* ── Dashboard cards ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}
.stat-card-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--clr-muted); margin-bottom: .5rem; }
.stat-card-value { font-family: var(--font-display); font-size: 1.9rem; color: var(--clr-soil); line-height: 1; }
.stat-card-sub   { font-size: .78rem; color: var(--clr-muted); margin-top: .3rem; }
.stat-card-icon  { float: right; font-size: 1.5rem; margin-top: -.25rem; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .sidebar { width: 220px; }
  --sidebar-w: 220px;
}
@media (max-width: 768px) {
  .nav, .header-actions .btn { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .auth-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: .75rem 1rem; border-right: none; border-bottom: 1px solid var(--clr-border); }
  .sidebar-label { display: none; }
  .sidebar-link { padding: .45rem .65rem; font-size: .82rem; }
  .auth-content { padding: 1.25rem 1rem; }
}
@media (max-width: 480px) {
  .section { padding: 3rem 0; }
}

/* ── Logo image (replaces icon) ── */
.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.logo-text-block {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-soil);
  line-height: 1.1;
}
.logo-text-block span {
  display: block;
  font-size: .6rem;
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--clr-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ── Images folder note ──
   All images must be placed in /images/
   - images/logotipo.png          (logo - done)
   - images/hero-banner.jpg       (hero background)
   - images/quinta.jpg            (farm photo for "sobre" section)
   - images/produtos/             (product photos)
   - images/parceiros/            (partner logos)
   ─────────────────────────────── */
