/* =============================================================================
   Michelle's Casita — prototype stylesheet
   Brand tokens sampled from the logo.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --terracotta: #C77B5C;
  --terracotta-dark: #A85F44;
  --sage: #8FB28A;
  --sage-dark: #5C7E58;
  --tan: #D1C4B1;
  --cream: #F4ECDF;
  --cream-deep: #EADFCC;
  --cocoa: #3D3A33;
  --muted: #6F6A5E;
  --rule: #D9CFC0;
  --white: #FFFFFF;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(61, 58, 51, 0.04), 0 8px 24px rgba(61, 58, 51, 0.08);
  --shadow-sticky: 0 1px 0 rgba(61, 58, 51, 0.06);

  --container: 1200px;
  --gap: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cocoa);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--terracotta-dark); text-decoration: none; transition: color 120ms ease; }
a:hover { color: var(--terracotta); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--cocoa); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); font-weight: 700; line-height: 1.15; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0; }
em.sci { font-style: italic; color: var(--muted); }

/* -------- Container -------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* -------- Top bar -------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-sticky);
}
.topbar-inner {
  display: flex; align-items: center; gap: 32px;
  height: 72px;
  padding: 0 24px;
  max-width: var(--container); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--cocoa); }
.brand-mark { width: 52px; height: 52px; object-fit: contain; display: block; }
.brand-mark-sm { width: 40px; height: 40px; object-fit: contain; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--terracotta); }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  color: var(--cocoa); font-weight: 500; font-size: 0.95rem;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active {
  color: var(--terracotta-dark);
  border-bottom-color: var(--terracotta);
}

.icon-actions { display: flex; gap: 6px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--cocoa);
  transition: background 120ms ease;
}
.icon-btn:hover { background: var(--cream-deep); color: var(--cocoa); }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--terracotta); color: white;
  font-size: 0.7rem; font-weight: 600;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 12px 22px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: transform 80ms ease, background 120ms ease, box-shadow 120ms ease;
}
.btn-primary { background: var(--terracotta); color: white; }
.btn-primary:hover { background: var(--terracotta-dark); color: white; box-shadow: 0 4px 12px rgba(168, 95, 68, 0.3); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--cream-deep); color: var(--cocoa); }
.btn-secondary:hover { background: var(--tan); color: var(--cocoa); }
.btn-ghost { background: transparent; color: var(--cocoa); border: 1px solid var(--rule); }
.btn-ghost:hover { background: var(--cream-deep); }
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* -------- Pills / badges -------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  border-radius: 999px;
}
.pill-sage { background: rgba(143, 178, 138, 0.2); color: var(--sage-dark); }
.pill-terra { background: rgba(199, 123, 92, 0.15); color: var(--terracotta-dark); }
.pill-muted { background: var(--cream-deep); color: var(--muted); }

/* -------- Hero -------- */
.hero {
  background: linear-gradient(120deg, var(--tan) 0%, var(--cream-deep) 100%);
  padding: 96px 0 80px;
  position: relative; overflow: hidden;
}
.hero-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center;
}
.hero h1 { color: var(--cocoa); }
.hero h1 .accent { color: var(--terracotta); }
.hero p.lead {
  margin-top: 20px;
  font-size: 1.125rem; color: var(--muted); max-width: 480px; line-height: 1.55;
}
.hero-cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-art svg { width: 100%; max-width: 360px; height: auto; }

/* -------- Section heading -------- */
.section { padding: 72px 0; }
.section-tan { background: var(--tan); }
.section-cream-deep { background: var(--cream-deep); }
.section-head {
  display: flex; justify-content: space-between; align-items: end; margin-bottom: 32px;
  gap: 24px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--muted); margin-top: 6px; max-width: 540px; }
.section-head .view-all {
  font-size: 0.95rem; font-weight: 600; color: var(--terracotta-dark);
  display: inline-flex; align-items: center; gap: 4px;
}

/* -------- Plant card grid -------- */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.plant-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.plant-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(61, 58, 51, 0.06), 0 16px 36px rgba(61, 58, 51, 0.12);
}
.plant-photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-deep) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.plant-photo svg { width: 70%; height: 70%; opacity: 0.85; }
.plant-photo .badge-stock {
  position: absolute; top: 12px; left: 12px;
}
.plant-card-body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.plant-card-body .plant-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem;
  color: var(--cocoa);
}
.plant-card-body .plant-sci {
  font-style: italic; color: var(--muted); font-size: 0.9rem;
}
.plant-card-body .plant-meta {
  display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px;
}
.plant-card-body .price {
  font-family: var(--font-display); font-weight: 700; color: var(--terracotta);
  font-size: 1.25rem;
}

