/* ============================================================
   The Craftree — stylesheet
   Palette drawn from the brand logo (ink black, leaf amber)
   and the trays themselves (cream, wood, sage, rose).
   ============================================================ */

:root {
  --cream: #faf7f1;
  --paper: #ffffff;
  --ink: #211d17;
  --ink-soft: #5c554a;
  --amber: #e9af14;
  --amber-deep: #c8940b;
  --wood: #b0793f;
  --line: #e7e0d4;
  --sage: #93a996;
  --rose: #c99094;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(33, 29, 23, 0.08);
  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Lora", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img { height: 44px; width: auto; }

.brand-name {
  font-family: var(--font-head);
  font-weight: 300;
  letter-spacing: 0.06em;
  font-size: 1.35rem;
  white-space: nowrap;
}

.site-nav { display: flex; gap: 28px; align-items: center; }

.site-nav a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover, .site-nav a.active { color: var(--ink); border-color: var(--amber); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 74vh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
}

.hero picture, .hero > img.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero img.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(23, 20, 15, 0.72) 0%, rgba(23, 20, 15, 0.25) 45%, rgba(23, 20, 15, 0.05) 100%);
}

.hero-content {
  color: #fdfbf6;
  padding: 64px 0 72px;
  max-width: 640px;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 200;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: rgba(253, 251, 246, 0.92);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 34px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn-amber {
  background: var(--amber);
  color: var(--ink);
}

.btn-amber:hover { background: var(--amber-deep); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-outline:hover { background: var(--ink); color: var(--cream); }

.btn-outline-light {
  background: transparent;
  color: #fdfbf6;
  border: 1.5px solid rgba(253, 251, 246, 0.85);
}

.btn-outline-light:hover { background: rgba(253, 251, 246, 0.95); color: var(--ink); }

/* ---------- Sections ---------- */

section { padding: 84px 0; }

.section-tight { padding: 56px 0; }

.eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 14px;
}

h2.section-title {
  font-family: var(--font-head);
  font-weight: 200;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 18px;
}

.section-intro { max-width: 660px; color: var(--ink-soft); }

.center { text-align: center; }
.center .section-intro { margin: 0 auto; }

/* ---------- Product cards (home) ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 34px;
  margin-top: 48px;
}

.product-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(33, 29, 23, 0.13); }

.product-card .thumb { aspect-ratio: 1; overflow: hidden; }

.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }

.product-card:hover .thumb img { transform: scale(1.04); }

.product-card .card-body { padding: 22px 24px 26px; }

.product-card h3 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.product-card .card-sub {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.product-card .card-price {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

/* ---------- Values band ---------- */

.values-band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.value h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.value p { color: var(--ink-soft); font-size: 0.98rem; }

.value .leaf {
  width: 34px; height: 34px;
  margin-bottom: 16px;
}

/* ---------- Story split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.split .frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Shop page ---------- */

.page-head { padding-top: 64px; padding-bottom: 8px; }

.product-block {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.product-block:last-of-type { border-bottom: none; }

@media (max-width: 900px) {
  .product-block { grid-template-columns: 1fr; gap: 32px; }
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  background: var(--paper);
}

.gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.gallery-thumbs button {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: none;
  aspect-ratio: 4 / 3;
}

.gallery-thumbs button.active { border-color: var(--amber); }

.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info h2 {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.product-info .sub { color: var(--ink-soft); margin-bottom: 18px; }

.price {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.price .tax-note {
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.shipping-note { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 22px; }

.product-info .desc { margin-bottom: 22px; }

.spec-list { list-style: none; margin-bottom: 28px; }

.spec-list li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
}

.spec-list li strong {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 120px;
  color: var(--ink-soft);
  padding-top: 2px;
}

.buy-area { margin-top: 6px; }

.buy-area .rzp-holder form { margin: 0; }

.order-fallback {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.order-fallback p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 14px; }

.order-links { display: flex; flex-wrap: wrap; gap: 12px; }

.sold-out {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  border: 1.5px solid var(--rose);
  border-radius: 999px;
  padding: 12px 28px;
}

.secure-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ---------- Material chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.chip {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 14px;
}

/* ---------- Checkout modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(23, 20, 15, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  position: relative;
  background: var(--cream);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 26px 24px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

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

.modal-summary img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.modal-product { font-family: var(--font-head); font-weight: 500; font-size: 1.02rem; }

.modal-price { font-family: var(--font-head); font-weight: 600; }

.modal-price span { font-weight: 400; font-size: 0.78rem; color: var(--ink-soft); }

.modal-heading {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

#checkout-form label {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

#checkout-form input, #checkout-form textarea, #checkout-form select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}

#checkout-form select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c554a' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

#checkout-form input:focus, #checkout-form textarea:focus, #checkout-form select:focus {
  outline: 2px solid var(--amber);
  border-color: var(--amber);
}

#checkout-form select.invalid { border-color: #c9585e; }

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

#checkout-form label .opt {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

#checkout-form input[data-upper], #checkout-form textarea[data-upper] { text-transform: uppercase; }

#checkout-form input.invalid, #checkout-form textarea.invalid {
  border-color: #c9585e;
  outline-color: #c9585e;
}

.field-error {
  display: none;
  color: #a4373e;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 400;
  margin-top: 5px;
}

.field-error.show { display: block; }

/* ---------- Invoice / receipt ---------- */

.success-note { margin-bottom: 16px; }

.invoice-box {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  font-size: 0.9rem;
  color: var(--ink);
}

.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }

.inv-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 400; font-size: 1.05rem; }

.inv-brand img { height: 26px; width: auto; }

.inv-meta { text-align: right; font-size: 0.82rem; color: var(--ink-soft); }

.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }

.inv-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 5px;
}

