/* =====================================================================
   HANDYMAN SERVICES — "Claude Design" Enhancement Layer
   ---------------------------------------------------------------------
   Additive polish on top of the existing Dutch orange/blue theme.
   Loaded last so it can refine (not replace) earlier styles.
   Nothing here changes the page structure — only visual quality,
   micro-interactions, focus states, accessibility and rhythm.
   Respects prefers-reduced-motion and prefers-color-scheme.
   ===================================================================== */

:root {
  /* Brand tokens (mirror the inline critical CSS, with safe fallbacks) */
  --cd-orange: var(--primary-orange, #FF6600);
  --cd-orange-light: var(--primary-orange-light, #FF9944);
  --cd-orange-dark: var(--primary-orange-dark, #CC5500);
  --cd-blue: var(--dutch-blue, #0066CC);
  --cd-blue-dark: var(--dutch-blue-dark, #003D7A);
  --cd-ink: var(--neutral-900, #1A1A1A);
  --cd-muted: #5b6470;

  /* Refined surfaces & shadows */
  --cd-surface: #ffffff;
  --cd-surface-2: #f7f8fa;
  --cd-border: rgba(20, 24, 33, 0.08);
  --cd-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --cd-shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .08);
  --cd-shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --cd-shadow-brand: 0 10px 30px -8px rgba(255, 102, 0, .45);

  --cd-radius: 16px;
  --cd-radius-sm: 12px;
  --cd-ease: cubic-bezier(.22, 1, .36, .58);
  --cd-gradient: linear-gradient(135deg, var(--cd-orange) 0%, var(--cd-orange-dark) 100%);
  --cd-gradient-blue: linear-gradient(135deg, var(--cd-blue) 0%, var(--cd-blue-dark) 100%);
}

/* ---- Global polish ------------------------------------------------ */
html { scroll-behavior: smooth; }

/* Offset anchored sections for the fixed header */
section[id] { scroll-margin-top: 90px; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Accessible, visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.filter-btn:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--cd-blue);
  outline-offset: 2px;
  border-radius: 8px;
}

::selection { background: var(--cd-orange-light); color: #fff; }

/* ---- Section headers --------------------------------------------- */
.section-title {
  position: relative;
  letter-spacing: -0.02em;
}
.section-header { margin-bottom: clamp(1.75rem, 1rem + 3vw, 3rem); }
.section-header .section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 0.85rem auto 0;
  border-radius: 999px;
  background: var(--cd-gradient);
}
.section-subtitle { color: var(--cd-muted); }

/* ---- Buttons ------------------------------------------------------ */
.btn {
  transition: transform .25s var(--cd-ease), box-shadow .25s var(--cd-ease), filter .2s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--whatsapp {
  box-shadow: 0 8px 22px -8px rgba(37, 211, 102, .6);
}
.btn--whatsapp:hover { filter: saturate(1.08) brightness(1.03); }

.btn--secondary:hover { box-shadow: var(--cd-shadow-md); }

/* keep the existing pulse but make it calmer */
.btn--pulse { animation-duration: 2.4s; }

/* ---- Service filter chips ---------------------------------------- */
.service-filter { gap: 0.6rem; }
.filter-btn {
  border-radius: 999px;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s var(--cd-ease);
}
.filter-btn:hover { transform: translateY(-1px); }
.filter-btn--active {
  background: var(--cd-gradient);
  color: #fff;
  box-shadow: var(--cd-shadow-brand);
}

/* ---- Service cards ------------------------------------------------ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1rem, 0.6rem + 1.5vw, 1.75rem);
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  box-shadow: var(--cd-shadow-sm);
  overflow: hidden;
  transition: transform .35s var(--cd-ease), box-shadow .35s var(--cd-ease), border-color .25s ease;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--cd-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--cd-ease);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--cd-shadow-lg);
  border-color: rgba(255, 102, 0, .25);
}
.service-card:hover::before { transform: scaleX(1); }

.service-card--popular {
  border-color: rgba(255, 102, 0, .35);
  box-shadow: 0 10px 30px -14px rgba(255, 102, 0, .55);
}

.service-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--cd-gradient);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 999px;
  box-shadow: var(--cd-shadow-brand);
}

.service-card__icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 1rem;
  color: var(--cd-orange);
  background: linear-gradient(135deg, rgba(255, 102, 0, .12), rgba(255, 153, 68, .08));
  transition: transform .35s var(--cd-ease);
}
.service-card:hover .service-card__icon { transform: scale(1.06) rotate(-3deg); }
.service-card__icon .service-icon { width: 32px; height: 32px; fill: currentColor; }

.service-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .4rem;
}
.service-card__description { color: var(--cd-muted); line-height: 1.55; }

.service-card__features {
  list-style: none;
  padding: 0;
  margin: .9rem 0 0;
  display: grid;
  gap: .45rem;
}
.service-card__features li {
  position: relative;
  padding-left: 1.5rem;
  font-size: .92rem;
  color: var(--cd-ink);
}
.service-card__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 166, 80, .15);
  box-shadow: inset 0 0 0 2px rgba(0, 166, 80, .55);
}
.service-card__features li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: .42em;
  width: 6px;
  height: 3px;
  border-left: 2px solid #00A650;
  border-bottom: 2px solid #00A650;
  transform: rotate(-45deg);
}

.service-card__footer {
  margin-top: auto;
  padding-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.service-card__price { display: flex; flex-direction: column; line-height: 1.1; }
.service-card__price-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--cd-muted);
}
.service-card__price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cd-ink);
}

/* Staggered entrance for freshly rendered cards */
@keyframes cdCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.services-grid .service-card {
  animation: cdCardIn .5s var(--cd-ease) both;
}
.services-grid .service-card:nth-child(2)  { animation-delay: .04s; }
.services-grid .service-card:nth-child(3)  { animation-delay: .08s; }
.services-grid .service-card:nth-child(4)  { animation-delay: .12s; }
.services-grid .service-card:nth-child(5)  { animation-delay: .16s; }
.services-grid .service-card:nth-child(6)  { animation-delay: .20s; }
.services-grid .service-card:nth-child(n+7){ animation-delay: .24s; }

/* ---- Process timeline -------------------------------------------- */
.process-step { transition: transform .3s var(--cd-ease); }
.process-step:hover { transform: translateY(-4px); }
.process-step__icon {
  background: var(--cd-gradient-blue);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(0, 102, 204, .6);
}
.process-step__icon svg { fill: currentColor; }

/* ---- Trust indicators -------------------------------------------- */
.trust-indicator {
  backdrop-filter: blur(6px);
  transition: transform .25s var(--cd-ease);
}
.trust-indicator:hover { transform: translateY(-2px); }

/* ---- Gallery ------------------------------------------------------ */
.gallery-item {
  border-radius: var(--cd-radius-sm);
  overflow: hidden;
  box-shadow: var(--cd-shadow-sm);
  transition: transform .35s var(--cd-ease), box-shadow .35s var(--cd-ease);
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--cd-shadow-lg); }
.gallery-item__image img { transition: transform .5s var(--cd-ease); }
.gallery-item:hover .gallery-item__image img { transform: scale(1.06); }

/* ---- Testimonials / reviews -------------------------------------- */
.review-card,
.testimonial-card {
  border-radius: var(--cd-radius);
  box-shadow: var(--cd-shadow-sm);
  transition: transform .3s var(--cd-ease), box-shadow .3s var(--cd-ease);
}
.review-card:hover,
.testimonial-card:hover { transform: translateY(-4px); box-shadow: var(--cd-shadow-md); }

/* ---- Navigation --------------------------------------------------- */
.nav, .header, header.nav {
  transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.nav.scrolled, .header.scrolled, .is-scrolled {
  box-shadow: var(--cd-shadow-md);
  backdrop-filter: saturate(1.4) blur(10px);
}

/* ---- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .service-card:hover,
  .gallery-item:hover,
  .process-step:hover,
  .btn:hover { transform: none; }
}

/* ---- Dark mode (opt-in via OS preference) ------------------------ */
@media (prefers-color-scheme: dark) {
  :root {
    --cd-surface: #161a21;
    --cd-surface-2: #1d222b;
    --cd-border: rgba(255, 255, 255, .08);
    --cd-ink: #eef1f5;
    --cd-muted: #9aa4b2;
  }
  .service-card { background: var(--cd-surface); }
  .service-card__price-value { color: #fff; }
  .service-card__features li { color: var(--cd-ink); }
}

/* ---- Price calculator widget ------------------------------------- */
/* The widget is injected at runtime by price-calculator.js and ships
   without styling of its own — these rules give it a branded look. */
.calculator-container {
  display: flex;
  justify-content: center;
}
.price-calculator-widget {
  width: 100%;
  max-width: 640px;
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  box-shadow: var(--cd-shadow-md);
  overflow: hidden;
}
.calculator-header {
  background: var(--cd-gradient);
  color: #fff;
  padding: clamp(1.25rem, 1rem + 1.5vw, 1.9rem);
  text-align: center;
}
.calculator-header h3 {
  margin: 0 0 .35rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.calculator-header p { margin: 0; opacity: .92; }

.calculator-form { padding: clamp(1.25rem, 1rem + 1.5vw, 1.9rem); }
.calculator-form .form-group { margin-bottom: 1.1rem; }
.calculator-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 520px) {
  .calculator-form .form-row { grid-template-columns: 1fr; }
}
.calculator-form label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .92rem;
  color: var(--cd-ink);
}
.calculator-form select,
.calculator-form input[type="range"] {
  width: 100%;
}
.calculator-form select {
  appearance: none;
  -webkit-appearance: none;
  padding: .7rem .9rem;
  border: 1px solid var(--cd-border);
  border-radius: 10px;
  background: var(--cd-surface-2);
  color: var(--cd-ink);
  font: inherit;
  cursor: pointer;
  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 fill='%23FF6600' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
}
.calculator-form select:focus-visible {
  border-color: var(--cd-orange);
  outline: 3px solid rgba(255, 102, 0, .25);
  outline-offset: 1px;
}

/* Range slider */
.calculator-form input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cd-orange), var(--cd-orange-light));
  cursor: pointer;
}
.calculator-form input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cd-orange);
  box-shadow: var(--cd-shadow-sm);
}
.calculator-form input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cd-orange);
}
.duration-labels {
  display: flex;
  justify-content: space-between;
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--cd-muted);
}

/* Result breakdown */
.calculator-result {
  margin-top: 1.25rem;
  padding: 1.1rem;
  border-radius: var(--cd-radius-sm);
  background: var(--cd-surface-2);
  border: 1px solid var(--cd-border);
}
.result-line,
.result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  color: var(--cd-ink);
}
.result-line { font-size: .95rem; }
.result-line + .result-line { border-top: 1px dashed var(--cd-border); }
.result-total {
  margin-top: .35rem;
  padding-top: .8rem;
  border-top: 2px solid var(--cd-border);
  font-size: 1.15rem;
  font-weight: 800;
}
.result-total span:last-child { color: var(--cd-orange); font-size: 1.5rem; }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1.1rem;
}
@media (max-width: 520px) {
  .result-actions { grid-template-columns: 1fr; }
}
.result-actions .btn { justify-content: center; }
.result-disclaimer {
  margin-top: .8rem;
  text-align: center;
  color: var(--cd-muted);
}

@media (prefers-color-scheme: dark) {
  .price-calculator-widget { background: var(--cd-surface); }
  .calculator-form select { background-color: #11151b; }
}
