/**
 * AQDERA Services Directory — public browse + profile styles (Phase D).
 * Matches themes/events gold + ink language; mobile-first RTL/LTR.
 */
.services-directory-page {
  --sd-ink: #1c1814;
  --sd-muted: #6f655c;
  --sd-line: #e4dbd0;
  --sd-paper: #fffcf7;
  --sd-soft: #f3eee6;
  --sd-gold: #b8924a;
  --sd-gold-soft: #e6d3a8;
  --sd-gold-deep: #8a6a2f;
  --sd-danger: #8f3e3e;
  --sd-shadow: 0 18px 48px rgba(28, 24, 20, 0.08);
  --sd-radius: 18px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: Manrope, Cairo, ui-sans-serif, system-ui, sans-serif;
  min-height: 100vh;
  margin: 0;
  color: var(--sd-ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(1100px 480px at 100% -8%, rgba(184, 146, 74, 0.11), transparent 55%),
    radial-gradient(900px 420px at -12% 18%, rgba(80, 60, 40, 0.05), transparent 52%),
    linear-gradient(180deg, #f7f2e9 0%, var(--sd-soft) 48%, #ebe4d8 100%);
}

.services-directory-page .app-header {
  background: rgba(26, 23, 20, 0.94);
}

.sd-shell {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
  padding-bottom: 88px;
}

.sd-hero {
  padding: 56px 0 28px;
  max-width: 720px;
  animation: sd-fade-up 0.55s ease both;
}

.sd-hero .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sd-gold-deep);
  margin-bottom: 12px;
}

.sd-hero .brand-mark-line {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--sd-gold-deep);
}

.sd-hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  line-height: 1.15;
  color: var(--sd-ink);
}

.sd-hero p {
  margin: 0;
  max-width: 560px;
  color: var(--sd-muted);
  font-size: 1.02rem;
  line-height: 1.7;
  font-weight: 500;
}

.sd-filters {
  display: grid;
  gap: 12px;
  margin: 8px 0 28px;
  padding: 16px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: rgba(255, 252, 247, 0.82);
  backdrop-filter: blur(8px);
  animation: sd-fade-up 0.6s ease 0.08s both;
}

.sd-filters-row {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .sd-filters-row {
    grid-template-columns: 1.2fr 1fr 1fr auto;
    align-items: end;
  }
}

.sd-field {
  display: grid;
  gap: 6px;
}

.sd-field label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sd-gold-deep);
}

.sd-field input,
.sd-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--sd-line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--sd-ink);
  font: inherit;
}

.sd-field input:focus,
.sd-field select:focus {
  outline: none;
  border-color: var(--sd-gold);
  box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.18);
}

.sd-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sd-btn {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  color: inherit;
}

.sd-btn.primary {
  background: linear-gradient(135deg, var(--sd-gold-soft), var(--sd-gold));
  color: #1c1812;
}

.sd-btn.ghost {
  background: transparent;
  border-color: var(--sd-line);
  color: var(--sd-ink);
}

.sd-btn.wa {
  background: #128c7e;
  color: #fff;
}

.sd-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sd-state {
  padding: 36px 18px;
  text-align: center;
  color: var(--sd-muted);
  border: 1px dashed var(--sd-line);
  border-radius: var(--sd-radius);
  background: rgba(255, 252, 247, 0.55);
}

.sd-state h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--sd-ink);
}

.sd-state p {
  margin: 0 0 16px;
  line-height: 1.65;
}

.sd-state.is-error h2 {
  color: var(--sd-danger);
}

.sd-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .sd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .sd-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sd-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: var(--sd-paper);
  box-shadow: var(--sd-shadow);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: sd-fade-up 0.5s ease both;
}

.sd-card:hover,
.sd-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 52px rgba(28, 24, 20, 0.12);
  outline: none;
}

.sd-card-media {
  aspect-ratio: 16 / 11;
  background:
    linear-gradient(145deg, rgba(184, 146, 74, 0.12), transparent 55%),
    #ebe3d6;
  overflow: hidden;
}

.sd-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sd-card-media .sd-img-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--sd-gold-deep);
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.sd-card-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sd-card-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sd-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--sd-muted);
  font-size: 0.9rem;
}

.sd-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--sd-line);
  background: rgba(243, 238, 230, 0.8);
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--sd-ink);
}

.sd-price {
  color: var(--sd-gold-deep);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

/* Profile */
.sd-profile-hero {
  position: relative;
  margin: 18px 0 24px;
  border-radius: calc(var(--sd-radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--sd-line);
  background: #ebe3d6;
  min-height: 220px;
  animation: sd-fade 0.55s ease both;
}

.sd-profile-hero img {
  width: 100%;
  max-height: min(52vh, 420px);
  object-fit: cover;
  display: block;
}

.sd-profile-hero .sd-img-ph {
  min-height: 220px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--sd-gold-deep);
  letter-spacing: 0.1em;
}

.sd-profile-head {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  animation: sd-fade-up 0.55s ease 0.06s both;
}

@media (min-width: 800px) {
  .sd-profile-head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.sd-profile-head h1 {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
}

.sd-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sd-section {
  margin: 0 0 28px;
  padding-top: 4px;
  animation: sd-fade-up 0.5s ease both;
}

.sd-section h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
}

.sd-section p,
.sd-section li {
  color: var(--sd-muted);
  line-height: 1.7;
}

.sd-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sd-gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .sd-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sd-gallery figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  background: #ebe3d6;
  aspect-ratio: 4 / 3;
}

.sd-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sd-gallery .sd-img-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--sd-gold-deep);
}

.sd-gallery-error {
  padding: 18px 16px;
  border: 1px dashed var(--sd-line);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.7);
  text-align: center;
  margin-bottom: 12px;
}

.sd-gallery-error h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--sd-ink);
}

.sd-gallery-error p {
  margin: 0 0 14px;
  color: var(--sd-muted);
}

.sd-back {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--sd-gold-deep);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.92rem;
}

.sd-note {
  font-size: 0.86rem;
  color: var(--sd-muted);
}

/* Ensure state containers honor the hidden attribute over display:grid rules */
.sd-filters[hidden],
.sd-state[hidden],
#listState[hidden],
#profileState[hidden],
#gallerySection[hidden],
#galleryError[hidden],
#profileGallery[hidden],
#descSection[hidden],
#areasSection[hidden],
#venueSection[hidden] {
  display: none !important;
}

@keyframes sd-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sd-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 390px) {
  .sd-shell {
    width: min(100% - 20px, 1120px);
  }
  .sd-hero {
    padding-top: 36px;
  }
  .sd-hero .brand-mark-line {
    font-size: 2.1rem;
  }
  .sd-btn {
    min-height: 48px;
    width: 100%;
  }
  .sd-filter-actions {
    flex-direction: column;
  }
  .sd-profile-actions .sd-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-hero,
  .sd-filters,
  .sd-card,
  .sd-profile-hero,
  .sd-profile-head,
  .sd-section {
    animation: none;
  }
  .sd-card:hover,
  .sd-card:focus-visible {
    transform: none;
  }
}
