/* ═══════════════════════════════════════════════════════════════
   Wales Cottage Search — wcs-style.css v2.4.0
   Mobile-first stacked layout. 3-col grid at 960px+.
   All input fields identical in height, style and shape.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --wcs-red: #C8102E;
  --wcs-red-hover: #A00D24;
  --wcs-red-light: #FEF2F4;
  --wcs-dark: #1A1A2E;
  --wcs-text: #2D2D3F;
  --wcs-text-mid: #5A5A72;
  --wcs-text-light: #8E8EA0;
  --wcs-bg: #FFFFFF;
  --wcs-surface: #F7F7FA;
  --wcs-border: #E4E4EC;
  --wcs-border-focus: #C8102E;
  --wcs-green: #0B8457;
  --wcs-amber: #D97706;
  --wcs-amber-light: #FFF8EB;
  --wcs-radius: 12px;
  --wcs-radius-sm: 8px;
  --wcs-radius-pill: 100px;
  --wcs-shadow-lg: 0 4px 6px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.08);
  --wcs-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --wcs-input-h: 48px;
}

.wcs-section *, .wcs-section *::before, .wcs-section *::after { box-sizing: border-box; }
.wcs-section {
  font-family: var(--wcs-font); color: var(--wcs-text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

.wcs-widget { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.wcs-card {
  background: var(--wcs-bg); border-radius: 20px;
  box-shadow: var(--wcs-shadow-lg); overflow: visible; position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.wcs-header { padding: 28px 28px 0; text-align: center; }
.wcs-headline {
  font-family: var(--wcs-font); font-size: 24px; font-weight: 700;
  color: var(--wcs-dark); letter-spacing: -0.3px; line-height: 1.2; margin: 0 0 6px;
}
.wcs-headline-accent { color: var(--wcs-red); }
.wcs-subline { font-size: 15px; color: var(--wcs-text-mid); margin: 0 0 14px; font-weight: 400; }
.wcs-urgency {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wcs-amber-light); color: var(--wcs-amber);
  font-size: 13px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--wcs-radius-pill); margin-bottom: 8px;
}
.wcs-urgency-dot {
  width: 6px; height: 6px; background: var(--wcs-amber);
  border-radius: 50%; animation: wcs-pulse 2s ease-in-out infinite;
}
@keyframes wcs-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ═══════════════════════════════════════════════════════════════
   CHIPS
   ═══════════════════════════════════════════════════════════════ */