/* -------- Brand strip -------- */
.brand-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.brand-strip .pillar {
  text-align: center; padding: 0 12px;
}
.brand-strip .pillar svg {
  width: 48px; height: 48px; color: var(--terracotta); margin-bottom: 12px;
}
.brand-strip .pillar h3 { font-size: 1.1rem; margin-bottom: 4px; }
.brand-strip .pillar p { color: var(--muted); font-size: 0.95rem; }

/* -------- Instagram embed mock -------- */
.ig-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-width: 900px; margin: 0 auto;
}
.ig-tile {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
  border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ig-tile:nth-child(2) { background: linear-gradient(135deg, var(--tan) 0%, var(--cream-deep) 100%); }
.ig-tile:nth-child(3) { background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%); }
.ig-tile:nth-child(4) { background: linear-gradient(135deg, var(--cream-deep) 0%, var(--tan) 100%); }
.ig-tile:nth-child(5) { background: linear-gradient(135deg, var(--sage-dark) 0%, var(--cocoa) 100%); }
.ig-tile:nth-child(6) { background: linear-gradient(135deg, var(--tan) 0%, var(--terracotta) 100%); }
.ig-tile svg { width: 50%; height: 50%; opacity: 0.6; color: white; }

/* -------- Newsletter -------- */
.newsletter-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 48px;
  max-width: 700px; margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.newsletter-card h2 { margin-bottom: 8px; }
.newsletter-card p { color: var(--muted); margin-bottom: 24px; }
.newsletter-form { display: flex; gap: 8px; max-width: 460px; margin: 0 auto; }
.newsletter-form input {
  flex: 1; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; background: white; color: var(--cocoa);
}
.newsletter-form input:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }

/* -------- Footer -------- */
.site-footer {
  background: var(--cocoa); color: var(--cream);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 48px;
  margin-bottom: 40px;
}
.footer-grid h4 { color: white; margin-bottom: 16px; font-family: var(--font-display); font-weight: 600; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--cream); opacity: 0.8; font-size: 0.95rem; }
.footer-grid a:hover { color: white; opacity: 1; }
.footer-bottom {
  border-top: 1px solid rgba(244, 236, 223, 0.15); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--cream); opacity: 0.6;
}

/* -------- Shop layout (filter + grid) -------- */
.shop-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: 40px;
  margin-top: 40px;
}
.filter-rail { position: sticky; top: 96px; align-self: start; }
.filter-group { margin-bottom: 28px; }
.filter-group h4 {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  margin-bottom: 12px; color: var(--cocoa);
}
.filter-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem; color: var(--cocoa);
  padding: 4px 0; cursor: pointer;
}
.filter-group input[type="checkbox"], .filter-group input[type="radio"] { accent-color: var(--terracotta); }

.shop-results-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.shop-count { color: var(--muted); font-size: 0.95rem; }
.shop-sort select {
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--rule); background: white; font-family: var(--font-body); font-size: 0.95rem;
  color: var(--cocoa);
}

/* -------- Plant detail page -------- */
.detail-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  margin-top: 40px;
}
.detail-photos .main-photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-deep) 100%);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}
.detail-photos .main-photo svg { width: 70%; height: 70%; opacity: 0.85; }
.detail-thumbs { display: flex; gap: 8px; }
.detail-thumbs .thumb {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--cream-deep) 0%, var(--tan) 100%);
  border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
}
.detail-thumbs .thumb.active { border-color: var(--terracotta); }

.detail-info .sci-label { color: var(--muted); font-style: italic; font-size: 1rem; margin-bottom: 4px; }
.detail-info h1 { font-size: 2.5rem; margin-bottom: 16px; }
.detail-info .price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.detail-info .price-row .price {
  font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--terracotta);
}
.detail-actions { display: flex; gap: 12px; margin-bottom: 32px; }

