/* ============================================================
   MIRA HOME — Contact Page Styles
   ============================================================ */


/* ------------------------------------------------------------
   SCROLL REVEAL
   ------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}


/* ------------------------------------------------------------
   1. BANNER
   ------------------------------------------------------------ */
.ct-banner {
  position: relative;
  height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ct-banner-bg {
  position: absolute;
  inset: 0;
  background-color: var(--color-charcoal);
}

.ct-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.02);
}

.ct-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(250,246,240,0.92) 0%,
    rgba(250,246,240,0.70) 45%,
    rgba(250,246,240,0.25) 100%
  );
}

.ct-banner-content {
  position: relative;
  z-index: 1;
}

.ct-banner-label {
  margin-bottom: var(--space-2);
}

.ct-banner-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
}

.ct-banner-title em {
  font-style: italic;
  color: var(--color-primary-dark);
  font-weight: var(--fw-regular);
}

.ct-banner-sub {
  font-size: var(--fs-sm);
  color: var(--color-brown-mid);
  margin: 0;
  max-width: 480px;
  line-height: var(--lh-relaxed);
}

/* Breadcrumb bar */
.ct-breadcrumb-bar {
  background-color: var(--bg-section-alt);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-3) 0;
}

.ct-breadcrumb {
  font-size: var(--fs-xs);
  margin: 0;
}

.ct-breadcrumb .breadcrumb-item a {
  color: var(--color-brown-mid);
  text-decoration: none;
  transition: color var(--transition-base);
}

.ct-breadcrumb .breadcrumb-item a:hover { color: var(--color-primary-dark); }
.ct-breadcrumb .breadcrumb-item.active  { color: var(--color-brown-mid); }
.ct-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--color-stone); }


/* ------------------------------------------------------------
   2. LAYOUT
   ------------------------------------------------------------ */
.ct-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-8);
  align-items: start;
}


/* ------------------------------------------------------------
   3. INFO COLUMN
   ------------------------------------------------------------ */
.ct-info-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-4));
  /* The whole column (Email, Call, Hours, Follow us, every branch) rises in
     together on load. Previously each card had its own scroll-reveal, so the
     tall branch list below the fold faded in on its own, later than the rest.
     `backwards` (not `both`) so no transform lingers after it ends — a
     leftover transform would be a stacking context on a sticky element. */
  animation: ct-rise 0.6s ease backwards;
}

@keyframes ct-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-info-col { animation: none; }
}

.ct-info-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ct-info-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition-base);
}

.ct-info-card:hover {
  box-shadow: var(--shadow-sm);
}

.ct-info-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--color-primary-xlight);
  border: 1px solid var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

.ct-info-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* Fill the rest of the card. Without this the body shrink-wraps its content,
     which leaves the tablet Business Hours grid (branches in columns) no
     width to spread into. */
  flex: 1 1 auto;
  /* FIX (same failure mode as admin Order Details' "zoomed in on mobile"
     bug — an unbroken long admin-configured email/phone value here has no
     room to shrink inside the flex row, which can force the card, the
     .ct-layout grid, and the page wider than the mobile viewport). */
  min-width: 0;
}

.ct-info-body strong {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
}

.ct-info-body span,
.ct-info-body a {
  font-size: var(--fs-sm);
  color: var(--color-brown-mid);
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
}

.ct-info-body a:hover {
  color: var(--color-primary-dark);
}

.ct-info-note {
  font-size: var(--fs-xs) !important;
  color: var(--color-brown-light) !important;
}

/* Business Hours — one block per branch: the branch name, then its schedule
   indented underneath behind a thin guide line so it never sits flush with
   the name. */
.ct-hours {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.ct-hours-branch {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.ct-info-body .ct-hours-name {
  font-weight: var(--fw-medium);
  color: var(--color-charcoal);
}

.ct-hours-list {
  list-style: none;
  margin: 0 0 0 var(--space-2);
  padding: 0 0 0 var(--space-3);
  border-left: 2px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ct-hours-list li {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-brown-mid);
  line-height: var(--lh-relaxed);
}

/* Keep "11:00 AM – 4:00 PM" together — on a narrow card the whole range drops
   to the next line instead of breaking mid-range. */
.ct-info-body .ct-hours-time { white-space: nowrap; }


/* ------------------------------------------------------------
   4. SOCIAL LINKS
   ------------------------------------------------------------ */
.ct-socials {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.ct-socials-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brown-light);
  white-space: nowrap;
}

.ct-social-links {
  display: flex;
  gap: var(--space-2);
}

.ct-social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brown-mid);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ct-social-btn:hover {
  background-color: var(--color-primary-xlight);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}


/* ------------------------------------------------------------
   5. BRANCH LOCATIONS
   Each branch is a regular .ct-info-card (same icon tile, padding, border,
   hover as Email/Call/Hours) — these rules only add what's branch-specific.
   ------------------------------------------------------------ */
.ct-locations {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);   /* same gap as .ct-info-cards */
}

/* Name + "Main Branch" pill on one line; the pill wraps under the name
   instead of squeezing it on a narrow card. */
.ct-branch-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.ct-info-body .ct-branch-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
}

.ct-info-body .ct-branch-badge {
  font-size: 0.625rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--color-charcoal);
  color: var(--color-cream);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
  /* "Main Branch" is two words — keep the pill itself on one line. */
  white-space: nowrap;
}

.ct-info-body .maps-text-link:hover {
  color: var(--color-primary-dark);
}

