/*
Theme Name: Rehome
Theme URI: https://rehome.co.ke/
Author: Rehome
Author URI: https://rehome.co.ke/
Description: A professional Kenyan online marketplace for buying and selling pre-owned and new items. Modern, fast, and designed for Kenyan users.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: Proprietary
License URI: https://rehome.co.ke/
Text Domain: rehome
Tags: marketplace, listing, classifieds, kenya, e-commerce
*/

/* ============================================================
   REHOME DESIGN TOKENS — CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* ── Brand Palette ── */
  --rehome-primary:          #DDA15E;
  --rehome-primary-hover:    #E8B575;
  --rehome-primary-active:   #EFC090;
  --rehome-primary-soft:     rgba(221, 161, 94, 0.12);
  --rehome-dark:             #283618;
  --rehome-secondary:        #A3A86B;
  --rehome-secondary-light:  #C5CA8E;
  --rehome-accent:           #BC6C25;

  /* ── Default Surfaces (Dark Mode) ── */
  --rehome-background:       #161814;
  --rehome-surface:          #1F221B;
  --rehome-surface-elevated: #272B23;
  --rehome-surface-alt:      #2E332A;

  /* ── Default Text (Dark Mode) ── */
  --rehome-text:             #F4F3EE;
  --rehome-text-muted:       #A2A79B;
  --rehome-text-subtle:      #70756A;

  /* ── Default Borders (Dark Mode) ── */
  --rehome-border:           #2F3429;
  --rehome-border-strong:    #42483B;

  /* ── State Colors (Dark Mode) ── */
  --rehome-success:          #7BA05B;
  --rehome-success-soft:     rgba(123, 160, 91, 0.12);
  --rehome-warning:          #D49A55;
  --rehome-warning-soft:     rgba(212, 154, 85, 0.12);
  --rehome-error:            #C95A5A;
  --rehome-error-soft:       rgba(201, 90, 90, 0.12);
  --rehome-info:             #6B8796;
  --rehome-info-soft:        rgba(107, 135, 150, 0.12);

  /* ── Status Colors (Dark Mode) ── */
  --rehome-available:        #7BA05B;
  --rehome-available-soft:   rgba(123, 160, 91, 0.12);
  --rehome-sold:             #C95A5A;
  --rehome-sold-soft:        rgba(201, 90, 90, 0.12);
  --rehome-reserved:         #D49A55;
  --rehome-reserved-soft:    rgba(212, 154, 85, 0.12);
  --rehome-expired:          #70756A;
  --rehome-expired-soft:     rgba(112, 117, 106, 0.12);

  /* ── Spacing Scale ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ── Typography Scale ── */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  2.75rem;   /* 44px */

  /* ── Font Families ── */
  --font-ui:      'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* ── Font Weights ── */
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ── Normalized Intentional Border Radii ── */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-2xl:  16px;
  --radius-full: 9999px;

  /* ── Crisp Architectural Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.20), 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.24), 0 2px 4px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.28), 0 4px 8px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.34), 0 8px 16px rgba(0, 0, 0, 0.20);

  /* ── Transitions ── */
  --transition-fast:   150ms ease;
  --transition-normal: 220ms ease;
  --transition-slow:   350ms ease;

  /* ── Layout ── */
  --container-max:   1320px;
  --container-wide:  1200px;
  --container-narrow: 768px;
  --header-height:   68px;

  /* ── Z-Index Scale ── */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
}