.care-card {
  background: var(--cream);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.care-card h3 {
  font-family: var(--font-display); font-size: 1.1rem;
  margin-bottom: 16px; color: var(--sage-dark);
}
.care-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.care-item { display: flex; align-items: start; gap: 10px; }
.care-item svg { width: 24px; height: 24px; color: var(--sage-dark); flex-shrink: 0; margin-top: 2px; }
.care-item .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.care-item .value { font-size: 0.95rem; color: var(--cocoa); }

.specs-list { list-style: none; padding: 0; }
.specs-list li {
  display: flex; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.specs-list li .key { color: var(--muted); }
.specs-list li .val { color: var(--cocoa); font-weight: 500; }
.specs-list li:last-child { border-bottom: none; }

.provenance-block {
  margin-top: 24px; padding: 20px; background: var(--cream);
  border-radius: var(--radius); font-size: 0.95rem; color: var(--cocoa);
  line-height: 1.6;
}
.provenance-block h4 {
  font-family: var(--font-display); font-size: 1rem; margin-bottom: 8px; color: var(--sage-dark);
}

/* -------- Cart page -------- */
.cart-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 40px;
  margin-top: 40px;
}
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line {
  display: grid; grid-template-columns: 96px 1fr auto auto; gap: 20px; align-items: center;
  background: white; border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-card);
}
.cart-line .photo {
  width: 96px; height: 96px;
  background: linear-gradient(135deg, var(--cream-deep) 0%, var(--tan) 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.cart-line .photo svg { width: 60%; height: 60%; opacity: 0.85; }
.cart-line .info .name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cart-line .info .sci { font-style: italic; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.cart-line .info .hold-note { font-size: 0.8rem; color: var(--sage-dark); margin-top: 6px; font-weight: 500; }
.cart-line .price { font-family: var(--font-display); font-weight: 700; color: var(--terracotta); font-size: 1.1rem; }
.cart-line .remove {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
}
.cart-line .remove:hover { background: var(--cream-deep); color: var(--terracotta); }

.cart-summary {
  background: white; border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-card);
  position: sticky; top: 96px; align-self: start;
}
.cart-summary h3 { font-family: var(--font-display); font-weight: 600; margin-bottom: 20px; }
.cart-summary .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.95rem; }
.cart-summary .row.total {
  border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--cocoa);
}
.cart-summary .row.total .amount { color: var(--terracotta); }
.cart-summary .checkout-btn { margin-top: 20px; }
.cart-summary .shipping-note {
  font-size: 0.8rem; color: var(--muted); margin-top: 12px; text-align: center;
}

/* -------- Admin layout -------- */
.admin-shell { display: flex; min-height: 100vh; background: var(--cream); }
.admin-sidebar {
  width: 240px; background: var(--cocoa); color: var(--cream);
  padding: 24px 16px;
  display: flex; flex-direction: column;
}
.admin-sidebar .brand-name { color: white; }
.admin-sidebar .brand-name span { color: var(--terracotta); }
.admin-sidebar nav { margin-top: 32px; display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a {
  color: var(--cream); opacity: 0.7;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.admin-sidebar nav a:hover { background: rgba(244, 236, 223, 0.08); opacity: 1; color: white; }
.admin-sidebar nav a.active { background: var(--terracotta); color: white; opacity: 1; }
.admin-main { flex: 1; padding: 32px 40px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.admin-header h1 { font-size: 1.75rem; }
.admin-header .crumb { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; font-family: var(--font-mono); }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.kpi-card {
  background: white; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.kpi-card .kpi-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.kpi-card .kpi-value { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--cocoa); margin-top: 8px; }
.kpi-card .kpi-value.accent { color: var(--terracotta); }

.admin-table-wrap {
  background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
}
.admin-table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--rule);
  background: var(--cream);
}
.admin-table-toolbar .selected-info { color: var(--muted); font-size: 0.95rem; }
.admin-table-toolbar .selected-info strong { color: var(--cocoa); font-weight: 600; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: 14px 20px; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; background: var(--cream);
  border-bottom: 1px solid var(--rule);
}
.admin-table th.center { text-align: center; }
.admin-table td {
  padding: 16px 20px; border-bottom: 1px solid var(--rule); font-size: 0.95rem;
}
.admin-table td.center { text-align: center; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--cream); }
.admin-table .order-num { font-family: var(--font-mono); color: var(--terracotta); font-weight: 600; font-size: 0.9rem; }
.admin-table .buyer .name { font-weight: 600; }
.admin-table .buyer .email { color: var(--muted); font-size: 0.85rem; }
.admin-table .items-cell .count { font-weight: 600; }
.admin-table .items-cell .preview { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.admin-table .address {
  font-size: 0.85rem; color: var(--muted); line-height: 1.4;
}
.admin-table .address strong { color: var(--cocoa); font-weight: 500; display: block; }
.admin-table input[type="checkbox"] { accent-color: var(--terracotta); width: 16px; height: 16px; }

/* -------- Responsive -------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 280px; margin: 0 auto; }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-rail { position: static; }
  .detail-layout { grid-template-columns: 1fr; gap: 32px; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .brand-strip { grid-template-columns: 1fr; gap: 24px; }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .hero { padding: 56px 0; }
  .section { padding: 56px 0; }
  .ig-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 20px; }
}
