/* =============================================================================
   InmovillaToWordPress — Frontend CSS
   Diseño inspirado en Homez Real Estate Theme
   ============================================================================= */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --itwp-primary:     #1B3C73;
  --itwp-primary-d:   #152d5a;
  --itwp-accent:      #3B82F6;
  --itwp-accent-d:    #2563EB;
  --itwp-rent:        #10B981;
  --itwp-sale:        #F59E0B;
  --itwp-text:        #1a1a2e;
  --itwp-text-muted:  #6B7280;
  --itwp-border:      #E5E7EB;
  --itwp-bg:          #F8F9FB;
  --itwp-white:       #ffffff;
  --itwp-shadow:      0 2px 12px rgba(0,0,0,.08);
  --itwp-shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --itwp-radius:      12px;
  --itwp-radius-sm:   8px;
  --itwp-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --itwp-transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
.itwp-catalog *, .itwp-card *, .itwp-search-bar *,
.itwp-grid *, .itwp-single * { box-sizing: border-box; }

/* =============================================================================
   PROPERTY CARD
   ============================================================================= */
.itwp-card {
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  overflow: hidden;
  box-shadow: var(--itwp-shadow);
  transition: transform var(--itwp-transition), box-shadow var(--itwp-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.itwp-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--itwp-shadow-lg);
}

/* Image wrapper */
.itwp-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: #e8edf2;
  flex-shrink: 0;
}

.itwp-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
  display: block;
}

.itwp-card:hover .itwp-card__image img {
  transform: scale(1.06);
}

/* Price badge — bottom left of image */
.itwp-card__price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--itwp-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  letter-spacing: -0.2px;
  line-height: 1.3;
  z-index: 2;
}

/* Featured badge — top left */
.itwp-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 2;
}
.itwp-badge-featured {
  background: #F59E0B;
  color: #fff;
}

/* Status badge — top right */
.itwp-card__status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}
.itwp-badge-sale { background: #FEF3C7; color: #92400E; }
.itwp-badge-rent { background: #D1FAE5; color: #065F46; }

/* Quick actions (download etc.) — appear on hover */
.itwp-card__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity var(--itwp-transition), transform var(--itwp-transition);
  z-index: 3;
}
.itwp-card__status ~ .itwp-card__actions { top: 44px; }
.itwp-card:hover .itwp-card__actions {
  opacity: 1;
  transform: translateX(0);
}
.itwp-card__action-btn {
  width: 34px;
  height: 34px;
  background: var(--itwp-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--itwp-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: background var(--itwp-transition), color var(--itwp-transition);
  text-decoration: none;
}
.itwp-card__action-btn:hover {
  background: var(--itwp-primary);
  color: #fff;
}

/* Card body */
.itwp-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.itwp-card__type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--itwp-accent);
  display: block;
}

.itwp-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.itwp-card__title a {
  color: var(--itwp-text);
  text-decoration: none;
  transition: color var(--itwp-transition);
}
.itwp-card__title a:hover { color: var(--itwp-accent); }

.itwp-card__address {
  font-size: 12.5px;
  color: var(--itwp-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.itwp-card__address svg { flex-shrink: 0; color: var(--itwp-accent); }

/* Features row */
.itwp-card__features {
  display: flex;
  gap: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--itwp-border);
}
.itwp-card__feat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--itwp-text-muted);
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid var(--itwp-border);
  flex-shrink: 0;
}
.itwp-card__feat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.itwp-card__feat strong { color: var(--itwp-text); }
.itwp-card__feat svg { color: var(--itwp-accent); flex-shrink: 0; }

.itwp-card__ref {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 4px;
}

/* List view card */
.itwp-grid.itwp-view-list .itwp-card {
  flex-direction: row;
  max-height: 180px;
}
.itwp-grid.itwp-view-list .itwp-card__image {
  width: 280px;
  min-width: 280px;
  aspect-ratio: auto;
  height: 180px;
}
.itwp-grid.itwp-view-list .itwp-card__body {
  padding: 16px 20px;
}
.itwp-grid.itwp-view-list .itwp-card__title { font-size: 15px; }

/* =============================================================================
   GRID SYSTEM
   ============================================================================= */
.itwp-grid {
  display: grid;
  gap: 24px;
}
.itwp-cols-1 { grid-template-columns: 1fr; }
.itwp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.itwp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.itwp-cols-4 { grid-template-columns: repeat(4, 1fr); }
.itwp-view-list { grid-template-columns: 1fr !important; }

.itwp-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--itwp-text-muted);
}
.itwp-no-results svg { display: block; margin: 0 auto 16px; opacity: .3; }
.itwp-no-results p { font-size: 15px; }