/* ── Dark Mode Explicit ── */
[data-theme="dark"] {
  --rehome-background:       #161814;
  --rehome-surface:          #1F221B;
  --rehome-surface-elevated: #272B23;
  --rehome-surface-alt:      #2E332A;

  --rehome-text:             #F4F3EE;
  --rehome-text-muted:       #A2A79B;
  --rehome-text-subtle:      #70756A;

  --rehome-border:           #2F3429;
  --rehome-border-strong:    #42483B;

  --rehome-primary:          #DDA15E;
  --rehome-primary-hover:    #E8B575;
  --rehome-primary-active:   #EFC090;
  --rehome-primary-soft:     rgba(221, 161, 94, 0.12);

  --rehome-secondary:        #A3A86B;
  --rehome-secondary-light:  #C5CA8E;

  --rehome-success:          #7BA05B;
  --rehome-success-soft:     rgba(123, 160, 91, 0.12);
  --rehome-warning:          #D49A55;
  --rehome-warning-soft:     rgba(212, 154, 85, 0.12);
  --rehome-error:            #C95A5A;
  --rehome-error-soft:       rgba(201, 90, 90, 0.12);

  --rehome-available:        #7BA05B;
  --rehome-sold:             #C95A5A;
  --rehome-reserved:         #D49A55;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.20), 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.24), 0 2px 4px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.28), 0 4px 8px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.34), 0 8px 16px rgba(0, 0, 0, 0.20);
}

/* ── Light Mode Overrides (Natural organic linen aesthetic) ── */
[data-theme="light"] {
  --rehome-background:       #FAF8F5;
  --rehome-surface:          #FFFFFF;
  --rehome-surface-elevated: #F3EFE6;
  --rehome-surface-alt:      #ECE7DC;

  --rehome-text:             #1C1E1B;
  --rehome-text-muted:       #5A5F54;
  --rehome-text-subtle:      #7E8478;

  --rehome-border:           #E4E0D5;
  --rehome-border-strong:    #CFC9BD;

  --rehome-primary:          #BC6C25;
  --rehome-primary-hover:    #A85E1E;
  --rehome-primary-active:   #96531A;
  --rehome-primary-soft:     rgba(188, 108, 37, 0.10);

  --rehome-secondary:        #4F6335;
  --rehome-secondary-light:  #758A54;

  --rehome-success:          #3F6A34;
  --rehome-success-soft:     rgba(63, 106, 52, 0.10);
  --rehome-warning:          #B86B1E;
  --rehome-warning-soft:     rgba(184, 107, 30, 0.10);
  --rehome-error:            #B33939;
  --rehome-error-soft:       rgba(179, 57, 57, 0.10);

  --rehome-available:        #3F6A34;
  --rehome-sold:             #B33939;
  --rehome-reserved:         #B86B1E;

  --shadow-xs: 0 1px 2px rgba(28, 30, 27, 0.04);
  --shadow-sm: 0 1px 3px rgba(28, 30, 27, 0.06), 0 1px 2px rgba(28, 30, 27, 0.03);
  --shadow-md: 0 4px 10px rgba(28, 30, 27, 0.07), 0 2px 4px rgba(28, 30, 27, 0.04);
  --shadow-lg: 0 10px 24px rgba(28, 30, 27, 0.09), 0 4px 8px rgba(28, 30, 27, 0.04);
  --shadow-xl: 0 20px 40px rgba(28, 30, 27, 0.11), 0 8px 16px rgba(28, 30, 27, 0.06);
}

/* ============================================================
   BASE RESET & DEFAULTS
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: 1.6;
  color: var(--rehome-text);
  background-color: var(--rehome-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Prevent FODT (Flash of Default Theme) */
html:not([data-theme]) body {
  visibility: hidden;
}

html[data-theme] body {
  visibility: visible;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: var(--weight-semibold);
}

