/* =================================================
   pages.css
   Styles shared by every non-hero page: the green
   top nav bar, the login/signup card, the order
   (checkout) page, and the demo-payment sheet.
   Loaded together with style.css (which holds the
   global tokens, hero, and homepage sections).
================================================= */

/* ---------------------------------------------
   Shared page chrome (non-hero pages)
   — the green nav bar + the off-white page
     background used on login/signup/order.
--------------------------------------------- */
.site-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 80px;
  padding: 0 80px;
  background: var(--color-green);
}

.site-nav__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav__logo img {
  width: 100%;
  height: 100%;
}

/* Account + basket icon buttons on the right of the nav */
.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav__actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.3s var(--ease-out);
}

.site-nav__actions a:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.site-nav__actions img {
  width: 32px;
  height: 32px;
  transition: transform 0.3s var(--ease-out);
}

.site-nav__actions a:hover img {
  transform: scale(1.08);
}

.page-shell {
  min-height: 100vh;
  background: #f6f5f2;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------
   Auth pages (login / signup)
--------------------------------------------- */

/* ---- Card layout ---- */
.authpage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.authcard {
  width: 100%;
  max-width: 422px;
  background: var(--color-white);
  padding: 40px 30px;
}

.authcard__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 36px;
  color: var(--color-green);
  line-height: 1.1;
}

.authcard__sub {
  margin-top: 8px;
  margin-bottom: 32px;
  font-size: 13px;
  color: #6b6b6b;
}

.authcard__sub a {
  color: var(--color-dark-text);
  font-weight: 700;
  text-decoration: underline;
}

/* ---- Form fields ----
   Shared by the auth cards and the order/shipping
   form below: a small uppercase label above an
   underline-only input (no boxed border). */
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

/* :first-child, not a bare "span" selector, so the .field-hint
   span (e.g. "At least 8 characters.") isn't styled like a label too */
.field > span:first-child {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-dark-text);
}

.field input,
.field textarea,
.field select {
  font: inherit;
  font-size: 15px;
  padding: 0 0 10px;
  border: none;
  border-bottom: 1px solid var(--color-green);
  border-radius: 0;
  background: transparent;
  color: var(--color-dark-text);
  transition: border-color 0.2s var(--ease-out);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-bottom-color: var(--color-gold);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-dark-text);
  -webkit-box-shadow: 0 0 0 1000px var(--color-white) inset;
  box-shadow: 0 0 0 1000px var(--color-white) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.field-hint {
  font-size: 12px;
  color: #8a8a8a;
}

/* ---- Buttons ---- */
.btn-solid {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: var(--color-green);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid var(--color-green);
  border-radius: 0;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.btn-solid:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- Inline alerts ----
   Success/error banners toggled via JS by adding
   the .is-visible class (see js/auth.js, js/order.js). */
.form-error {
  background: #fbe4e4;
  color: #a3312f;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  background: #e3f3e6;
  color: #1c6b2c;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
  display: none;
}

.form-success.is-visible {
  display: block;
}

/* ---- Google sign-in slot ----
   Hidden automatically via :empty until js/api.js
   mounts the Google button into it (only happens
   when GOOGLE_CLIENT_ID is configured server-side). */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 12px;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e6e2da;
}

.google-btn-slot {
  display: flex;
  justify-content: center;
}

.google-btn-slot:empty {
  display: none;
}

/* ---------------------------------------------
   Order page (order.html) — guest checkout only,
   no account/sign-in step. Two-column layout:
   product summary (left) + shipping form (right).
--------------------------------------------- */
.order-page {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---- Product summary column ---- */
.order-summary {
  position: sticky;
  top: 32px;
}

.order-summary__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-placeholder);
}

.order-summary__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-summary__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 36px;
  color: var(--color-green);
  margin-top: 24px;
}

.order-summary__desc {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}

.order-summary__price {
  margin-top: 20px;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-dark-text);
}

