/* ==========================================================================
   Glam Room — Mobile & responsive (load last)
   ========================================================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --page-gutter: clamp(1rem, 4vw, 1.5rem);
  --touch-min: 44px;
}

/* --- Base --- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.editorial-theme,
body.home-editorial {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

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

/* Prevent iOS zoom on form focus */
input,
select,
textarea,
button {
  font-size: 16px;
}

@media (min-width: 768px) {
  input,
  select,
  textarea {
    font-size: 1rem;
  }
}

/* Touch-friendly tap targets */
a,
button,
.btn,
.home-menu-btn,
.home-topbar-link,
.carousel-btn,
.social-link,
.whatsapp-float {
  min-height: var(--touch-min);
  -webkit-tap-highlight-color: rgba(212, 168, 83, 0.2);
}

.home-topbar-link,
.home-menu-btn {
  display: inline-flex;
  align-items: center;
}

/* --- Editorial chrome --- */
.home-topbar {
  padding-top: calc(0.75rem + var(--safe-top));
  padding-left: calc(var(--page-gutter) + var(--safe-left));
  padding-right: calc(var(--page-gutter) + var(--safe-right));
}

.home-bottombar {
  padding-bottom: calc(1rem + var(--safe-bottom));
  padding-left: calc(var(--page-gutter) + var(--safe-left));
  padding-right: calc(var(--page-gutter) + var(--safe-right));
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.home-menu-panel {
  width: min(100vw, 380px);
  padding-top: calc(4.5rem + var(--safe-top));
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.home-menu-links a {
  padding: 1.1rem 0;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

/* --- Homepage panels --- */
.home-scroll {
  -webkit-overflow-scrolling: touch;
}

.home-panel-content {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  padding-bottom: calc(5rem + var(--safe-bottom));
}

.home-panel-visual-labels {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  padding-top: calc(4.5rem + var(--safe-top));
}

.home-scroll-hint {
  bottom: calc(3.5rem + var(--safe-bottom));
}

.whatsapp-float {
  bottom: calc(1.25rem + var(--safe-bottom));
  right: calc(1rem + var(--safe-right));
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
}

/* --- Inner pages layout --- */
.editorial-main {
  padding-top: calc(4.25rem + var(--safe-top));
  padding-bottom: calc(4.5rem + var(--safe-bottom));
}

body.editorial-theme .section {
  padding: 3.5rem var(--page-gutter);
}

.section-inner {
  width: 100%;
  padding: 0;
}

body.editorial-theme .section-header {
  margin-bottom: 2rem;
}

body.editorial-theme .section-title {
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  hyphens: auto;
}

/* Business hero */
body.editorial-theme .editorial-main .business-hero {
  min-height: min(85vh, 720px);
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  padding-bottom: 2rem;
}

body.editorial-theme .editorial-main .business-hero-inner {
  padding-top: calc(4rem + var(--safe-top));
  padding-left: 0;
  padding-right: 0;
}

.business-hero .hero-buttons {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 320px;
  gap: 0.75rem;
}

.business-hero .hero-buttons .btn {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-min);
}

/* About grid stacks on mobile */
.about-grid {
  gap: 1.5rem;
}

body.editorial-theme .about-content p {
  font-size: 1rem;
  line-height: 1.75;
}

.about-stats {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 400px) {
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Services — 2 pairs side by side on mobile */
#services-grid.services-grid,
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.services-grid > .service-card-link,
.services-grid > .service-card,
.services-grid > .skeleton,
.services-grid > article {
  min-width: 0;
  max-width: 100%;
}

.service-card {
  padding: 1rem 0.85rem;
  min-width: 0;
}

.service-card-header {
  margin-bottom: 0.65rem;
}

.service-icon {
  width: 42px;
  height: 42px;
  font-size: 1rem;
  border-radius: 0.65rem;
}

.service-badge {
  font-size: 0.55rem;
  padding: 0.2rem 0.45rem;
  letter-spacing: 0.03em;
}

.service-name {
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

body.editorial-theme .service-name {
  font-size: clamp(1rem, 3.8vw, 1.2rem);
}

.service-desc {
  font-size: 0.72rem;
  line-height: 1.45;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-meta {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding-top: 0.65rem;
}

.service-price {
  font-size: 0.78rem;
}

.service-duration {
  font-size: 0.68rem;
}

.service-duration i {
  font-size: 0.65rem;
}

/* Gallery */
.gallery-grid {
  gap: 0.75rem;
}

/* Locations */
.locations-grid {
  gap: 1rem;
}

.location-card {
  padding: 1.25rem;
}

.location-card-address {
  font-size: 1.05rem;
  word-break: break-word;
}

/* Contact & CTAs */
.contact-cta {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.contact-cta .btn {
  width: 100%;
  margin-left: 0 !important;
  justify-content: center;
}

.contact-card {
  padding: 1.5rem;
}

.social-links {
  flex-wrap: wrap;
  justify-content: center;
}

/* Testimonials */
.testimonials-wrapper {
  padding: 0 0.25rem;
}

.testimonial-card {
  padding: 1.75rem 1.25rem;
}

.testimonial-text {
  font-size: 1.05rem;
}

.carousel-controls {
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Quote card */
.quote-card {
  padding: 1.5rem;
}

.quote-text {
  font-size: 1.1rem !important;
}

/* --- Booking page --- */
body.editorial-theme .booking-container {
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  padding-top: calc(5rem + var(--safe-top));
  padding-bottom: calc(3rem + var(--safe-bottom));
}

.booking-grid {
  gap: 1.25rem;
}

.booking-header {
  margin-bottom: 1.75rem;
}

.booking-title {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
}

.personality-card,
.booking-form-card {
  padding: 1.5rem;
}

.booking-info-list li {
  font-size: 0.88rem;
  word-break: break-word;
}

.btn-book-submit {
  min-height: 52px;
}

/* Booking page — stacked layout on mobile: form first, locations below */
@media (max-width: 899px) {
  .booking-container {
    max-width: 100%;
  }

  .booking-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    align-items: stretch;
  }

  .booking-form-card {
    order: 1;
    padding: 1.25rem 1rem;
    min-width: 0;
    border-radius: 1.25rem;
  }

  .personality-card {
    order: 2;
    padding: 1.15rem 1rem;
    min-width: 0;
    border-radius: 1.25rem;
  }

  .personality-card .booking-info-list li {
    padding: 0.65rem 0;
    font-size: 0.88rem;
  }

  body.booking-page .form-row-2,
  .form-row-2 {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    gap: 0;
    align-items: stretch;
  }

  .form-row-2 .form-group {
    margin-bottom: 1.15rem;
  }

  .form-row-2 .form-group label {
    font-size: 0.82rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
  }

  body.editorial-theme .form-row-2 .form-group label {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: none;
  }

  body.editorial-theme .booking-form-title {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    margin-bottom: 1.25rem;
  }

  body[data-page="booking"] .form-group label {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: none;
    margin-bottom: 0.5rem;
  }

  body[data-page="booking"] .form-group {
    margin-bottom: 1.15rem;
  }

  body[data-page="booking"] .form-hint {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    opacity: 0.65;
  }

  body[data-page="booking"] .home-bottombar {
    display: none;
  }

  body[data-page="booking"] .booking-container {
    padding-bottom: calc(2.5rem + var(--safe-bottom));
  }
}

/* --- Small phones (≤480px) --- */
@media (max-width: 480px) {
  .home-topbar-link,
  .home-menu-btn {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
  }

  .home-panel-title {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .home-panel-title.hero-name {
    font-size: clamp(2.75rem, 16vw, 4.5rem);
  }

  .home-panel-visual-labels span {
    font-size: 0.55rem;
    letter-spacing: 0.12em;
  }

  body.editorial-theme .business-hero-title {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
  }

  .home-bottombar span,
  .home-bottombar a {
    font-size: 0.52rem;
    width: 100%;
    text-align: center;
  }
}

/* --- Tablet portrait (481px–767px) --- */
@media (min-width: 481px) and (max-width: 767px) {
  .locations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-grid {
    gap: 0.85rem;
  }

  .service-card {
    padding: 1.15rem;
  }

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

  .business-hero .hero-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }

  .business-hero .hero-buttons .btn {
    width: auto;
    flex: 1 1 auto;
    min-width: 140px;
  }

  .contact-cta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
  }

  .contact-cta .btn {
    width: auto;
  }
}

/* --- Desktop hover only (no sticky hover on touch) --- */
@media (hover: hover) and (pointer: fine) {
  .glass-card:hover {
    transform: translateY(-4px);
  }
}

@media (hover: none) {
  .glass-card:hover {
    transform: none;
  }

  .home-panel:hover .home-panel-bg,
  .home-panel.in-view .home-panel-bg {
    transform: scale(1.02);
  }
}

/* --- Landscape phones --- */
@media (max-height: 500px) and (orientation: landscape) {
  .home-panel {
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.editorial-theme .editorial-main .business-hero {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 1.5rem;
  }

  .home-scroll-hint {
    display: none;
  }
}

/* --- Add to Home Screen prompt (homepage, mobile) --- */
body.install-prompt-open {
  overflow: hidden;
}

.install-prompt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.install-prompt-backdrop--visible {
  opacity: 1;
}

.install-prompt {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 9999;
  width: min(100%, 420px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translate(-50%, 110%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  background: #fff9f2;
  color: #2d1b0e;
  border-radius: 28px 28px 0 0;
  padding: 1.5rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
}

.install-prompt--visible {
  transform: translate(-50%, 0);
}

.install-prompt-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: rgba(45, 27, 14, 0.08);
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  color: #2d1b0e;
  cursor: pointer;
}

.install-prompt-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #c35a2e, #d4a853);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.install-prompt-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.install-prompt-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #5a3e2b;
  margin-bottom: 1rem;
}

.install-prompt-hint {
  font-size: 0.85rem;
  color: #5a3e2b;
  margin-bottom: 1rem;
}

.install-prompt-steps {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.install-prompt-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
  background: rgba(195, 90, 46, 0.08);
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
}

.install-prompt-step-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: #c35a2e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.install-prompt-actions {
  display: grid;
  gap: 0.5rem;
}

.install-prompt-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.install-prompt-btn--primary {
  background: linear-gradient(135deg, #c35a2e, #a84a23);
  color: white;
}

.install-prompt-btn--ghost {
  background: transparent;
  color: #5a3e2b;
}

@media (min-width: 769px) {
  .install-prompt,
  .install-prompt-backdrop {
    display: none !important;
  }
}

/* Glam Room sanctuaries — keep 50/50 split on mobile (booking entry) */
@media (max-width: 768px) {
  .gr-sanctuaries {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .gr-sanctuary {
    min-width: 0;
  }

  .gr-sanctuary + .gr-sanctuary {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
  }
}

/* --- Enterprise page (mobile) --- */
@media (max-width: 768px) {
  body[data-page="enterprise"] .editorial-main {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Enterprise portal — keep 50/50 split on all mobile widths */
@media (max-width: 899px) {
  .ent-portal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: min(100vh, 100dvh);
  }

  .ent-portal__panel {
    min-width: 0;
    min-height: min(100vh, 100dvh);
    padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 0.65rem clamp(2rem, 5vw, 3rem);
  }

  .ent-portal__panel + .ent-portal__panel {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
  }

  .ent-portal__content {
    max-width: none;
    width: 100%;
    padding: 0 0.25rem;
  }

  .ent-portal__title {
    font-size: clamp(0.5625rem, 2.8vw, 0.75rem);
    letter-spacing: 0.1em;
    line-height: 1.35;
  }

  .ent-portal__tagline {
    font-size: clamp(0.6875rem, 2.6vw, 0.8125rem);
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  .ent-portal__subline {
    display: none;
  }

  .ent-portal__cta {
    font-size: clamp(0.5rem, 2.2vw, 0.625rem);
    letter-spacing: 0.06em;
    padding: 0.7rem 0.5rem;
    width: 100%;
    max-width: 9.5rem;
    line-height: 1.25;
    min-height: auto;
  }

  .ent-metric-value {
    font-size: clamp(1.5rem, 6.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .ent-metric-label {
    font-size: clamp(0.5rem, 2.2vw, 0.5625rem);
    letter-spacing: 0.12em;
  }

  .ent-metric-sub,
  .ent-metric-faint {
    font-size: clamp(0.625rem, 2.4vw, 0.6875rem);
  }

  .ent-metric {
    padding: 1.15rem var(--page-gutter, 1.25rem);
  }

  .ent-metric-strip-row {
    padding: 0.85rem var(--page-gutter, 1.25rem);
    gap: clamp(0.35rem, 1.5vw, 0.75rem);
  }

  .ent-metric-strip-item {
    font-size: clamp(0.4375rem, 1.85vw, 0.5625rem);
    letter-spacing: 0.08em;
  }

  .ent-metric-strip-item:not(:last-child) {
    padding-right: clamp(0.35rem, 1.5vw, 0.65rem);
  }
}