/* Focus visible - accessibility */
:focus-visible {
  outline: 2px solid var(--rehome-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Selection */
::selection {
  background: var(--rehome-primary-soft);
  color: var(--rehome-text);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.rehome-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.rehome-container--wide {
  max-width: var(--container-wide);
}

.rehome-container--narrow {
  max-width: var(--container-narrow);
}

@media (max-width: 768px) {
  .rehome-container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  background: var(--rehome-primary);
  color: var(--rehome-dark);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.text-display {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
}

.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.text-5xl   { font-size: var(--text-5xl); }

.text-muted  { color: var(--rehome-text-muted); }
.text-subtle { color: var(--rehome-text-subtle); }
.text-primary { color: var(--rehome-primary); }

/* WordPress content styles */
.entry-content p { margin-bottom: var(--space-4); }
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}
.entry-content ul, .entry-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content a {
  color: var(--rehome-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.entry-content a:hover { color: var(--rehome-primary); }
.entry-content blockquote {
  border-left: 3px solid var(--rehome-primary);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--rehome-text-muted);
}
.entry-content img {
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
}
.entry-content pre, .entry-content code {
  font-family: monospace;
  background: var(--rehome-surface-elevated);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}
.entry-content pre {
  padding: var(--space-4);
  overflow-x: auto;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — the signature Rehome amber */
.btn-primary {
  background: var(--rehome-primary);
  color: var(--rehome-dark);
  border-color: var(--rehome-primary);
}
.btn-primary:hover {
  background: var(--rehome-primary-hover);
  border-color: var(--rehome-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(221, 161, 94, 0.35);
}
.btn-primary:active {
  background: var(--rehome-primary-active);
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--rehome-text);
  border-color: var(--rehome-border);
}
.btn-secondary:hover {
  background: var(--rehome-surface-elevated);
  border-color: var(--rehome-border-strong);
}

/* Dark / Forest */
.btn-dark {
  background: var(--rehome-dark);
  color: #F8F5ED;
  border-color: var(--rehome-dark);
}
.btn-dark:hover {
  background: #1D2910;
  border-color: #1D2910;
  transform: translateY(-1px);
}

/* WhatsApp */
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}
.btn-whatsapp:hover {
  background: #1EBF59;
  border-color: #1EBF59;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.30);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--rehome-text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--rehome-surface-elevated);
  color: var(--rehome-text);
}

/* Danger */
.btn-danger {
  background: var(--rehome-error);
  color: #fff;
  border-color: var(--rehome-error);
}
.btn-danger:hover {
  background: #871F1F;
  transform: translateY(-1px);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}
.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* ================================================================
   FORM CONTROLS & INPUTS
   ================================================================ */
.form-group {
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--rehome-text);
  margin-bottom: 6px;
}

.form-label .required {
  color: #E63946;
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--rehome-surface-elevated, #24241F);
  border: 1px solid var(--rehome-border, #3A3A32);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  color: var(--rehome-text, #F8F5ED);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--rehome-primary, #DDA15E);
  box-shadow: 0 0 0 3px rgba(221, 161, 94, 0.15);
}

.form-select {
  appearance: auto;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-block {
  width: 100%;
}
.btn-icon {
  padding: var(--space-3);
  aspect-ratio: 1;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

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

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--rehome-text);
}

.form-label .required {
  color: var(--rehome-error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--rehome-text);
  background: var(--rehome-surface);
  border: 1.5px solid var(--rehome-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--rehome-border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--rehome-primary);
  box-shadow: 0 0 0 3px var(--rehome-primary-soft);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--rehome-text-subtle);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5C52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--rehome-text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--rehome-error);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--rehome-error);
}
.form-input.is-error:focus,
.form-select.is-error:focus,
.form-textarea.is-error:focus {
  box-shadow: 0 0 0 3px var(--rehome-error-soft);
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--rehome-primary);
  cursor: pointer;
}

/* Price input with prefix */
.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: var(--space-4);
  font-weight: var(--weight-medium);
  color: var(--rehome-text-muted);
  pointer-events: none;
}
.input-prefix-wrapper .form-input {
  padding-left: calc(var(--space-4) + 3ch + var(--space-2));
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--rehome-surface);
  border: 1px solid var(--rehome-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-5);
}

.card-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--rehome-border);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--rehome-border);
  background: var(--rehome-surface-alt);
}