/* =============================================================================
   CATALOG LAYOUT (Sidebar + Main)
   ============================================================================= */
.itwp-catalog {
  display: grid;
  gap: 28px;
  font-family: var(--itwp-font);
  position: relative;
}
.itwp-sidebar-left  { grid-template-columns: 280px 1fr; }
.itwp-sidebar-right { grid-template-columns: 1fr 280px; }
.itwp-sidebar-none  { grid-template-columns: 1fr; }
.itwp-sidebar-right .itwp-sidebar { order: 2; }

/* ── SIDEBAR ──────────────────────────────────────────────────────────────── */
.itwp-sidebar { position: relative; }

.itwp-sidebar__inner {
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow);
  padding: 24px;
  position: sticky;
  top: 20px;
}

.itwp-sidebar__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--itwp-text);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--itwp-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.itwp-sidebar__title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--itwp-accent);
  border-radius: 2px;
}

/* Filter groups */
.itwp-filter__group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--itwp-border);
}
.itwp-filter__group:last-of-type { border-bottom: none; margin-bottom: 0; }

.itwp-filter__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--itwp-text);
  margin-bottom: 10px;
}

/* Pill buttons */
.itwp-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.itwp-pill {
  padding: 5px 13px;
  border: 1.5px solid var(--itwp-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--itwp-text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--itwp-transition);
  line-height: 1.4;
}
.itwp-pill:hover { border-color: var(--itwp-accent); color: var(--itwp-accent); }
.itwp-pill.active {
  background: var(--itwp-primary);
  border-color: var(--itwp-primary);
  color: #fff;
}
.itwp-pill-sm { font-size: 11px; padding: 4px 10px; }

/* Select */
.itwp-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--itwp-border);
  border-radius: var(--itwp-radius-sm);
  font-size: 13px;
  color: var(--itwp-text);
  background: var(--itwp-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color var(--itwp-transition);
}
.itwp-select:focus { outline: none; border-color: var(--itwp-accent); }
.itwp-select-sm { width: auto; min-width: 160px; padding: 7px 32px 7px 10px; font-size: 12.5px; }

/* Input */
.itwp-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--itwp-border);
  border-radius: var(--itwp-radius-sm);
  font-size: 13px;
  color: var(--itwp-text);
  background: var(--itwp-white);
  transition: border-color var(--itwp-transition), box-shadow var(--itwp-transition);
}
.itwp-input:focus {
  outline: none;
  border-color: var(--itwp-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.itwp-input-sm { width: auto; min-width: 80px; font-size: 12px; padding: 7px 10px; }
.itwp-input::placeholder { color: #9CA3AF; }

/* Range row */
.itwp-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.itwp-range-row span { color: var(--itwp-text-muted); font-size: 13px; }
.itwp-range-row .itwp-input-sm { flex: 1; min-width: 0; }

/* Price display */
.itwp-price-range-display {
  font-size: 11px;
  font-weight: normal;
  color: var(--itwp-accent);
}

/* Collapsible */
.itwp-filter__collapse-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--itwp-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.itwp-toggle-icon { transition: transform var(--itwp-transition); font-size: 10px; }
.itwp-filter__group--collapsed .itwp-toggle-icon { transform: rotate(-90deg); }
.itwp-filter__group--collapsible .itwp-filter__checkboxes {
  display: block;
  max-height: 200px;
  overflow-y: auto;
}
.itwp-filter__group--collapsed .itwp-filter__checkboxes { display: none; }

/* Checkboxes */
.itwp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--itwp-text-muted);
  cursor: pointer;
  padding: 4px 0;
}
.itwp-check input { accent-color: var(--itwp-accent); cursor: pointer; }
.itwp-check:hover { color: var(--itwp-text); }

/* Buttons */
.itwp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--itwp-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--itwp-transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.itwp-btn-primary {
  background: var(--itwp-primary);
  color: #fff;
  border-color: var(--itwp-primary);
}
.itwp-btn-primary:hover { background: var(--itwp-accent); border-color: var(--itwp-accent); color: #fff; }
.itwp-btn-ghost {
  background: transparent;
  color: var(--itwp-text-muted);
  border-color: var(--itwp-border);
}
.itwp-btn-ghost:hover { border-color: var(--itwp-text-muted); color: var(--itwp-text); }
.itwp-btn-full { width: 100%; margin-bottom: 6px; }
.itwp-btn-download {
  background: var(--itwp-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--itwp-radius-sm);
  text-decoration: none;
}
.itwp-btn-download:hover { background: var(--itwp-accent); color: #fff; }
.itwp-link-download { color: var(--itwp-accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* =============================================================================
   TOOLBAR
   ============================================================================= */
.itwp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--itwp-white);
  border-radius: var(--itwp-radius-sm);
  box-shadow: var(--itwp-shadow);
  gap: 12px;
  flex-wrap: wrap;
}

.itwp-toolbar__count {
  font-size: 13.5px;
  color: var(--itwp-text-muted);
  font-weight: 500;
}
.itwp-toolbar__count strong { color: var(--itwp-text); font-weight: 700; }

.itwp-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* View toggle */
.itwp-view-toggle {
  display: flex;
  border: 1.5px solid var(--itwp-border);
  border-radius: var(--itwp-radius-sm);
  overflow: hidden;
}
.itwp-view-btn {
  width: 36px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--itwp-text-muted);
  transition: all var(--itwp-transition);
}
.itwp-view-btn.active { background: var(--itwp-primary); color: #fff; }
.itwp-view-btn:hover:not(.active) { background: var(--itwp-bg); }

/* =============================================================================
   PAGINATION
   ============================================================================= */
.itwp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}
.itwp-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--itwp-border);
  background: var(--itwp-white);
  border-radius: var(--itwp-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--itwp-text-muted);
  cursor: pointer;
  transition: all var(--itwp-transition);
}
.itwp-page-btn:hover:not(:disabled) { border-color: var(--itwp-accent); color: var(--itwp-accent); }
.itwp-page-btn.active { background: var(--itwp-primary); border-color: var(--itwp-primary); color: #fff; }
.itwp-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* =============================================================================
   SEARCH BAR (Top Filter)
   ============================================================================= */
.itwp-search-bar {
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow-lg);
  padding: 24px;
  margin-bottom: 32px;
  font-family: var(--itwp-font);
}