.wcs-chips-wrap {
  padding: 14px 28px 0; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.wcs-chips-wrap::-webkit-scrollbar { display: none; }
.wcs-chips {
  display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-start;
  list-style: none; margin: 0; padding: 0 0 4px; min-width: max-content;
}
.wcs-chip {
  display: inline-flex; align-items: center; padding: 8px 16px;
  font-family: var(--wcs-font); font-size: 13.5px; font-weight: 500;
  color: var(--wcs-text-mid); background: var(--wcs-surface);
  border: 1.5px solid transparent; border-radius: var(--wcs-radius-pill);
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
  line-height: 1.3; flex-shrink: 0;
}
.wcs-chip:hover { color: var(--wcs-text); border-color: var(--wcs-border); background: #fff; }
.wcs-chip.active { background: var(--wcs-red); color: #fff; border-color: var(--wcs-red); }

/* ═══════════════════════════════════════════════════════════════
   FORM — stacked by default (mobile + narrow containers)
   ═══════════════════════════════════════════════════════════════ */
.wcs-body { padding: 18px 28px 0; }
.wcs-input-row {
  display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px;
}
.wcs-field-group { display: flex; flex-direction: column; gap: 5px; }
.wcs-field-label {
  font-size: 11.5px; font-weight: 600; color: var(--wcs-text-light);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Unified input — ALL fields use this ───────────────────── */
.wcs-input {
  height: var(--wcs-input-h); padding: 0 14px;
  font-family: var(--wcs-font); font-size: 15px; color: var(--wcs-text);
  background: var(--wcs-surface); border: 1.5px solid var(--wcs-border);
  border-radius: var(--wcs-radius-sm); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%; -webkit-appearance: none; appearance: none;
}
.wcs-input:focus { border-color: var(--wcs-border-focus); box-shadow: 0 0 0 3px rgba(200,16,46,0.08); }
.wcs-input::placeholder { color: var(--wcs-text-light); }
select.wcs-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238E8EA0' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}

/* ── Stepper (adults/children) — input box with ± buttons ─── */
.wcs-stepper {
  display: flex; align-items: center; gap: 0;
  height: var(--wcs-input-h);
  background: var(--wcs-surface); border: 1.5px solid var(--wcs-border);
  border-radius: var(--wcs-radius-sm); overflow: hidden;
}
.wcs-stepper .wcs-rnd {
  width: 44px; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--wcs-font); font-size: 20px; font-weight: 500;
  color: var(--wcs-text-mid); background: transparent; border: none;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
  line-height: 1; padding: 0; border-radius: 0; flex-shrink: 0;
}
.wcs-stepper .wcs-rnd:hover { background: var(--wcs-red-light); color: var(--wcs-red); }
.wcs-stepper .wcs-rnd:first-child { border-right: 1px solid var(--wcs-border); }
.wcs-stepper .wcs-rnd:last-child { border-left: 1px solid var(--wcs-border); }
.wcs-stepper .wcs-n {
  flex: 1; text-align: center; font-size: 16px; font-weight: 600;
  color: var(--wcs-text); background: none; border: none;
  font-family: var(--wcs-font); padding: 0; height: 100%;
  /* Override .wcs-input styles inherited from the class */
  border-radius: 0;
}

/* ── Autocomplete ──────────────────────────────────────────── */
.wcs-autocomplete { position: relative; }
.wcs-autocomplete-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: none; align-items: center; justify-content: center;
  font-size: 20px; color: var(--wcs-text-light); background: none; border: none;
  cursor: pointer; border-radius: 50%; line-height: 1; font-family: var(--wcs-font);
}
.wcs-autocomplete-clear.visible { display: flex; }
.wcs-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 280px; overflow-y: auto; background: var(--wcs-bg);
  border: 1px solid var(--wcs-border); border-radius: var(--wcs-radius-sm);
  box-shadow: var(--wcs-shadow-lg); z-index: 100;
}
.wcs-dropdown.open { display: block; }
.wcs-dropdown-group-label {
  padding: 8px 14px 4px; font-size: 11px; font-weight: 600;
  color: var(--wcs-text-light); text-transform: uppercase; letter-spacing: 0.4px;
}
.wcs-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 14px; color: var(--wcs-text);
  cursor: pointer; transition: background 0.1s;
}
.wcs-dropdown-item:hover, .wcs-dropdown-item.highlighted { background: var(--wcs-surface); }
.wcs-item-icon { width: 16px; height: 16px; flex-shrink: 0; }
.wcs-item-icon svg { width: 16px; height: 16px; fill: var(--wcs-text-light); }
.wcs-dropdown-match { font-weight: 700; color: var(--wcs-red); }
.wcs-no-results { padding: 16px 14px; font-size: 14px; color: var(--wcs-text-light); text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   FILTERS TOGGLE
   ═══════════════════════════════════════════════════════════════ */
.wcs-filters-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--wcs-font); font-size: 13.5px; font-weight: 600;
  color: var(--wcs-red); background: none; border: none;
  cursor: pointer; padding: 6px 0; margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}