/* ============================================================
   BADGES & STATUS CHIPS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 550;
  border-radius: 6px;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.25;
}

.badge-available {
  background: rgba(18, 32, 22, 0.82);
  color: #86efac;
}

.badge-sold {
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.badge-reserved {
  background: rgba(217, 119, 6, 0.92);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.badge-expired {
  background: rgba(55, 65, 81, 0.85);
  color: #d1d5db;
}

.badge-featured {
  background: rgba(24, 18, 10, 0.82);
  color: #f59e0b;
  font-weight: 600;
}

.badge-verified {
  background: rgba(15, 23, 42, 0.8);
  color: #60a5fa;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  font-size: var(--text-sm);
}

.alert-success {
  background: var(--rehome-success-soft);
  border-color: var(--rehome-success);
  color: var(--rehome-success);
}

.alert-warning {
  background: var(--rehome-warning-soft);
  border-color: var(--rehome-warning);
  color: var(--rehome-warning);
}

.alert-error {
  background: var(--rehome-error-soft);
  border-color: var(--rehome-error);
  color: var(--rehome-error);
}

.alert-info {
  background: var(--rehome-info-soft);
  border-color: var(--rehome-info);
  color: var(--rehome-info);
}

/* ============================================================
   PAGINATION
   ============================================================ */

.rehome-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-12);
}

.rehome-pagination a,
.rehome-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1.5px solid var(--rehome-border);
  border-radius: var(--radius-md);
  color: var(--rehome-text-muted);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.rehome-pagination a:hover {
  border-color: var(--rehome-primary);
  color: var(--rehome-primary);
  background: var(--rehome-primary-soft);
}

.rehome-pagination .current,
.rehome-pagination span.current {
  background: var(--rehome-primary);
  border-color: var(--rehome-primary);
  color: var(--rehome-dark);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rehome-primary);
  margin-bottom: var(--space-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--rehome-text);
  line-height: 1.2;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--rehome-text-muted);
  margin-top: var(--space-3);
  max-width: 560px;
}

.section-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--rehome-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.section-link:hover { color: var(--rehome-primary); }

@media (max-width: 768px) {
  .section-title { font-size: var(--text-2xl); }
  .section-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  border: none;
  border-top: 1px solid var(--rehome-border);
  margin: var(--space-8) 0;
}

/* ============================================================
   LOADING STATES
   ============================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--rehome-surface-elevated) 25%,
    var(--rehome-surface-alt) 50%,
    var(--rehome-surface-elevated) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--rehome-border);
  border-top-color: var(--rehome-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   SOLD OVERLAY — LISTING CARDS
   ============================================================ */

.listing-card--sold .listing-card__image-wrap::after {
  content: 'SOLD';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 27, 24, 0.65);
  color: #fff;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  backdrop-filter: blur(2px);
}

/* ============================================================
   FLOATING WHATSAPP BUTTON
   ============================================================ */

.whatsapp-float {
  position: fixed;
  bottom: 100px;
  right: var(--space-6);
  z-index: var(--z-sticky);
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.40);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.50);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 80px;
    right: var(--space-4);
  }
}

/* ============================================================
   MOBILE CONTACT BAR
   ============================================================ */

.mobile-contact-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--rehome-surface);
  border-top: 1px solid var(--rehome-border);
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .mobile-contact-bar {
    display: flex;
  }
}

.mobile-contact-bar .btn {
  flex: 1;
  font-size: var(--text-xs);
}

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile-only { display: none !important; }
}

/* ============================================================
   WORDPRESS ADMIN BAR OFFSET
   ============================================================ */

.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* ============================================================
   GALLERY PREV / NEXT NAVIGATION ARROWS
   ============================================================ */

.listing-gallery__main {
  position: relative;
}

.listing-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.listing-gallery__nav:hover {
  background: rgba(221, 161, 94, 0.85);
  transform: translateY(-50%) scale(1.08);
}

.listing-gallery__nav:focus-visible {
  outline: 2px solid var(--rehome-primary);
  outline-offset: 2px;
}

.listing-gallery__nav--prev {
  left: 10px;
}

.listing-gallery__nav--next {
  right: 10px;
}