/* Status tabs above search bar */
.itwp-search-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--itwp-border);
  padding-bottom: 0;
}
.itwp-search-tab {
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--itwp-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--itwp-transition);
}
.itwp-search-tab.active { color: var(--itwp-primary); border-bottom-color: var(--itwp-primary); }
.itwp-search-tab:hover:not(.active) { color: var(--itwp-text); }

.itwp-search-bar__form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.itwp-search-bar__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}
.itwp-search-bar__field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--itwp-text-muted);
}
.itwp-search-bar__field--keyword { flex: 2; min-width: 200px; }
.itwp-search-bar__field--price { min-width: 200px; }
.itwp-search-bar__field--btn { flex: 0 0 auto; min-width: auto; }
.itwp-search-bar__field--btn .itwp-btn { height: 100%; padding: 11px 24px; font-size: 14px; }

/* Advanced toggle */
.itwp-search-advanced-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--itwp-accent);
  cursor: pointer;
  padding: 8px 0;
  border: none;
  background: none;
  margin-top: 4px;
}
.itwp-search-advanced-panel {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--itwp-border);
}
.itwp-search-advanced-panel.open { display: grid; }

/* =============================================================================
   LOADING OVERLAY
   ============================================================================= */
.itwp-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.itwp-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--itwp-border);
  border-top-color: var(--itwp-primary);
  border-radius: 50%;
  animation: itwp-spin 0.7s linear infinite;
}
@keyframes itwp-spin { to { transform: rotate(360deg); } }

/* Grid skeleton cards while loading */
.itwp-card--skeleton {
  pointer-events: none;
}
.itwp-card--skeleton .itwp-card__image,
.itwp-card--skeleton .itwp-card__title,
.itwp-card--skeleton .itwp-card__address,
.itwp-card--skeleton .itwp-card__features {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: itwp-shimmer 1.4s infinite;
  border-radius: 4px;
}
.itwp-card--skeleton .itwp-card__image { height: 200px; }
.itwp-card--skeleton .itwp-card__title { height: 18px; width: 75%; }
.itwp-card--skeleton .itwp-card__address { height: 13px; width: 55%; }
.itwp-card--skeleton .itwp-card__features { height: 32px; margin-top: 12px; }
@keyframes itwp-shimmer { to { background-position: -200% 0; } }

/* =============================================================================
   SINGLE PROPERTY PAGE
   ============================================================================= */
.itwp-single {
  font-family: var(--itwp-font);
  color: var(--itwp-text);
}

