/* ==========================================================================
   Pugalia Ventures - Stylesheet
   Design rules in DESIGN.md: Young Serif display / Plus Jakarta Sans body,
   8px spacing rhythm, one accent green, flat buttons, no decorative motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts, self-hosted.
   Served from assets/fonts/ rather than Google's CDN so that no visitor IP
   leaves for a third party on page load (SECURITY.md 1.6) and the site has no
   runtime dependency on a host we do not control.

   Latin subset only: the site is lang="en". Plus Jakarta Sans is a variable
   font, so one file covers the whole 400-800 range we use.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/young-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand-green: #87ae73;
  --brand-green-hover: #749b61;
  --brand-green-soft: #eff5eb;

  --forest-dark: #0d2219;
  --forest-deep: #07140e;
  --canvas: #f8f7f2;
  --white: #ffffff;
  --ink: #1a2b22;
  --muted: #56685d;
  --line: rgba(13, 34, 25, 0.12);

  --radius: 4px;

  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--forest-dark);
  line-height: 1.2;
  text-wrap: balance;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.btn-green {
  background: var(--brand-green);
  color: var(--forest-deep);
}

.btn-green:hover { background: var(--brand-green-hover); }

.btn-sm { padding: 8px 16px; font-size: 0.88rem; }
.btn-block { width: 100%; }

.quote-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-green-hover);
  text-decoration: none;
  padding: 0;
}

.quote-link:hover { text-decoration: underline; }

/* Nav */
.nav {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--forest-dark);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links button:not(.btn) {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 0 0 2px 0;
}

.nav-links a:hover,
.nav-links button:not(.btn):hover { color: var(--brand-green-hover); }

.nav-links .active {
  color: var(--forest-dark);
  border-bottom: 2px solid var(--brand-green);
}

/* Export hero: founder-forward */
.hero { padding: 72px 0 56px 0; }

.hero h1 {
  font-size: 2.6rem;
  max-width: 22ch;
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.08rem;
  max-width: 58ch;
  margin-bottom: 32px;
}

.founder {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

/* TODO: replace the initials with a real photo of Komal when available */
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--brand-green-soft);
  border: 1px solid var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--forest-dark);
}

.founder-name { font-weight: 700; color: var(--forest-dark); }
.founder-role { font-size: 0.88rem; color: var(--muted); }

/* Shop intro */
.shop-intro { padding: 56px 0 0 0; }
.shop-intro h1 { font-size: 2.2rem; margin-bottom: 8px; }
.shop-intro p { font-size: 1.05rem; max-width: 58ch; color: var(--muted); }

/* Catalog */
.catalog { padding: 64px 0 72px 0; }
.catalog-export { background: var(--white); border-top: 1px solid var(--line); }
.catalog-shop { padding-top: 40px; }

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.catalog h2 { font-size: 1.9rem; margin-bottom: 8px; }
.catalog .sub { color: var(--muted); margin-bottom: 4px; }

.currency-box {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-select {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--forest-dark);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 8px;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.card:hover { border-color: var(--brand-green); }

.card-photo { cursor: pointer; }

.card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.img-pending {
  background: var(--brand-green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.card-body h3 { font-size: 1.2rem; cursor: pointer; }

.grade { font-size: 0.84rem; color: var(--muted); }

.desc { font-size: 0.93rem; line-height: 1.55; }

.card-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.price {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--forest-dark);
  font-variant-numeric: tabular-nums;
}

.price small { font-weight: 500; color: var(--muted); }

.card-ask .card-body {
  justify-content: center;
  text-align: center;
  min-height: 240px;
  gap: 12px;
}

/* Closing strip */
.close-strip {
  background: var(--brand-green-soft);
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.close-strip .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.close-strip p {
  font-size: 1.05rem;
  color: var(--forest-dark);
  max-width: 48ch;
}

/* Story (shared by both modes) */
.story { padding: 72px 0; border-top: 1px solid var(--line); }

.story-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.story h2 { font-size: 1.9rem; margin-bottom: 24px; }

.story p {
  max-width: 62ch;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.story-quote {
  border-left: 3px solid var(--brand-green);
  padding-left: 20px;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--forest-dark);
  line-height: 1.5;
}

.story-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-green-hover);
}

.story-photo {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer a { text-decoration: none; }
.footer a:hover { color: var(--forest-dark); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 34, 25, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}

.modal-card h2 { font-size: 1.6rem; margin-bottom: 8px; }

.modal-narrow { max-width: 520px; }
.modal-product { max-width: 800px; }

.modal-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand-green-soft);
  color: var(--forest-dark);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: var(--brand-green); }

.product-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.modal-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}

.modal-desc { margin: 16px 0 24px 0; font-size: 0.98rem; }

.spec-sheet {
  margin-top: 16px;
  background: var(--brand-green-soft);
  padding: 16px;
  border-radius: var(--radius);
}

.spec-sheet h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.spec-grid {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.price-box {
  background: var(--brand-green-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.price-box-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.price-box-label { font-size: 0.84rem; color: var(--muted); }

.price-box-amount {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--forest-dark);
  font-variant-numeric: tabular-nums;
}

.price-box-note { font-size: 0.88rem; color: var(--muted); }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--forest-dark);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--canvas);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--brand-green);
  background: var(--white);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-group { display: flex; align-items: end; padding-bottom: 8px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
}

.pin-input {
  text-align: center;
  letter-spacing: 4px;
  font-size: 1.1rem;
}

.contact-list {
  list-style: none;
  margin-bottom: 24px;
  font-size: 0.94rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--white);
  z-index: 1001;
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(13, 34, 25, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.active { transform: translateX(0); }

.cart-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h3 { font-size: 1.3rem; }

.cart-close { position: static; }

.cart-body {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info { flex-grow: 1; }
.cart-item-title { font-weight: 700; color: var(--forest-dark); }
.cart-item-pack { font-size: 0.84rem; color: var(--muted); }
.cart-item-price { font-weight: 700; font-size: 0.92rem; }

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-green-soft);
  padding: 4px 8px;
  border-radius: var(--radius);
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--forest-dark);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  background: var(--brand-green-soft);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--forest-dark);
  margin-bottom: 16px;
}

.cart-note {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(96px);
  background: var(--forest-dark);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius);
  z-index: 2000;
  font-weight: 600;
  font-size: 0.92rem;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast-notification.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 860px) {
  .hero h1 { font-size: 2rem; }
  .shop-intro h1 { font-size: 1.8rem; }
  .story-grid { grid-template-columns: 1fr; gap: 32px; }
  .product-modal-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .toast-notification, .btn, .card { transition: none; }
}