/* Hide arrows when only 1 image */
.listing-gallery__nav:only-of-type,
.listing-gallery[data-count="1"] .listing-gallery__nav {
  display: none;
}

/* Swipe hint on mobile */
@media (max-width: 600px) {
  .listing-gallery__nav {
    width: 34px;
    height: 34px;
  }
  .listing-gallery__nav--prev { left: 6px; }
  .listing-gallery__nav--next { right: 6px; }
}

/* ============================================================
   ELEMENTOR FULLWIDTH HERO SECTION FIX
   ============================================================ */

.elementor-section:has(.elementor-widget-rehome_hero),
.elementor-section.rehome-hero-fullwidth {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.elementor-section:has(.elementor-widget-rehome_hero) > .elementor-container,
.elementor-section.rehome-hero-fullwidth > .elementor-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.elementor-section:has(.elementor-widget-rehome_hero) .elementor-column,
.elementor-section:has(.elementor-widget-rehome_hero) .elementor-widget-wrap {
  padding: 0 !important;
  margin: 0 !important;
}

.elementor-widget-rehome_hero {
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.elementor-widget-rehome_hero .home-hero {
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ============================================================
   RESPONSIVE CATEGORY GRID (2 PER ROW ON MOBILE, 3-4 ON TABLET, 6 ON DESKTOP)
   ============================================================ */

.category-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 16px !important;
}

@media (max-width: 1100px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
  }
}

@media (max-width: 520px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .category-card {
    padding: 16px 10px !important;
    border-radius: 14px !important;
  }

  .category-card__icon {
    font-size: 28px !important;
    margin-bottom: 6px !important;
  }

  .category-card__name {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .category-card__count {
    font-size: 11px !important;
  }
}

/* ============================================================
   MOBILE FOOTER: END IMMEDIATELY AFTER SOCIAL MEDIA ICONS
   (Tablets and computers remain unchanged)
   ============================================================ */

@media (max-width: 600px) {
  /* Hide navigation column link groups on mobile phones */
  .site-footer .footer-col:not(.footer-col--brand),
  .site-footer .footer-grid > .footer-col:not(:first-child),
  .rehome-elementor-footer .footer-col:not(.footer-col--brand),
  .rehome-elementor-footer .footer-grid > .footer-col:not(:first-child) {
    display: none !important;
  }

  /* Hide newsletter and bottom copyright/legal bar on mobile phones */
  .site-footer .footer-newsletter,
  .site-footer .footer-bottom,
  .rehome-elementor-footer .footer-newsletter,
  .rehome-elementor-footer .footer-bottom {
    display: none !important;
  }

  /* Make footer end cleanly right after social icons */
  .site-footer,
  .rehome-elementor-footer {
    padding-bottom: 0 !important;
  }

  .site-footer .footer-main,
  .rehome-elementor-footer .footer-main {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .site-footer .footer-grid,
  .rehome-elementor-footer .footer-grid {
    display: block !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  .site-footer .footer-brand,
  .site-footer .footer-col--brand,
  .rehome-elementor-footer .footer-brand,
  .rehome-elementor-footer .footer-col--brand {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .site-footer .footer-social,
  .rehome-elementor-footer .footer-social {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* ============================================================
   LISTING CARDS: POSITION FAVORITE & COMPARE AT BOTTOM-RIGHT
   ============================================================ */

.listing-card__actions {
  position: absolute !important;
  bottom: 12px !important;
  right: 12px !important;
  top: auto !important;
  left: auto !important;
  display: flex !important;
  gap: 8px !important;
  z-index: 4 !important;
}

/* Remove hero badge pill completely on all devices */
.home-hero__badge-wrap,
.home-hero__badge,
.home-hero__badge-dot {
  display: none !important;
}

/* Hide trending searches on mobile devices only (Tablets & computers remain unchanged) */
@media (max-width: 600px) {
  .hero-popular-searches,
  .hero-popular-searches--centered {
    display: none !important;
  }
}
