/* Olora custom checkout — built on the design.md (Figma redesign) token set. */
:root {
  --brand-1-100: #fefefe;
  --brand-1-800: #eededc;
  --brand-1-1800: #e1c4c1;
  --brand-2-400: #fdfcfb;
  --brand-2-1800: #f7f3ef;
  --brand-2-2000: #ede9e6;
  --brand-3-400: #c5c6c7;
  --brand-3-1200: #535758;
  --brand-3-1800: #272b2d;

  --text-primary: #272b2d;
  --text-secondary: rgba(39, 43, 45, 0.75);
  --text-muted: rgba(39, 43, 45, 0.5);
  --hairline: rgba(39, 43, 45, 0.08);
  --border-input: rgba(39, 43, 45, 0.18);

  --font-heading: "Anek Devanagari", sans-serif;
  --font-serif: "Newsreader", serif;
  --font-body: "Outfit", sans-serif;
  --font-label: "Syne", sans-serif;

  --radius: 8px;
  --shadow-lg: 0 4px 6px -2px rgba(16, 24, 40, 0.03), 0 12px 16px -4px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--brand-2-400);
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 500; letter-spacing: -0.01em; margin: 0; }

a { color: var(--text-primary); }

/* ---------- Layout ---------- */
.co-wrap { max-width: 1100px; margin: 0 auto; }

.co-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  min-height: 100vh;
}

.co-form {
  padding: 32px 56px 64px;
  max-width: 560px;
  width: 100%;
  margin-left: auto;
}

.co-summary {
  background: linear-gradient(180deg, #f7eeec 0%, #faf3f1 100%);
  border-left: 1px solid var(--hairline);
  padding: 40px 56px 64px;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}
.co-summary-inner { max-width: 420px; }

/* ---------- Header ---------- */
.co-header { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin-bottom: 36px; }
.co-logo { display: inline-flex; align-items: center; font-family: var(--font-heading); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; color: var(--text-primary); }
.co-logo img { height: 28px; width: auto; display: block; }
.co-trust { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); padding-left: 18px; border-left: 1px solid var(--hairline); }
.co-trust strong { color: var(--text-primary); font-weight: 600; }
.co-trust__avatars { display: flex; }
.co-trust__avatars img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; margin-left: -8px;
  border: 2px solid var(--brand-2-400); background: var(--brand-2-2000);
}
.co-trust__avatars img:first-child { margin-left: 0; }

/* ---------- Sections ---------- */
.co-section { margin-top: 28px; }
.co-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.co-section h2 { font-size: 21px; }
.co-section__link { font-size: 13px; color: var(--text-secondary); text-decoration: underline; }
.co-section__note { font-size: 13px; color: var(--text-secondary); margin: -2px 0 12px; }

/* ---------- Express checkout ---------- */
.co-express__label { text-align: center; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.co-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 4px; color: var(--text-muted); font-size: 13px; }
.co-divider::before, .co-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* ---------- Form fields ---------- */
.co-field { margin-bottom: 12px; position: relative; }
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-row--addr { grid-template-columns: 1fr 1fr; }

.co-input, .co-select {
  width: 100%;
  height: 52px;
  padding: 16px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-primary);
  background: var(--brand-1-100);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.co-input::placeholder { color: var(--text-muted); }
/* Filled fields get a green border. Every input carries a placeholder and the
   country <select> always has a value, so both are "filled" once they hold data.
   Placed before :focus/.is-invalid so charcoal-focus and red-invalid override it. */
.co-input:not(:placeholder-shown), .co-select { border-color: #2e7d32; }
.co-input:focus, .co-select:focus {
  border-color: var(--brand-3-1800);
  box-shadow: 0 0 0 1px var(--brand-3-1800);
}
.co-input.is-invalid { border-color: #c8202f; box-shadow: 0 0 0 1px #c8202f; }
.co-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23272b2d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 38px;
}
.co-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); margin: 4px 0 0; cursor: pointer; }
.co-check input { width: 18px; height: 18px; accent-color: var(--brand-3-1800); }

