/* ==========================================================================
   McLains Group — design tokens
   ========================================================================== */
:root {
  --navy: #1a2e4a;
  --navy-dark: #0e1c30;
  --charcoal: #23272e;
  --gold: #c9a84c;
  --gold-light: #d6bd78;
  --cream: #f7f5f0;
  --white: #ffffff;
  --grey-700: #4a4f57;
  --grey-500: #6b7078;
  --grey-200: #e2e2df;
  --grey-100: #edece7;

  --font-serif: 'DM Serif Display', Georgia, 'Times New Roman', Times, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1140px;
  --radius: 3px;

  /* Type scale — reused everywhere so heading sizes never drift
     section-to-section. */
  --fs-h1: 2.85rem;
  --fs-h2: 2.25rem;
  --fs-h3: 1.2rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--navy);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: inherit; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 104px 0;
  border-top: 1px solid var(--grey-200);
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
  display: block;
}

.section-heading {
  font-size: var(--fs-h2);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-intro {
  max-width: 620px;
  color: var(--grey-700);
  margin-bottom: 56px;
}

/* Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
}
.btn-primary:hover { background: var(--gold-light); }

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.btn-secondary:hover { border-color: var(--white); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-serif);
  color: var(--white);
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.logo span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--white); }

.nav-cta {
  background: var(--gold);
  color: var(--navy-dark);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-cta:hover { background: var(--gold-light); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
}

/* Hero
   ========================================================================== */
.hero {
  color: var(--white);
  padding: 110px 0 96px;
  background-image:
    linear-gradient(100deg, rgba(10,21,35,0.94) 0%, rgba(10,21,35,0.88) 40%, rgba(10,21,35,0.72) 100%),
    url('../images/hero-uk-terraced-street.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

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

.hero-copy { max-width: 640px; }

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 18px;
  display: block;
}

.hero h1 {
  color: var(--white);
  font-size: var(--fs-h1);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.78);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.hero-stat .num {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--gold-light);
  display: block;
}
.hero-stat .label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}

/* Services — one full-width section per service, alternating sides
   ========================================================================== */
.service-detail--alt {
  background: var(--cream);
}

.service-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.service-detail-copy { order: 1; }
.service-detail-visual { order: 2; }
.service-detail--reverse .service-detail-copy { order: 2; }
.service-detail--reverse .service-detail-visual { order: 1; }

.service-detail-copy p {
  color: var(--grey-700);
  font-size: 1.02rem;
  margin-bottom: 28px;
  max-width: 52ch;
}

.service-stat {
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  background: var(--white);
  padding: 40px 32px;
  text-align: center;
}
.service-detail--alt .service-stat { background: var(--white); }

.service-stat .num {
  font-family: var(--font-serif);
  color: var(--gold);
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  line-height: 1.2;
}

.service-stat .label {
  color: var(--grey-700);
  font-size: 0.92rem;
}

.service-detail-image {
  border-radius: var(--radius);
  overflow: hidden;
}
.service-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* How it works
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.how-it-works-cta {
  margin-top: 56px;
}

.step {
  position: relative;
  padding-top: 8px;
}

.step-num {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--grey-200);
  display: block;
  margin-bottom: 8px;
}

.step h3 { font-size: var(--fs-h3); margin-bottom: 8px; }
.step p { color: var(--grey-700); font-size: 0.93rem; }

/* Calculator
   ========================================================================== */
.calculator-section {
  background: var(--grey-100);
}

.calc-panel {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}

.calc-inputs, .calc-outputs { min-width: 0; }

.field-row {
  margin-bottom: 20px;
}

.field-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--grey-500);
  margin-top: 4px;
}

.field-row select,
.field-row input[type="number"],
.field-row input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--charcoal);
}

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

.value-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.toggle-btn {
  flex: 1;
  padding: 9px;
  text-align: center;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--grey-700);
  cursor: pointer;
}

.toggle-btn.active {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--grey-100);
}

.calc-outputs {
  background: var(--navy-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 32px;
}

.calc-outputs h3 {
  color: var(--white);
  font-size: var(--fs-h3);
  margin-bottom: 24px;
}

.output-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.output-row:last-of-type { border-bottom: none; }

.output-row .out-label {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
}

.output-row .out-value {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold-light);
}

.output-row.total .out-value {
  color: var(--white);
  font-size: 1.55rem;
}

.calc-outputs .btn-primary {
  width: 100%;
  text-align: center;
  margin-top: 24px;
}

.accordion {
  margin-top: 24px;
  border-top: 1px solid var(--grey-200);
  padding-top: 20px;
}

