:root {
  --bg: #fdfaf5;
  --surface: #ffffff;
  --surface-alt: #f7f1e6;
  --text: #1f1a17;
  --text-muted: #62574f;
  --border: #e7ddd0;
  --primary: #c25114;
  --primary-hover: #9f3e0b;
  --primary-soft: #fff1e6;
  --accent: #8b1e3f;
  --gold: #d98a18;
  --success: #166534;
  --success-bg: #dcfce7;
  --whatsapp: #128c7e;
  --shadow-sm: 0 4px 14px rgba(31, 26, 23, 0.06);
  --shadow-md: 0 12px 32px rgba(31, 26, 23, 0.1);
  --radius-md: 14px;
  --radius-lg: 22px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.62rem 1.2rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 0.98rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(194, 81, 20, 0.24);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.btn-whatsapp:hover {
  background: #0d7266;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-danger:hover {
  background: #fecaca;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253, 250, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 14px rgba(194, 81, 20, 0.28);
}

.brand-name {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
}

.brand-city {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.badge-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.48rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Hero */
.hero {
  padding: 3rem 0 2.5rem;
  background:
    radial-gradient(circle at 85% 15%, rgba(217, 138, 24, 0.14), transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(194, 81, 20, 0.1), transparent 36%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 1.6rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.stat-item strong {
  display: block;
  font-size: 1.45rem;
  color: var(--primary);
}

.stat-item span {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Hero Mosaic */
.hero-mosaic {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.9rem;
}

.mosaic-stack {
  display: grid;
  gap: 0.9rem;
}

.mosaic-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  background: #221d1a;
  min-height: 165px;
}

.mosaic-main {
  min-height: 345px;
}

.mosaic-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.mosaic-card:hover img {
  transform: scale(1.04);
}

.mosaic-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(20, 14, 10, 0.84));
  color: #fff;
}

.mosaic-caption strong {
  display: block;
  font-size: 0.96rem;
  margin-top: 0.25rem;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #fff;
}

/* Specialty Shortcuts Strip */
.specialty-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 0;
}

.specialty-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.specialty-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.specialty-chip:hover,
.specialty-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.specialty-chip .chip-icon {
  font-size: 1.25rem;
}

.specialty-chip strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
}

