/* ==========================================================================
   Classic Eyes — Contact lens booking page (template-lens-booking.php)

   Loaded only on that template, with every other stylesheet dequeued except
   Contact Form 7's and Click to Chat's (functions.php), so selectors here
   don't compete with Flatsome.

   Quick adjustments: everything tunable lives in the tokens below.
   Colour rule: green is only ever WhatsApp. Navy is the brand and the
   secondary action. Lens blue is accent only (rules, rings, focus).
   ========================================================================== */

:root {
  /* Colour */
  --ce-navy:       #0d1b3e;   /* Classic Eyes navy — headings, form button */
  --ce-bar:        #000000;   /* top bar and footer — matches the logo's own black */
  --ce-ink-soft:   #3b4a66;   /* body copy */
  --ce-muted:      #5b6882;   /* notes, helper text */
  --ce-paper:      #ffffff;
  --ce-mist:       #f2f6fa;   /* alternate section background, taken from the photo's light */
  --ce-line:       #d6e0ea;   /* borders */
  --ce-lens:       #4a93cf;   /* lens-case blue from the photo — accent only */
  --ce-lens-deep:  #1f5f94;   /* lens blue dark enough for small text (6.7:1 on white); trial band */
  --ce-lens-tint:  #e7f0f9;   /* trial badge */
  --ce-wa:         #11804b;   /* WhatsApp action — white text passes AA (5.0:1) */
  --ce-wa-hover:   #0b6a3d;

  /* Type */
  --ce-display: 'Poppins', system-ui, sans-serif;
  --ce-body:    'Quicksand', system-ui, sans-serif;
  --ce-h1:      clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  --ce-h2:      clamp(1.6rem, 1.2rem + 1.5vw, 2.35rem);
  --ce-lead:    clamp(1.05rem, 1rem + 0.3vw, 1.2rem);

  /* Space and shape */
  --ce-wrap:    1180px;
  --ce-gutter:  22px;
  --ce-section: clamp(56px, 8vw, 104px);
  --ce-radius:  16px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body.ce-lens {
  margin: 0;
  font-family: var(--ce-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ce-ink-soft);
  background: var(--ce-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ce-lens-deep); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--ce-lens);
  outline-offset: 3px;
}

.ce-wrap {
  width: 100%;
  max-width: var(--ce-wrap);
  margin: 0 auto;
  padding: 0 var(--ce-gutter);
}

.ce-h2 {
  margin: 0 0 16px;
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: var(--ce-h2);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ce-navy);
  text-wrap: balance;
}

.ce-section { padding: var(--ce-section) 0; }

/* ---------- Buttons ---------- */
.ce-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--ce-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.ce-btn__icon { width: 22px; height: 22px; flex: 0 0 auto; }

/* Primary: WhatsApp */
.ce-btn--wa {
  background: var(--ce-wa);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(17, 128, 75, .55);
}
.ce-btn--wa:hover { background: var(--ce-wa-hover); transform: translateY(-1px); }