/* ---------- Complete Your Order (upsells) ---------- */
.co-upsells__title { font-size: 21px; }
.co-upsell {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--brand-1-100); padding: 16px; margin-top: 12px;
}
.co-upsell__main { display: flex; align-items: center; gap: 14px; }
.co-upsell__img {
  width: 88px; height: 88px; flex: none; border-radius: var(--radius);
  background: var(--brand-2-2000) center/cover no-repeat; border: 1px solid var(--hairline);
}
.co-upsell__info { flex: 1; min-width: 0; }
.co-upsell__title { font-family: var(--font-heading); font-weight: 500; font-size: 16px; color: var(--text-primary); margin-bottom: 6px; }
.co-upsell__bullets { list-style: none; margin: 0 0 8px; padding: 0; }
.co-upsell__bullets li {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  padding-left: 22px; position: relative;
}
.co-upsell__bullets li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.co-upsell__price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-upsell__now { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.co-upsell__was { text-decoration: line-through; color: var(--text-muted); font-size: 13px; }
.co-upsell__off {
  background: var(--brand-2-2000); color: var(--text-secondary);
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.co-upsell__btn {
  flex: none; align-self: center; min-width: 116px; height: 50px; padding: 0 18px;
  background: var(--brand-3-1800); color: var(--brand-1-100); border: none; border-radius: var(--radius);
  font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; cursor: pointer; transition: opacity 0.15s;
}
.co-upsell__btn:hover { opacity: 0.92; }
.co-upsell__btn:disabled { opacity: 0.55; cursor: default; }
.co-upsell__size { margin-top: 14px; }
.co-upsell__sizelabel { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; padding-left: 2px; }

@media (max-width: 520px) {
  .co-upsell__img { width: 64px; height: 64px; }
  .co-upsell__btn { min-width: 92px; height: 44px; padding: 0 12px; }
}

/* ---------- Shipping method box ---------- */
.co-shipbox {
  background: var(--brand-2-1800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: space-between;
}
.co-shipbox strong { color: var(--text-primary); font-weight: 500; }

/* ---------- Stripe element mounts ---------- */
#express-element { min-height: 0; margin-bottom: 4px; }
#payment-element { margin-top: 4px; }

/* ---------- Pay button ---------- */
.co-pay {
  width: 100%;
  height: 54px;
  margin-top: 22px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand-3-1800);
  color: var(--brand-1-100);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity 0.15s, transform 0.05s;
}
.co-pay:hover { opacity: 0.92; }
.co-pay:active { transform: translateY(1px); }
.co-pay:disabled { opacity: 0.55; cursor: default; }
.co-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(254,254,254,0.35); border-top-color: #fefefe;
  animation: co-spin 0.7s linear infinite;
}
@keyframes co-spin { to { transform: rotate(360deg); } }

.co-error {
  margin-top: 14px; padding: 12px 14px;
  background: #fdecee; border: 1px solid #f3c2c7; border-radius: var(--radius);
  color: #a01622; font-size: 14px;
}
.co-secure { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* ---------- Order summary ---------- */
.co-lineitem { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.co-thumb {
  width: 56px; height: 56px; border-radius: var(--radius); flex: none;
  background: var(--brand-2-2000) center/cover; border: 1px solid var(--hairline);
  position: relative;
}
.co-thumb__qty {
  position: absolute; top: -8px; right: -8px;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--brand-3-1200); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.co-lineitem__info { flex: 1; min-width: 0; }
.co-lineitem__title { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.co-lineitem__variant { font-size: 13px; color: var(--text-secondary); }
.co-lineitem__price { font-size: 14px; font-weight: 500; white-space: nowrap; }

.co-discount { display: flex; gap: 10px; margin: 20px 0; }
.co-discount .co-input { height: 46px; }
.co-discount button {
  height: 46px; padding: 0 18px; flex: none;
  background: var(--brand-2-2000); border: 1px solid var(--border-input);
  border-radius: var(--radius); color: var(--text-secondary);
  font-family: var(--font-label); font-weight: 700; font-size: 12px;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
}

.co-totals { border-top: 1px solid var(--hairline); padding-top: 18px; }
.co-totals__row { display: flex; justify-content: space-between; font-size: 15px; color: var(--text-secondary); margin-bottom: 10px; }
.co-totals__row strong { color: var(--text-primary); font-weight: 500; }
.co-totals__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.co-totals__total .label { font-size: 18px; font-weight: 500; color: var(--text-primary); }
.co-totals__total .amount { font-family: var(--font-heading); font-weight: 600; font-size: 26px; }
.co-totals__total .amount small { font-size: 13px; color: var(--text-muted); font-weight: 400; margin-right: 6px; }

/* ---------- Trust rows ---------- */
.co-guarantees { margin-top: 28px; display: grid; gap: 18px; }
.co-guarantee { display: flex; gap: 14px; align-items: flex-start; }
.co-guarantee__icon { width: 38px; height: 38px; flex: none; color: var(--brand-3-1200); }
.co-guarantee__icon svg { width: 100%; height: 100%; }
.co-guarantee__title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.co-guarantee__body { font-size: 13px; color: var(--text-secondary); }

/* ---------- Footer ---------- */
.co-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline); display: flex; gap: 20px; flex-wrap: wrap; }
.co-footer a { font-size: 13px; color: var(--text-secondary); text-decoration: underline; }

/* ---------- Mobile summary toggle ---------- */
.co-mobilebar { display: none; }

/* ---------- Loading skeleton ---------- */
.co-skel { background: var(--brand-2-2000); border-radius: var(--radius); animation: co-pulse 1.3s ease-in-out infinite; }
@keyframes co-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .co-grid { grid-template-columns: 1fr; }
  .co-form { order: 2; padding: 24px 20px 56px; margin: 0 auto; max-width: 600px; }
  .co-summary {
    order: 1; position: static; min-height: 0;
    border-left: none; border-bottom: 1px solid var(--hairline);
    padding: 0;
  }
  .co-summary-inner { max-width: 600px; margin: 0 auto; padding: 20px; }
  .co-mobilebar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; cursor: pointer; background: linear-gradient(180deg, #f7eeec, #faf3f1);
    border-bottom: 1px solid var(--hairline);
  }
  .co-mobilebar__left { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); }
  .co-mobilebar__amount { font-family: var(--font-heading); font-weight: 600; font-size: 18px; }
  .co-mobilebar svg { width: 16px; height: 16px; transition: transform 0.2s; }
  .co-summary[data-open="false"] .co-summary-inner { display: none; }
}

@media (max-width: 440px) {
  /* Avoid a stray divider line if the trust badge wraps under the logo. */
  .co-trust { padding-left: 0; border-left: none; }
}