/* Quantity +/- stepper next to the price */
.qty-stepper {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8d3c8;
  overflow: hidden;
}

.qty-stepper button {
  width: 40px;
  height: 40px;
  appearance: none;
  border: none;
  background: var(--color-white);
  font-size: 18px;
  color: var(--color-green);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out);
}

.qty-stepper button:hover {
  background: #f1efe9;
}

.qty-stepper input {
  width: 48px;
  height: 40px;
  border: none;
  border-left: 1px solid #d8d3c8;
  border-right: 1px solid #d8d3c8;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.stock-notice {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #a3312f;
}

.stock-notice--out {
  color: #6b6b6b;
}

.order-summary__total {
  margin-top: 20px;
  font-size: 15px;
  color: #555;
}

.order-summary__total strong {
  color: var(--color-dark-text);
  font-size: 18px;
}

/* ---- Shipping form column ---- */
.order-form-card {
  background: var(--color-white);
  padding: 32px 30px;
}

.order-form-card h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  color: var(--color-green);
  margin-bottom: 24px;
}

/* Two-up field pairs, e.g. Email/Phone, City/State */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Shown only when DEMO_MODE is on in config.php (no Razorpay keys set) */
.demo-banner {
  background: #fdf1dc;
  color: #96660c;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* ---------------------------------------------
   Demo payment sheet
   A fake "Razorpay" modal shown only in demo mode
   so the checkout flow can be tested without real
   payment keys. See js/order.js openDemoModal().
--------------------------------------------- */
.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.demo-modal {
  width: 100%;
  max-width: 360px;
  background: var(--color-white);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.demo-modal h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 26px;
  color: var(--color-green);
}

.demo-modal p {
  margin-top: 8px;
  font-size: 14px;
  color: #6b6b6b;
}

.demo-modal__amount {
  margin: 24px 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-dark-text);
}

/* Spinner + "pay" button/amount swap while the demo payment is "processing" */
.demo-modal__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e6e2da;
  border-top-color: var(--color-green);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
  display: none;
}

.demo-modal.is-loading .demo-modal__spinner {
  display: block;
}

.demo-modal.is-loading .demo-modal__actions,
.demo-modal.is-loading .demo-modal__amount {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------
   Legal / info pages — about, contact, terms,
   privacy, cookie, and refund & return policy.
   Simple prose container reused across all six.
--------------------------------------------- */
.legal-page {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.legal-page__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 44px;
  color: var(--color-green);
  line-height: 1.15;
}

.legal-page__updated {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9a9a9a;
}

.legal-page__lead {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-body-text);
}

.legal-page section {
  margin-top: 40px;
}

.legal-page h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  color: var(--color-green);
  margin-bottom: 12px;
}

.legal-page p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-body-text);
  margin-bottom: 12px;
}

.legal-page ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal-page li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-body-text);
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--color-dark-text);
  font-weight: 600;
  text-decoration: underline;
}

/* Contact page: channel cards under the lead paragraph */
.contact-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-card {
  background: var(--color-white);
  padding: 28px 24px;
}

.contact-card h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-green);
  margin-bottom: 10px;
}

.contact-card p,
.contact-card a {
  font-size: 15px;
  color: var(--color-body-text);
  line-height: 1.5;
}

.contact-card a {
  color: var(--color-dark-text);
  font-weight: 600;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

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

@media (max-width: 480px) {
  .legal-page__title {
    font-size: 34px;
  }
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 900px) {
  /* Order page: stack the product summary above the shipping form
     instead of a fixed 420px + fluid two-column grid */
  .order-page {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .order-summary {
    position: static;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-nav {
    justify-content: space-between;
    padding: 0 24px;
  }

  .site-nav__logo {
    position: static;
    transform: none;
  }
}

@media (max-width: 480px) {
  .authcard {
    padding: 32px 24px;
  }
}