/* Secondary WhatsApp: outline, still green because it is still WhatsApp */
.ce-btn--line {
  background: transparent;
  color: var(--ce-wa);
  border-color: var(--ce-wa);
  min-height: 46px;
  padding: 10px 20px;
  font-size: 0.975rem;
}
.ce-btn--line .ce-btn__icon { width: 19px; height: 19px; }
.ce-btn--line:hover { background: var(--ce-wa); color: #fff; }

/* Form submit: navy, deliberately quieter than WhatsApp */
.ce-btn--solid {
  background: var(--ce-navy);
  color: #fff;
}
.ce-btn--solid:hover { background: #1a2d5c; }

/* ---------- Header bar ---------- */
.ce-bar { background: var(--ce-bar); }
.ce-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.ce-bar__logo img { width: 124px; height: auto; }
.ce-bar__tel { display: none; gap: 28px; }
.ce-bar__tel a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.ce-bar__tel a span { color: #9fb6d6; margin-right: 6px; font-weight: 500; }
.ce-bar__tel a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.ce-hero { position: relative; background: var(--ce-paper); }

.ce-hero__media img {
  width: 100%;
  height: 50vw;
  max-height: 300px;
  object-fit: cover;
  object-position: 68% 40%;
}

.ce-hero__copy { padding: 28px 0 48px; }

/* Trial badge: the first thing read above the H1 */
.ce-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ce-lens-tint);
  border: 1px solid rgba(74, 147, 207, .35);
  font-family: var(--ce-display);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.2;
  color: var(--ce-navy);
}

.ce-hero__title {
  margin: 0 0 16px;
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: var(--ce-h1);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ce-navy);
  max-width: 18ch;
  text-wrap: balance;
}
.ce-hero__lead {
  margin: 0 0 26px;
  font-size: var(--ce-lead);
  max-width: 36ch;
}
.ce-hero .ce-btn--wa { width: 100%; }
.ce-hero__note {
  margin: 12px 0 0;
  font-size: .9rem;
  color: var(--ce-muted);
}
.ce-hero__note strong { color: var(--ce-lens-deep); font-weight: 700; }

/* ---------- Examine → Fit → Supply ---------- */
.ce-order__head { max-width: 40rem; margin-bottom: 44px; }
.ce-order__lead { margin: 0; font-size: var(--ce-lead); }

.ce-order__steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 32px;
}
/* The optical axis: a line from each ring to the next (vertical on phones) */
.ce-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 56px;
  width: 2px;
  height: calc(100% - 56px + 32px);   /* 32px = the list gap */
  background: rgba(74, 147, 207, .5);
}

.ce-step {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 20px;
  align-items: start;
}
.ce-step__num {
  grid-row: span 2;
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--ce-lens);
  background: var(--ce-paper);
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ce-navy);
}
/* inner ring — reads as a lens rather than a bullet */
.ce-step__num::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(74, 147, 207, .35);
}
.ce-step__title {
  margin: 6px 0 2px;
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ce-navy);
}
.ce-step__text { margin: 0; }

/* ---------- One-hour lens trial ---------- */
.ce-trial { background: var(--ce-lens-deep); color: #fff; }
.ce-trial .ce-h2 { color: #fff; }
.ce-trial__inner {
  display: grid;
  gap: 28px;
  grid-template-areas: "copy" "card" "cta";
}
.ce-trial__copy { grid-area: copy; }
.ce-trial__copy p { margin: 0; max-width: 34rem; font-size: var(--ce-lead); color: #dce8f4; }
.ce-trial__facts { grid-area: card; }
.ce-trial__card {
  margin: 0;
  padding: 6px 24px;
  background: var(--ce-paper);
  border-radius: var(--ce-radius);
  box-shadow: 0 18px 40px -18px rgba(4, 22, 45, .55);
}
.ce-trial__card div {
  display: flex;
  flex-wrap: wrap;             /* a long value drops under its label rather than squeezing it */
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ce-line);
}
.ce-trial__card div:last-child { border-bottom: 0; }
.ce-trial__card dt { color: var(--ce-ink-soft); font-weight: 600; }
.ce-trial__card dd {
  margin: 0;
  font-family: var(--ce-display);
  font-weight: 700;
  color: var(--ce-navy);
  white-space: nowrap;
  margin-left: auto;
}
/* The condition sits under the card it qualifies. Not fine print: same colour as the body. */
.ce-trial__terms { margin: 14px 4px 0; font-size: .9rem; line-height: 1.5; color: #dce8f4; }
.ce-trial__cta { grid-area: cta; }
.ce-trial .ce-btn--wa { width: 100%; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45); }

/* ---------- What we stock ---------- */
.ce-stock { background: var(--ce-mist); }
.ce-stock__lead { max-width: 42rem; margin: 0 0 32px; font-size: var(--ce-lead); }

/* Manufacturer names set as type. Deliberately not links. */
.ce-stock__makers {
  list-style: none;
  margin: 0 0 44px;
  padding: 22px 0;
  border-top: 1px solid var(--ce-line);
  border-bottom: 1px solid var(--ce-line);
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 14px 36px;
  white-space: nowrap;
  font-family: var(--ce-display);
  font-weight: 600;
  font-size: clamp(1rem, .9rem + .8vw, 1.6rem);
  letter-spacing: -0.01em;
  color: var(--ce-navy);
}

.ce-stock__paths { display: grid; gap: 20px; }
.ce-path {
  background: var(--ce-paper);
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 24px 22px;
}
.ce-path__title {
  margin: 0 0 8px;
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ce-navy);
}
.ce-path p { margin: 0 0 20px; }

/* ---------- Form (CF7 "Contact lens booking") ---------- */
.ce-form-section__inner { display: grid; gap: 28px; }
.ce-form-section__intro p { margin: 0; font-size: var(--ce-lead); max-width: 30ch; }

.ce-form {
  background: var(--ce-mist);
  border-radius: 20px;
  padding: 26px 20px;
}
.ce-form .wpcf7-form { display: grid; gap: 18px; margin: 0; }
.ce-form .hidden-fields-container { display: none; }
.ce-form .wpcf7-form-control-wrap { display: block; }

.ce-field { display: grid; gap: 6px; margin: 0; min-width: 0; }
.ce-field label,
.ce-field legend {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ce-navy);
}
.ce-optional { font-weight: 500; color: var(--ce-muted); margin-left: 4px; }