/* Gallery */
.itwp-gallery {
  position: relative;
  border-radius: var(--itwp-radius);
  overflow: hidden;
  background: #e8edf2;
  margin-bottom: 28px;
}
.itwp-gallery__main {
  position: relative;
  aspect-ratio: 16/9;
  max-height: 520px;
}
.itwp-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.itwp-gallery__thumbs {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: rgba(0,0,0,.04);
  overflow-x: auto;
  scrollbar-width: thin;
}
.itwp-gallery__thumb {
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color var(--itwp-transition);
}
.itwp-gallery__thumb.active { border-color: var(--itwp-primary); }
.itwp-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Nav arrows */
.itwp-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--itwp-shadow);
  transition: all var(--itwp-transition);
  z-index: 2;
}
.itwp-gallery__nav:hover { background: var(--itwp-primary); color: #fff; }
.itwp-gallery__nav--prev { left: 14px; }
.itwp-gallery__nav--next { right: 14px; }

/* Photo counter badge */
.itwp-gallery__counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

/* Single header */
.itwp-single__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 24px 28px;
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow);
}
.itwp-single__header-left { flex: 1; min-width: 0; }
.itwp-single__header-right { text-align: right; flex-shrink: 0; }

.itwp-single__breadcrumb {
  font-size: 12px;
  color: var(--itwp-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.itwp-single__breadcrumb a { color: var(--itwp-accent); text-decoration: none; }

.itwp-single__title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--itwp-text);
}

.itwp-single__address {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  color: var(--itwp-text-muted);
}
.itwp-single__address svg { color: var(--itwp-accent); }

.itwp-single__price {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--itwp-primary);
  line-height: 1;
  margin-bottom: 8px;
}
.itwp-single__price-sub { font-size: 13px; color: var(--itwp-text-muted); }

.itwp-single__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Stats bar */
.itwp-single__stats {
  display: flex;
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow);
  overflow: hidden;
  margin-bottom: 28px;
}
.itwp-single__stat {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--itwp-border);
}
.itwp-single__stat:last-child { border-right: none; }
.itwp-single__stat-icon {
  width: 42px;
  height: 42px;
  background: #EFF6FF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--itwp-accent);
  flex-shrink: 0;
}
.itwp-single__stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--itwp-text);
  line-height: 1;
}
.itwp-single__stat-label {
  font-size: 11px;
  color: var(--itwp-text-muted);
  margin-top: 3px;
}

/* Tabs */
.itwp-single__tabs {
  display: flex;
  border-bottom: 2px solid var(--itwp-border);
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.itwp-single__tabs::-webkit-scrollbar { display: none; }
.itwp-single__tab {
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--itwp-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--itwp-transition);
}
.itwp-single__tab.active { color: var(--itwp-primary); border-bottom-color: var(--itwp-primary); }
.itwp-single__tab:hover:not(.active) { color: var(--itwp-text); }

.itwp-single__tab-panel { display: none; }
.itwp-single__tab-panel.active { display: block; }

/* Content section */
.itwp-single__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.itwp-section {
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.itwp-section__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--itwp-text);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--itwp-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.itwp-section__title svg { color: var(--itwp-accent); }

.itwp-single__description {
  font-size: 14.5px;
  line-height: 1.8;
  color: #4B5563;
}

/* Details table */
.itwp-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.itwp-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--itwp-border);
  font-size: 13.5px;
  gap: 10px;
}
.itwp-details-grid .itwp-detail-row:nth-last-child(-n+2) { border-bottom: none; }
.itwp-detail-row__label { color: var(--itwp-text-muted); }
.itwp-detail-row__value { font-weight: 600; color: var(--itwp-text); text-align: right; }

/* Features/amenities */
.itwp-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.itwp-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--itwp-text-muted);
  padding: 8px 12px;
  background: var(--itwp-bg);
  border-radius: var(--itwp-radius-sm);
}
.itwp-feature-item::before {
  content: '✓';
  color: var(--itwp-rent);
  font-weight: 700;
  font-size: 12px;
}