.accordion summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:before {
  content: "+ ";
  color: var(--gold);
}
.accordion[open] summary:before { content: "\2212 "; }

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.85rem;
}
.breakdown-table th, .breakdown-table td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grey-200);
}
.breakdown-table th:first-child, .breakdown-table td:first-child { text-align: left; }
.breakdown-table th {
  color: var(--grey-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-disclaimer {
  font-size: 0.78rem;
  color: var(--grey-500);
  margin-top: 20px;
}

/* Live Deals
   ========================================================================== */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.deal-card {
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.deal-card-image {
  aspect-ratio: 16 / 10;
  background: var(--grey-100);
  overflow: hidden;
}
.deal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.deal-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-500);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.deal-card-header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 18px 22px;
  position: relative;
}

.deal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.deal-badge,
.deal-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deal-badge {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
}

.deal-status-badge {
  background: rgba(169,130,47,0.2);
  color: var(--gold-light);
}

.deal-card-header .deal-title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  margin: 0;
  color: var(--white);
}
.deal-card-header .deal-location {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.deal-card-body {
  padding: 20px 22px;
}

.deal-description {
  color: var(--grey-700);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.deal-figure {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-200);
  font-size: 0.9rem;
}
.deal-figure:last-child { border-bottom: none; }
.deal-figure .k { color: var(--grey-700); }
.deal-figure .v { font-weight: 600; color: var(--navy); }
.deal-figure .v.gold { color: var(--gold); }

.deals-empty {
  border: 1px dashed var(--grey-200);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  color: var(--grey-500);
}
.deals-empty h3 { color: var(--navy); }

.deals-loading {
  text-align: center;
  color: var(--grey-500);
  padding: 40px 0;
}

.deals-view-all {
  text-align: center;
  margin-top: 40px;
}

/* Deals filters + pagination (full /deals listing)
   ========================================================================== */
.deals-filters {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--grey-200);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
}

.filter-field select {
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--charcoal);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination #page-indicator {
  font-size: 0.88rem;
  color: var(--grey-700);
  font-weight: 600;
}

/* Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
}

.contact-details p { color: var(--grey-700); }

.contact-item {
  margin-bottom: 22px;
}
.contact-item .k {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
}
.contact-item a {
  text-decoration: none;
  color: var(--navy);
  font-size: 1.05rem;
}
.contact-item a:hover { color: var(--gold); }

.contact-form .field-row input,
.contact-form .field-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.contact-form .field-row textarea { resize: vertical; min-height: 120px; }
.contact-form .field-row input:focus,
.contact-form .field-row textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-note {
  font-size: 0.82rem;
  color: var(--grey-500);
  margin-top: 12px;
}

/* Footer
   ========================================================================== */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  font-size: 0.85rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: var(--white); }

.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-links {
  display: flex;
  gap: 14px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
}
.social-icon:hover { color: var(--gold-light); }

/* WhatsApp floating button
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 96px; /* stacked above the chat bubble (bottom: 24px, 56px tall) */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 200;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
body.chat-open .whatsapp-float { display: none; }
/* Failsafe: whenever the chat window is open, the preview bubble must
   never show, regardless of the JS click-handler path that opened it. */
body.chat-open .chat-preview { display: none !important; }

/* Chat widget
   ========================================================================== */
.chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 210;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.chat-bubble:hover { transform: scale(1.06); }
.chat-bubble .icon-close { display: none; }
body.chat-open .chat-bubble .icon-chat { display: none; }
body.chat-open .chat-bubble .icon-close { display: block; }

@keyframes chat-preview-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-preview {
  position: fixed;
  right: 90px;
  bottom: 22px;
  max-width: 220px;
  width: max-content;
  background: var(--white);
  color: var(--charcoal);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  padding: 12px 28px 12px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  z-index: 209;
  animation: chat-preview-in 0.25s ease;
}
.chat-preview p { margin: 0; }
.chat-preview:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.28); }

.chat-preview-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: var(--grey-500);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.chat-preview-close:hover { color: var(--charcoal); }

@media (max-width: 480px) {
  .chat-preview {
    right: 78px;
    max-width: calc(100vw - 120px);
  }
}

.chat-window {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 140px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  z-index: 205;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* An explicit `display: flex` above is a normal author declaration,
   which beats the browser's UA `[hidden] { display: none }` rule in the
   CSS cascade regardless of specificity — so the hidden attribute alone
   was not actually hiding this element. This more-specific selector
   fixes it (this is the same class of bug .chat-preview never had,
   since it has no explicit `display` set). */
.chat-window[hidden] {
  display: none;
}

.chat-header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.chat-close:hover { color: var(--white); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--grey-100);
}

.chat-message {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-message-assistant {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--grey-200);
  color: var(--charcoal);
}

.chat-message-user {
  align-self: flex-end;
  background: var(--navy);
  color: var(--white);
}

.chat-typing {
  color: var(--grey-500);
  font-style: italic;
}

.chat-whatsapp-cta {
  background: transparent;
  border: none;
  padding: 4px 0;
}
.chat-whatsapp-cta .btn { padding: 10px 18px; font-size: 0.85rem; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--grey-200);
  background: var(--white);
}

.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
}
.chat-input-row input:focus {
  outline: none;
  border-color: var(--gold);
}
.chat-input-row button {
  padding: 10px 18px;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .chat-window {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    bottom: 88px;
    height: calc(100vh - 120px);
  }
}

/* Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .service-detail-grid { grid-template-columns: 1fr; gap: 32px; }
  .service-detail-copy, .service-detail-visual,
  .service-detail--reverse .service-detail-copy,
  .service-detail--reverse .service-detail-visual { order: initial; }
  .steps-grid { grid-template-columns: 1fr; gap: 40px; }
  .calc-panel { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .site-header.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 20px 24px;
    gap: 16px;
  }
  .site-header.nav-open .nav-cta {
    display: inline-block;
    margin: 0 24px 20px;
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  .hero-stats { grid-template-columns: 1fr; gap: 20px; }
  .steps-grid { gap: 32px; }
  .section { padding: 72px 0; }
}