.specialty-chip span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Catalog Section */
.catalog-section {
  padding: 3rem 0 4rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-box input,
.catalog-controls select {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.search-box input {
  padding-left: 2.3rem;
  min-width: 260px;
}

.search-box input:focus,
.catalog-controls select:focus {
  outline: 2px solid rgba(194, 81, 20, 0.24);
  border-color: var(--primary);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.filter-tab .count {
  font-size: 0.76rem;
  opacity: 0.8;
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #2a2421;
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.listing-card:hover .card-media img {
  transform: scale(1.05);
}

.card-cat-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(24, 18, 15, 0.78);
  color: #fff;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.card-status-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: var(--success-bg);
  color: var(--success);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.card-status-badge.unavailable {
  background: #fee2e2;
  color: #991b1b;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.22rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.card-body h3:hover {
  color: var(--primary);
}

.card-desc {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.98rem;
}

.card-actions {
  display: flex;
  gap: 0.45rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.btn-added {
  background: var(--success-bg);
  color: var(--success);
  border-color: #86efac;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* Contact Band */
.contact-band {
  background: linear-gradient(135deg, #271a14, #402116);
  color: #fff;
  padding: 3.5rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.contact-band .eyebrow {
  background: rgba(255, 255, 255, 0.14);
  color: #ffd7a8;
}

.contact-band p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 52ch;
}

.contact-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.92rem;
}

.contact-row span {
  color: rgba(255, 255, 255, 0.72);
}

.contact-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.contact-actions .btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Footer */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Modals & Drawers */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 15, 12, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.drawer-backdrop {
  display: flex;
  justify-content: flex-end;
  padding: 0;
}

.modal-card {
  position: relative;
  width: min(960px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
}

.drawer-panel {
  width: min(480px, 100%);
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.2);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-header p {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.drawer-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
  z-index: 5;
}

.drawer-header .modal-close {
  position: static;
}

/* Detail Modal */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 1.75rem;
}

.detail-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.detail-body .pill {
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.detail-desc {
  color: var(--text-muted);
  margin: 0.4rem 0 1rem;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1.15rem;
}

.detail-specs span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.detail-specs strong {
  font-size: 0.85rem;
}

.detail-section {
  margin-bottom: 1.15rem;
}

.detail-section h4 {
  font-family: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.inclusions-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
}

.inclusions-list li {
  margin-bottom: 0.35rem;
}

.packages-list {
  display: grid;
  gap: 0.55rem;
}

.pkg-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.pkg-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.pkg-option strong {
  display: block;
  font-size: 0.9rem;
}

.pkg-option small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.pkg-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.detail-price-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-price-box strong {
  font-size: 1.15rem;
  color: var(--primary);
}

/* Shortlist & Forms */
.shortlist-items {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.shortlist-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.shortlist-card img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.shortlist-info {
  flex: 1;
  min-width: 0;
}

.shortlist-info strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortlist-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quote-form label,
.owner-form label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.quote-form input,
.quote-form textarea,
.owner-form input,
.owner-form select,
.owner-form textarea,
.pin-form input {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.quote-actions {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.form-feedback {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 600;
}

.form-feedback.error {
  background: #fee2e2;
  color: #991b1b;
}

/* Owner Studio */
.owner-header {
  margin-bottom: 1rem;
  padding-right: 2.5rem;
}

.owner-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.pin-gate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.pin-input-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  max-width: 380px;
}

.error-text {
  color: #b91c1c;
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.owner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
}

.owner-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.owner-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.owner-list,
.inquiries-list {
  display: grid;
  gap: 0.75rem;
}

.owner-row-card,
.inquiry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.owner-row-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.owner-row-left img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}

.owner-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inquiry-card {
  display: block;
}

.inquiry-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.inquiry-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--text);
  color: #fff;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid,
  .detail-layout,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .specialty-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-link {
    display: none;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .specialty-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-mosaic {
    grid-template-columns: 1fr;
  }

  .mosaic-main {
    min-height: 220px;
  }

  .form-row,
  .detail-specs {
    grid-template-columns: 1fr;
  }

  .search-box input {
    min-width: 100%;
  }

  .owner-row-card {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Multi-category badges & photo count on cards */
.card-cat-stack {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 5.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-cat-stack .card-cat-badge {
  position: static;
}

.card-photo-count {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(24, 18, 15, 0.76);
  color: #fff;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

/* Detail Modal Gallery & Multi-Category Pills */
.detail-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.detail-cat-pills .pill {
  margin-bottom: 0;
}

.detail-photo-caption {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-gallery-strip {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.gallery-thumb {
  flex: 0 0 84px;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: #1f1a17;
  cursor: pointer;
  opacity: 0.74;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
}

.gallery-thumb img {
  width: 84px;
  height: 54px;
  object-fit: cover;
}

/* Owner Photo Upload & Per-Photo Tagger */
.photo-tagger-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.9rem;
}

.photo-tagger-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.photo-tagger-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.upload-photos-btn {
  white-space: nowrap;
  margin-bottom: 0 !important;
}

.photo-editor-list {
  display: grid;
  gap: 0.8rem;
}

.photo-editor-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
}

.photo-editor-thumb img {
  width: 118px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

.photo-editor-thumb-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.photo-editor-thumb-actions .btn-sm {
  padding: 0.24rem 0.5rem;
  font-size: 0.72rem;
}

.photo-editor-fields label {
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.photo-editor-fields input {
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
}

.photo-cat-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.cat-toggle-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cat-toggle-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.auto-classify-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.auto-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.auto-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.auto-cat-pill {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .photo-editor-card {
    grid-template-columns: 1fr;
  }

  .photo-editor-thumb img {
    width: 100%;
    height: 150px;
  }
}

/* Ensure the HTML hidden attribute always wins over component display rules */
[hidden] { display: none !important; }