/* Energy certificate */
.itwp-energy-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.itwp-energy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.itwp-energy-label {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 11px;
}
.energy-A .itwp-energy-label, .energy-label-A { background: #00a651; }
.energy-B .itwp-energy-label, .energy-label-B { background: #4caf50; }
.energy-C .itwp-energy-label, .energy-label-C { background: #8bc34a; }
.energy-D .itwp-energy-label, .energy-label-D { background: #ffc107; color: #333; }
.energy-E .itwp-energy-label, .energy-label-E { background: #ff9800; }
.energy-F .itwp-energy-label, .energy-label-F { background: #f44336; }
.energy-G .itwp-energy-label, .energy-label-G { background: #b71c1c; }

/* SIDEBAR (single) */
.itwp-single__sidebar {}

/* Agent card */
.itwp-agent-card {
  background: var(--itwp-white);
  border-radius: var(--itwp-radius);
  box-shadow: var(--itwp-shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.itwp-agent-card__header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--itwp-border);
}
.itwp-agent-card__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.itwp-agent-card__name { font-size: 15px; font-weight: 700; color: var(--itwp-text); }
.itwp-agent-card__role { font-size: 12px; color: var(--itwp-text-muted); margin-top: 2px; }
.itwp-agent-card__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--itwp-text-muted);
  margin-bottom: 12px;
  text-decoration: none;
}
.itwp-agent-card__phone:hover { color: var(--itwp-primary); }

/* Contact form in sidebar */
.itwp-contact-form { display: flex; flex-direction: column; gap: 10px; }
.itwp-contact-form .itwp-input,
.itwp-contact-form textarea.itwp-input {
  width: 100%;
  font-size: 13px;
  padding: 9px 12px;
}
.itwp-contact-form textarea.itwp-input {
  resize: vertical;
  min-height: 90px;
}

/* Map */
.itwp-map-container {
  border-radius: var(--itwp-radius);
  overflow: hidden;
  background: #e8edf2;
  aspect-ratio: 16/9;
  margin-bottom: 20px;
}
.itwp-map-container iframe { width: 100%; height: 100%; border: none; display: block; }

/* Download section */
.itwp-download-section {
  background: linear-gradient(135deg, var(--itwp-primary), var(--itwp-accent));
  border-radius: var(--itwp-radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  color: #fff;
  text-align: center;
}
.itwp-download-section p {
  font-size: 13px;
  opacity: .85;
  margin-bottom: 14px;
  line-height: 1.5;
}
.itwp-download-section .itwp-btn {
  background: #fff;
  color: var(--itwp-primary);
  font-weight: 700;
}
.itwp-download-section .itwp-btn:hover { background: #F0F9FF; }

/* =============================================================================
   NOTICES
   ============================================================================= */
.itwp-notice {
  padding: 12px 16px;
  border-radius: var(--itwp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.itwp-notice--success { background: #D1FAE5; color: #065F46; }
.itwp-notice--error   { background: #FEE2E2; color: #991B1B; }
.itwp-notice--warning { background: #FEF3C7; color: #92400E; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1100px) {
  .itwp-sidebar-left,
  .itwp-sidebar-right { grid-template-columns: 250px 1fr; }
  .itwp-single__layout { grid-template-columns: 1fr 280px; }
}

@media (max-width: 900px) {
  .itwp-sidebar-left,
  .itwp-sidebar-right { grid-template-columns: 1fr; }
  .itwp-sidebar { position: static; }
  .itwp-sidebar__inner { position: static; }
  .itwp-sidebar-right .itwp-sidebar { order: 0; }
  .itwp-sidebar--mobile-hidden { display: none; }

  .itwp-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .itwp-cols-4 { grid-template-columns: repeat(2, 1fr); }

  .itwp-single__layout { grid-template-columns: 1fr; }
  .itwp-single__stats { flex-wrap: wrap; }
  .itwp-single__stat { min-width: 50%; }
  .itwp-single__stat:nth-child(even) { border-right: none; }

  .itwp-search-bar__form { flex-direction: column; }
  .itwp-search-bar__field { min-width: 100%; }
}

@media (max-width: 600px) {
  .itwp-cols-2,
  .itwp-cols-3,
  .itwp-cols-4 { grid-template-columns: 1fr; }

  .itwp-grid.itwp-view-list .itwp-card { flex-direction: column; max-height: none; }
  .itwp-grid.itwp-view-list .itwp-card__image { width: 100%; height: auto; aspect-ratio: 16/10; }

  .itwp-toolbar { flex-direction: column; align-items: stretch; }
  .itwp-toolbar__controls { justify-content: space-between; }

  .itwp-single__header { flex-direction: column; }
  .itwp-single__header-right { text-align: left; }
  .itwp-single__badges { justify-content: flex-start; }

  .itwp-details-grid { grid-template-columns: 1fr; }

  .itwp-pagination { flex-wrap: wrap; }
}

/* =============================================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================================= */
.itwp-sidebar-toggle {
  display: none;
  width: 100%;
  padding: 11px 16px;
  margin-bottom: 16px;
  background: var(--itwp-white);
  border: 1.5px solid var(--itwp-border);
  border-radius: var(--itwp-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--itwp-text);
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--itwp-shadow);
}
@media (max-width: 900px) { .itwp-sidebar-toggle { display: flex; } }

/* No-image placeholder for cards */
.itwp-card__no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: #e8edf2;
  color: #9CA3AF;
  font-size: 48px;
}