.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }

.inv-table th, .inv-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.inv-table th {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.inv-table .r { text-align: right; }

.inv-table tfoot td { border-bottom: none; padding-top: 12px; }

.inv-sub { color: var(--ink-soft); font-size: 0.82rem; }

.inv-foot { font-size: 0.8rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: 3px; }

.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

@media print {
  @page { margin: 14mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  /* Hide everything on the page except the checkout modal (which holds the invoice).
     display:none collapses their height — this is what prevents the blank extra pages. */
  body > *:not(#checkout-modal) { display: none !important; }
  #checkout-modal {
    position: static !important;
    display: block !important;
    background: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  #checkout-modal .modal {
    max-width: none !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: none !important;
  }
  /* Inside the success view, print only the invoice itself. */
  #checkout-modal .modal-close,
  #checkout-modal .modal-heading,
  #checkout-modal .success-note,
  #checkout-modal .success-actions { display: none !important; }
  #print-invoice { border: none !important; padding: 0 !important; }
  .invoice-box { font-size: 11pt; }
}

.form-error {
  color: #a4373e;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.btn-full { width: 100%; text-align: center; }

.center-note { text-align: center; margin-top: 12px; }

.modal-success { text-align: center; padding: 12px 4px; }

.modal-success p { margin-bottom: 14px; }

.modal-success code { background: var(--paper); padding: 2px 7px; border-radius: 5px; font-size: 0.85em; }

/* ---------- About page ---------- */

.about-hero { padding-top: 72px; padding-bottom: 40px; }

.about-hero h1, .page-head h1 {
  font-family: var(--font-head);
  font-weight: 200;
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 16px;
}

.prose { max-width: 700px; }

.prose p { margin-bottom: 20px; }

.prose h2 {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 1.5rem;
  margin: 40px 0 14px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 30px;
  margin-top: 44px;
  counter-reset: step;
}

.process-step {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.process-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-head);
  font-weight: 200;
  font-size: 2rem;
  color: var(--amber);
  display: block;
  margin-bottom: 10px;
}

.process-step h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.process-step p { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 720px) { .contact-card { grid-template-columns: 1fr; } }

.contact-card h3 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.contact-card p { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 8px; }

.contact-card a { color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(250, 247, 241, 0.85);
  padding: 56px 0 40px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer .brand-name { color: #faf7f1; }

.site-footer .tree { height: 52px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); opacity: 0.95; }

.site-footer h4 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.site-footer a { color: rgba(250, 247, 241, 0.85); text-decoration: none; }

.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer ul { list-style: none; }

.site-footer li { margin-bottom: 8px; font-size: 0.95rem; }

.footer-legal {
  border-top: 1px solid rgba(250, 247, 241, 0.15);
  margin-top: 40px;
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-legal a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(250, 247, 241, 0.8);
  text-decoration: none;
}

.footer-legal a:hover { color: #fff; text-decoration: underline; }

.footer-note {
  margin-top: 18px;
  padding-top: 0;
  font-size: 0.85rem;
  color: rgba(250, 247, 241, 0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

/* ---------- Mobile nav ---------- */

@media (max-width: 640px) {
  .brand-name { font-size: 1.1rem; }
  .brand img { height: 36px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 0.72rem; letter-spacing: 0.1em; white-space: nowrap; }
  section { padding: 60px 0; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  .brand img { height: 40px; }
  .site-nav { gap: 20px; }
}