.wcs-filters-toggle svg { width: 16px; height: 16px; fill: var(--wcs-red); transition: transform 0.2s ease; }
.wcs-filters-toggle.open svg { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════════════════════
   EXPANDABLE FILTERS
   ═══════════════════════════════════════════════════════════════ */
.wcs-extra { display: none; padding-bottom: 8px; }
.wcs-extra.open { display: block; }
.wcs-filter-sections { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }
.wcs-filter-section-label {
  font-size: 12px; font-weight: 600; color: var(--wcs-text-light);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px;
}

.wcs-pills, .wcs-bedrooms-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wcs-pill {
  padding: 8px 16px; font-family: var(--wcs-font); font-size: 14px; font-weight: 500;
  color: var(--wcs-text-mid); background: var(--wcs-surface);
  border: 1.5px solid var(--wcs-border); border-radius: var(--wcs-radius-pill);
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent; line-height: 1.3;
}
.wcs-pill:hover { border-color: var(--wcs-red); color: var(--wcs-text); }
.wcs-pill.active { background: var(--wcs-red); color: #fff; border-color: var(--wcs-red); }

.wcs-price-row { display: flex; gap: 10px; align-items: center; }
.wcs-price-input {
  flex: 1; height: 44px; padding: 0 14px;
  font-family: var(--wcs-font); font-size: 14px; color: var(--wcs-text);
  background: var(--wcs-surface); border: 1.5px solid var(--wcs-border);
  border-radius: var(--wcs-radius-sm); outline: none; width: 100%; -webkit-appearance: none;
}
.wcs-price-input:focus { border-color: var(--wcs-border-focus); }
.wcs-price-dash { color: var(--wcs-text-light); font-size: 16px; flex-shrink: 0; }
.wcs-price-input::-webkit-outer-spin-button,
.wcs-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wcs-price-input[type=number] { -moz-appearance: textfield; }

/* ── Features ──────────────────────────────────────────────── */
.wcs-features-label {
  font-size: 12px; font-weight: 600; color: var(--wcs-text-light);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 10px;
}
.wcs-features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.wcs-feature {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--wcs-surface);
  border: 1.5px solid transparent; border-radius: var(--wcs-radius-sm);
  cursor: pointer; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none; position: relative;
}
.wcs-feature:hover { border-color: var(--wcs-border); }
.wcs-feature input { position: absolute; opacity: 0; width: 0; height: 0; }
.wcs-feature-check {
  width: 20px; height: 20px; border: 2px solid var(--wcs-border);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.wcs-feature-check svg {
  width: 12px; height: 12px; fill: none; stroke: #fff;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.5); transition: all 0.15s;
}
.wcs-feature-text { font-size: 14px; font-weight: 500; color: var(--wcs-text); line-height: 1.2; }

.wcs-feature.checked, .wcs-feature:has(input:checked) { background: var(--wcs-red-light); border-color: var(--wcs-red); }
.wcs-feature.checked .wcs-feature-check, .wcs-feature:has(input:checked) .wcs-feature-check { background: var(--wcs-red); border-color: var(--wcs-red); }
.wcs-feature.checked .wcs-feature-check svg, .wcs-feature:has(input:checked) .wcs-feature-check svg { opacity: 1; transform: scale(1); }
.wcs-feature.checked .wcs-feature-text, .wcs-feature:has(input:checked) .wcs-feature-text { color: var(--wcs-red-hover); }

/* ═══════════════════════════════════════════════════════════════
   BOTTOM BAR
   ═══════════════════════════════════════════════════════════════ */
.wcs-bottom {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 28px 24px; gap: 14px;
}
.wcs-bottom-left {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px;
}
.wcs-trust-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500; color: var(--wcs-text-mid); white-space: nowrap;
}
.wcs-trust-item svg { width: 15px; height: 15px; flex-shrink: 0; fill: var(--wcs-text-mid); }
.wcs-trust-item:first-child svg { fill: var(--wcs-green); }
.wcs-trust-stars { display: flex; gap: 1px; }
.wcs-trust-stars svg { width: 14px; height: 14px; fill: #F59E0B; }

.wcs-search-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px;
  font-family: var(--wcs-font); font-size: 16px; font-weight: 600;
  color: #fff; background: var(--wcs-red); border: none;
  border-radius: var(--wcs-radius); cursor: pointer; transition: all 0.2s ease;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(200,16,46,0.25);
}
.wcs-search-btn:hover { background: var(--wcs-red-hover); box-shadow: 0 4px 16px rgba(200,16,46,0.35); transform: translateY(-1px); }
.wcs-search-btn:active { transform: translateY(0); }
.wcs-search-btn svg { width: 20px; height: 20px; fill: #fff; }
@keyframes wcs-btn-pulse {
  0% { box-shadow: 0 2px 8px rgba(200,16,46,0.25); }
  50% { box-shadow: 0 2px 20px rgba(200,16,46,0.5); }
  100% { box-shadow: 0 2px 8px rgba(200,16,46,0.25); }
}
.wcs-search-btn.pulse { animation: wcs-btn-pulse 0.6s ease; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE STICKY
   ═══════════════════════════════════════════════════════════════ */
.wcs-mobile-sticky {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--wcs-bg); border-top: 1px solid var(--wcs-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1); padding: 10px 16px;
  transform: translateY(100%); transition: transform 0.3s ease;
  -webkit-backface-visibility: hidden !important; 
  backface-visibility: hidden !important;
}
.wcs-mobile-sticky.visible { transform: translateY(0); }
.wcs-sticky-inner { display: flex; align-items: center; gap: 12px; max-width: 600px; margin: 0 auto; }
.wcs-sticky-text { flex: 1; min-width: 0; }
.wcs-sticky-title { font-family: var(--wcs-font); font-size: 14px; font-weight: 600; color: var(--wcs-dark); }
.wcs-sticky-sub { font-family: var(--wcs-font); font-size: 12px; color: var(--wcs-text-mid); }
.wcs-mobile-sticky-btn {
  height: 42px; padding: 0 20px;
  font-family: var(--wcs-font); font-size: 14px; font-weight: 600;
  color: #fff; background: var(--wcs-red); border: none;
  border-radius: var(--wcs-radius-sm); cursor: pointer;
  white-space: nowrap; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   WIDE LAYOUT — 960px+ viewport
   3-column grid: row 1 = where / check-in / duration
                  row 2 = adults / children / (empty or absorbed)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
  .wcs-header { padding: 28px 32px 0; }
  .wcs-headline { font-size: 26px; }
  .wcs-chips-wrap { padding: 16px 32px 0; overflow: visible; }
  .wcs-chips { flex-wrap: wrap; justify-content: center; }
  .wcs-body { padding: 20px 32px 0; }

  .wcs-input-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
  }

  .wcs-filter-sections { grid-template-columns: 1fr 1fr 1fr; }
  .wcs-features-grid { grid-template-columns: repeat(4, 1fr); }

  .wcs-bottom {
    flex-direction: row; justify-content: space-between; padding: 18px 32px 24px;
  }
  .wcs-search-btn { width: auto; padding: 0 36px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE TWEAKS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .wcs-mobile-sticky { display: block; }
  .wcs-card { border-radius: 16px; }
  .wcs-widget { padding: 0 12px; }
  .wcs-header { padding: 20px 20px 0; }
  .wcs-chips-wrap { padding: 12px 20px 0; }
  .wcs-body { padding: 16px 20px 0; }
  .wcs-bottom { padding: 16px 20px 20px; }
}

@media (max-width: 400px) {
  .wcs-headline { font-size: 19px; }
  .wcs-urgency { font-size: 12px; padding: 5px 12px; }
  .wcs-features-grid { grid-template-columns: 1fr; }
  .wcs-header { padding: 16px 16px 0; }
  .wcs-body { padding: 12px 16px 0; }
  .wcs-bottom { padding: 12px 16px 16px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .wcs-mobile-sticky { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════════════
   THEME CONFLICT OVERRIDES (MASTER FIX)
   ═══════════════════════════════════════════════════════════════ */

/* 1. Force the grid to maintain 3 columns on desktop */
.wcs-section .wcs-input-row {
  display: grid !important;
}

/* 2. Fix the shattered Adult/Children stepper buttons */
.wcs-section .wcs-stepper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}
.wcs-section .wcs-stepper button.wcs-rnd {
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 100% !important;
  flex: 0 0 44px !important;
  box-sizing: border-box !important;
  float: none !important;
}
.wcs-section .wcs-stepper input.wcs-n {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* 3. Strip theme margins off standard inputs */
.wcs-section .wcs-input {
  margin: 0 !important;
  max-width: 100% !important;
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP ONLY FIXES
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
  .wcs-section .wcs-input-row {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  
  /* Desktop Region Chips Spillage fix */
  .wcs-section .wcs-chips-wrap {
    overflow: hidden !important; 
  }
  .wcs-section .wcs-chips {
    flex-wrap: wrap !important;
    justify-content: center !important;
    min-width: auto !important; 
    width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE ONLY FIXES (Clipping, Scroll Bugs & Viator Badge)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 959px) {
  /* Provide mobile scroll clearance for the Viator badge & strip theme clipping */
  .wcs-section {
    padding-bottom: 75px !important;
    overflow: visible !important;
    contain: none !important; 
  }
  .wcs-section .wcs-widget, 
  .wcs-section .wcs-card {
    overflow: visible !important;
    contain: none !important;
  }
  
  /* Add structural padding to the bottom of the card */
  .wcs-section .wcs-card {
    padding-bottom: 20px !important; 
  }
  
  /* Force the button to maintain its height */
  .wcs-section .wcs-search-btn {
    height: 54px !important;
    min-height: 54px !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
  }
  
  /* Region Chips scroll and squish fix */
  .wcs-section .wcs-chip {
    flex-shrink: 0 !important; 
    white-space: nowrap !important;
  }
  .wcs-section .wcs-chips {
    padding-right: 0 !important;
  }
  
  /* Force the browser to render the right-side gap */
  .wcs-section .wcs-chip:last-child {
    margin-right: 32px !important; 
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE STICKY THEME OVERRIDES (Block fading & glitching)
   ═══════════════════════════════════════════════════════════════ */

/* 1. Force the background to stay solid white and block opacity fading */
.wcs-mobile-sticky {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  opacity: 1 !important;
  -webkit-opacity: 1 !important;
  visibility: visible !important;
  transition: transform 0.3s ease !important; /* Overrides theme fade transitions */
}

/* 2. Lock the sticky bar to the bottom of the screen when active */
.wcs-mobile-sticky.visible {
  transform: translateY(0) !important;
  bottom: 0 !important;
  opacity: 1 !important;
  background: #FFFFFF !important;
}