.ct-info-body .ct-branch-directions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-primary-dark);
  transition: color var(--transition-fast);
}

.ct-info-body .ct-branch-directions:hover {
  color: var(--color-charcoal);
}

.ct-branch-directions i {
  font-size: 0.8rem;
}

.ct-branch-directions i:last-child {
  transition: transform var(--transition-base);
}

.ct-branch-directions:hover i:last-child {
  transform: translateX(4px);
}


/* ------------------------------------------------------------
   6. FORM CARD
   ------------------------------------------------------------ */
.ct-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.ct-form-header {
  padding: var(--space-6) var(--space-8);
  background-color: var(--bg-section-alt);
  border-bottom: 1px solid var(--border-light);
}

.ct-form-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
  margin: 0 0 var(--space-2);
  line-height: var(--lh-tight);
}

.ct-form-sub {
  font-size: var(--fs-sm);
  color: var(--color-brown-light);
  margin: 0;
  line-height: var(--lh-relaxed);
}

.ct-form-body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}


/* ------------------------------------------------------------
   7. FORM FIELDS
   ------------------------------------------------------------ */
.ct-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.ct-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ct-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-brown-dark);
}

.ct-required {
  color: var(--color-danger);
  margin-left: 2px;
}

.ct-optional {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--color-stone);
}

.ct-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--color-charcoal);
  background-color: var(--bg-page);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}

.ct-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200,168,130,0.15);
  background-color: var(--bg-card);
}

.ct-input.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(184,92,74,0.1);
}

.ct-input::placeholder {
  color: var(--color-stone);
}

.ct-input-locked,
.ct-input-locked:focus {
  background-color: var(--bg-page-secondary, #F5F1EA);
  color: var(--color-stone);
  border-color: var(--border-color);
  box-shadow: none;
  cursor: not-allowed;
}

/* Select arrow */
.ct-select {
  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 d='M1 1l5 5 5-5' stroke='%23B08060' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

/* Textarea */
.ct-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Char count row */
.ct-char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.2em;
}

.ct-char-count {
  font-size: var(--fs-xs);
  color: var(--color-stone);
  white-space: nowrap;
  flex-shrink: 0;
}

.ct-field-error {
  font-size: var(--fs-xs);
  color: var(--color-danger);
  min-height: 1em;
}


/* ------------------------------------------------------------
   8. CONSENT CHECKBOX
   ------------------------------------------------------------ */
.ct-consent {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ct-consent-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

/* Hide native checkbox */
.ct-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom checkbox */
.ct-consent-custom {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-page);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
}

.ct-checkbox:checked + .ct-consent-custom {
  background-color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}

.ct-checkbox:checked + .ct-consent-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid var(--color-cream);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

.ct-consent-text {
  font-size: var(--fs-xs);
  color: var(--color-brown-mid);
  line-height: var(--lh-relaxed);
}

.ct-consent-text a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ct-consent-text a:hover {
  color: var(--color-charcoal);
}


/* ------------------------------------------------------------
   9. SUBMIT BUTTON
   ------------------------------------------------------------ */
.btn-ct-submit {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-charcoal);
  border: 1.5px solid var(--color-charcoal);
  border-radius: var(--radius-md);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ct-submit:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ct-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ct-spin {
  display: inline-block;
  animation: ct-spin 0.8s linear infinite;
}

@keyframes ct-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* ------------------------------------------------------------
   10. SUCCESS STATE
   ------------------------------------------------------------ */
.ct-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}

.ct-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(107,143,94,0.12);
  border: 2px solid rgba(107,143,94,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  font-size: 1.6rem;
  animation: ct-pop 0.4s var(--transition-spring) forwards;
}

@keyframes ct-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.ct-success-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: var(--color-charcoal);
  margin: 0;
}

.ct-success-text {
  font-size: var(--fs-sm);
  color: var(--color-brown-light);
  line-height: var(--lh-relaxed);
  margin: 0;
  max-width: 360px;
}

.btn-ct-reset {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  background: transparent;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--color-brown-dark);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: var(--space-2);
}

.btn-ct-reset:hover {
  border-color: var(--color-charcoal);
  color: var(--color-charcoal);
  background-color: var(--bg-section-alt);
}


/* ------------------------------------------------------------
   11. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 1199.98px) {
  .ct-layout { grid-template-columns: 300px 1fr; }
}

@media (max-width: 991.98px) {
  .ct-layout {
    grid-template-columns: 1fr;
  }
  .ct-info-col {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
  .ct-info-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  /* Email | Call side by side; Business Hours takes the full row and lays
     its branches out in columns instead of one tall narrow stack. */
  .ct-info-card--hours { grid-column: 1 / -1; }
  .ct-hours {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: var(--space-3) var(--space-6);
  }
  .ct-socials { grid-column: 1 / -1; }
  .ct-locations {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ct-info-col         { grid-template-columns: 1fr; }
  .ct-info-cards       { grid-template-columns: 1fr; }
  .ct-locations        { grid-template-columns: 1fr; }
  .ct-field-row        { grid-template-columns: 1fr; }
  .ct-form-body        { padding: var(--space-5); }
  .ct-form-header      { padding: var(--space-5); }
}

/* Small phones: trim the card padding/gap so addresses, emails and hours get
   the width back instead of wrapping early. */
@media (max-width: 479.98px) {
  .ct-info-card {
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .ct-socials {
    flex-wrap: wrap;
    padding: var(--space-4);
  }
}