.ce-field input[type="text"],
.ce-field input[type="email"],
.ce-field input[type="tel"],
.ce-field input[type="date"] {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 16px;
  font: inherit;
  font-size: 1rem;              /* 16px stops iOS zooming the page on focus */
  color: var(--ce-navy);
  background: var(--ce-paper);
  border: 1.5px solid var(--ce-line);
  border-radius: 12px;
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ce-field input:focus {
  outline: none;
  border-color: var(--ce-lens);
  box-shadow: 0 0 0 4px rgba(74, 147, 207, .2);
}
.ce-field input.wpcf7-not-valid { border-color: #c0392b; }
.ce-form .wpcf7-not-valid-tip { margin-top: 6px; font-size: .85rem; font-weight: 600; color: #b03a2e; }

/* Branch choice as a two-way switch (CF7 radio with use_label_element) */
.ce-field--choice { border: 0; padding: 0; }
.ce-field--choice legend { margin-bottom: 6px; padding: 0; }
.ce-field--choice .wpcf7-radio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ce-field--choice .wpcf7-list-item { margin: 0; }
.ce-field--choice .wpcf7-list-item label { position: relative; display: block; cursor: pointer; }
.ce-field--choice .wpcf7-list-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ce-field--choice .wpcf7-list-item-label {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1.5px solid var(--ce-line);
  border-radius: 12px;
  background: var(--ce-paper);
  font-weight: 700;
  color: var(--ce-navy);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.ce-field--choice input:checked + .wpcf7-list-item-label {
  background: var(--ce-navy);
  border-color: var(--ce-navy);
  color: #fff;
}
.ce-field--choice input:focus-visible + .wpcf7-list-item-label {
  outline: 3px solid var(--ce-lens);
  outline-offset: 3px;
}

.ce-form__consent { margin: 0; font-size: .85rem; line-height: 1.5; color: var(--ce-muted); }
.ce-form__submit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ce-form .ce-btn--solid { width: 100%; }
.ce-form .wpcf7-spinner { margin: 0 0 0 8px; }

/* CF7's response box, in the page's colours */
.ce-form .wpcf7 form .wpcf7-response-output {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  background: var(--ce-paper);
}
.ce-form .wpcf7 form.sent .wpcf7-response-output { border-color: var(--ce-lens); color: var(--ce-navy); }

/* ---------- Branches ---------- */
.ce-branches { background: var(--ce-mist); }
.ce-branches__list { display: grid; gap: 16px; margin-top: 12px; }
.ce-branch {
  background: var(--ce-paper);
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 24px 28px;
}
.ce-branch__name {
  margin: 0 0 4px;
  font-family: var(--ce-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ce-navy);
}
.ce-branch__tel {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ce-navy);
  text-decoration: none;
  border-bottom: 2px solid var(--ce-lens);
}
.ce-branch__tel:hover { color: var(--ce-lens-deep); }

/* ---------- Footer ---------- */
.ce-foot { background: var(--ce-bar); color: #9fb6d6; padding: 36px 0; }
.ce-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.ce-foot img { width: 104px; height: auto; }
.ce-foot__back { color: #fff; font-weight: 600; text-decoration: none; }
.ce-foot__back:hover { text-decoration: underline; }
.ce-foot__legal { margin: 0 0 0 auto; font-size: .85rem; }

/* ==========================================================================
   Tablet and up
   ========================================================================== */
@media (min-width: 768px) {
  .ce-bar__inner { min-height: 72px; }
  .ce-bar__logo img { width: 148px; }
  .ce-bar__tel { display: flex; }

  .ce-hero .ce-btn--wa,
  .ce-trial .ce-btn--wa { width: auto; }

  .ce-path { padding: 28px; }
  .ce-stock__makers { grid-template-columns: repeat(4, auto); justify-content: space-between; }
  .ce-stock__paths { grid-template-columns: 1fr 1fr; }

  .ce-branches__list { grid-template-columns: 1fr 1fr; }
  .ce-form { padding: 32px; }
}

/* ==========================================================================
   Desktop: copy on white at left, photo bleeding off the right edge.
   The photo's own bright left side fades into the page, so there is no box.
   ========================================================================== */
@media (min-width: 900px) {
  .ce-hero__media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
  }
  .ce-hero__media img {
    height: 100%;
    max-height: none;
    object-position: 66% 50%;   /* keeps the lens clear of the fade into white */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
  }
  .ce-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: clamp(520px, 72vh, 680px);
  }
  .ce-hero__copy {
    max-width: min(32rem, 44vw);
    padding: 64px 0;
  }

  /* Steps go horizontal; the axis runs through the rings left to right */
  .ce-order__steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .ce-step:not(:last-child)::before {
    left: 56px;
    top: 27px;
    width: calc(100% + 28px - 56px);  /* 28px = the column gap */
    height: 2px;
  }
  .ce-step { grid-template-columns: 1fr; row-gap: 18px; }
  .ce-step__num { grid-row: auto; }
  .ce-step__title { margin-top: 0; }

  .ce-trial__inner {
    grid-template-columns: 7fr 5fr;
    grid-template-areas: "copy card" "cta card";
    column-gap: 64px;
    row-gap: 28px;
  }
  .ce-trial__copy { align-self: end; }
  .ce-trial__cta { align-self: start; }

  .ce-form-section__inner {
    grid-template-columns: 5fr 7fr;
    gap: 56px;
    align-items: start;
  }
  .ce-form-section__intro { position: sticky; top: 32px; }
  .ce-form { padding: 40px; }
  .ce-form .ce-btn--solid { width: auto; }
}

/* Small phones */
@media (max-width: 399px) {
  .ce-btn--line { padding: 10px 14px; font-size: .9rem; }
}
@media (max-width: 359px) {
  .ce-stock__makers { grid-template-columns: auto; }
  .ce-hero__media img { height: 44vw; }
  .ce-hero__copy { padding-top: 20px; }
  .ce-badge { margin-bottom: 12px; }
  .ce-hero__lead { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .ce-btn--wa:hover { transform: none; }
}
