/* Wedding Za final production polish
   Shared public-site, CRM and Admin consistency + mobile pass. */

:root {
  --wz-touch: 44px;
  --wz-focus: rgba(123, 41, 66, .18);
  --wz-soft-line: rgba(29, 23, 20, .10);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
.crm-button,
.admin-button,
.pill-btn {
  touch-action: manipulation;
}

input,
select,
textarea {
  max-width: 100%;
}

:where(
  a,
  button,
  input,
  select,
  textarea,
  summary
):focus-visible {
  outline: 2px solid rgba(123,41,66,.48);
  outline-offset: 3px;
}

/* Public site consistency ------------------------------------------------ */
.vision-site :where(
  input,
  select,
  textarea,
  button
) {
  min-height: var(--wz-touch);
}

.vision-site :where(
  .vendor-card,
  .vision-vendor-card,
  .marketplace-review-card,
  .invite-card,
  .story-card,
  .journal-card
) {
  min-width: 0;
}

.vision-site :where(
  .vendor-card,
  .vision-vendor-card,
  .marketplace-review-card,
  .invite-card
) :where(h2,h3,h4,p,strong,span) {
  overflow-wrap: anywhere;
}

.vision-footer-links a,
.vision-menu a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.discovery-dialog {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.marketplace-filter-card,
.marketplace-compare-table,
.marketplace-search-result {
  min-width: 0;
}

/* CRM + Admin consistency ----------------------------------------------- */
.crm-main,
.admin-main,
.crm-panel,
.admin-panel,
.crm-head,
.admin-head {
  min-width: 0;
}

.crm-panel,
.admin-panel {
  overflow: hidden;
}

.crm-table-wrap,
.admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.crm-table,
.admin-table {
  white-space: normal;
}

.crm-table th,
.crm-table td,
.admin-table th,
.admin-table td {
  vertical-align: middle;
}

.crm-table td,
.admin-table td {
  overflow-wrap: anywhere;
}

.crm-button,
.admin-button {
  min-height: var(--wz-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.crm-button.small,
.admin-button.small {
  min-height: 38px;
}

.crm-field input,
.crm-field select,
.crm-field textarea,
.admin-field input,
.admin-field select,
.admin-field textarea,
.admin-inline-form input,
.admin-inline-form select {
  min-height: var(--wz-touch);
}

.crm-field textarea,
.admin-field textarea {
  min-height: 116px;
  resize: vertical;
}

.crm-actions,
.admin-actions,
.crm-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.crm-empty,
.admin-empty {
  padding: 28px 22px;
  color: var(--crm-muted, var(--admin-muted, #746a63));
  line-height: 1.65;
}

.crm-list-item,
.admin-list-item {
  min-width: 0;
}

.crm-list-item :where(strong,p,small),
.admin-list-item :where(strong,p,small) {
  overflow-wrap: anywhere;
}

.crm-badge,
.admin-badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

/* Notification preferences ---------------------------------------------- */
.crm-notification-preferences,
.admin-notification-preferences {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.crm-notification-preferences label,
.admin-notification-preferences label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 15px 16px;
  border: 1px solid var(--wz-soft-line);
  border-radius: 14px;
  background: rgba(255,255,255,.58);
  cursor: pointer;
}

.crm-notification-preferences label>span,
.admin-notification-preferences label>span {
  min-width: 0;
}

.crm-notification-preferences strong,
.crm-notification-preferences small,
.admin-notification-preferences strong,
.admin-notification-preferences small {
  display: block;
}

.crm-notification-preferences strong,
.admin-notification-preferences strong {
  margin-bottom: 4px;
  font-size: 11px;
}

.crm-notification-preferences small,
.admin-notification-preferences small {
  color: var(--crm-muted, var(--admin-muted, #746a63));
  line-height: 1.5;
}

.crm-notification-preferences input,
.admin-notification-preferences input {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  accent-color: var(--crm-accent, var(--admin-accent, #7b2942));
}

/* Member card mobile refinements ---------------------------------------- */
.wz-member-dialog {
  scrollbar-width: thin;
}

.wz-member-card-copy,
.wz-member-details>div {
  min-width: 0;
}

.wz-member-details strong {
  word-break: break-word;
}

/* Tablet ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .crm-layout,
  .admin-layout {
    grid-template-columns: 1fr !important;
  }

  .crm-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-form-grid,
  .admin-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-pipeline {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(230px, 1fr));
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }

  .crm-pipeline-column {
    scroll-snap-align: start;
  }

  .marketplace-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-search-result {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .marketplace-search-result > :last-child {
    grid-column: 2;
    justify-self: start;
  }
}

/* Mobile ---------------------------------------------------------------- */
@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .vision-site :where(
    input,
    select,
    textarea
  ),
  .crm-field :where(
    input,
    select,
    textarea
  ),
  .admin-field :where(
    input,
    select,
    textarea
  ) {
    font-size: 16px;
  }

  .vision-footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 28px 18px !important;
  }

  .vision-footer-top,
  .vision-footer-bottom {
    gap: 18px;
  }

  .discovery-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    margin: 9px;
    border-radius: 22px;
  }

  .marketplace-filter-card {
    padding: 16px;
  }

  .marketplace-filter-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-search-result {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .marketplace-search-result img {
    width: 76px;
    height: 68px;
  }

  .marketplace-compare-dock {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    border-radius: 16px;
  }

  .crm-main,
  .admin-main {
    width: 100%;
    max-width: 100%;
  }

  .crm-head,
  .admin-head {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 18px;
  }

  .crm-head h1,
  .admin-head h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .crm-actions,
  .admin-actions {
    width: 100%;
  }

  .crm-actions .crm-button,
  .admin-actions .admin-button {
    flex: 1 1 150px;
  }

  .crm-grid,
  .admin-grid,
  .crm-form-grid,
  .admin-form-grid {
    grid-template-columns: 1fr !important;
  }

  .crm-field.full,
  .admin-field.full {
    grid-column: auto !important;
  }

  .crm-panel-head,
  .admin-panel-head {
    align-items: flex-start !important;
    gap: 12px;
    flex-wrap: wrap;
  }

  .crm-table {
    min-width: 720px;
  }

  .admin-table {
    min-width: 760px;
  }

  .crm-table th,
  .crm-table td,
  .admin-table th,
  .admin-table td {
    padding-inline: 12px;
  }

  .crm-pipeline {
    margin-inline: -2px;
    grid-template-columns: repeat(6, minmax(220px, 76vw));
  }

  .crm-notification-preferences label,
  .admin-notification-preferences label {
    min-height: 74px;
    padding: 14px;
  }

  .wz-member-dialog-actions a,
  .wz-member-dialog-actions button {
    flex: 1 1 160px;
  }
}

/* Small phones ----------------------------------------------------------- */
@media (max-width: 480px) {
  .vision-footer-links {
    grid-template-columns: 1fr !important;
  }

  .vision-footer-brand {
    overflow-wrap: anywhere;
  }

  .crm-main,
  .admin-main {
    padding-inline: 12px !important;
  }

  .crm-head,
  .admin-head {
    padding-inline: 18px !important;
  }

  .crm-panel,
  .admin-panel {
    border-radius: 16px !important;
  }

  .crm-stat,
  .admin-stat {
    min-height: 0;
  }

  .crm-actions .crm-button,
  .admin-actions .admin-button,
  .crm-form > .crm-button,
  .admin-form > .admin-button {
    width: 100%;
  }

  .wz-member-card {
    padding: 18px;
  }

  .wz-member-card-top {
    gap: 10px;
  }

  .wz-member-brand small {
    display: none;
  }

  .wz-member-card-person {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .wz-member-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 16px;
  }

  .wz-member-card-copy h2 {
    font-size: clamp(30px, 10vw, 40px);
  }

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

  .wz-member-card-foot {
    flex-wrap: wrap;
  }

  .wz-member-completion {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
}

@media (hover: none) {
  .vision-category-panel:hover,
  .vision-city-card:hover,
  .crm-stat:hover,
  .admin-stat:hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

/* WeddingZa 2026-10-16: global performance/navigation/mobile stability. */
.vision-site .page-wipe, .vision-site #pageWipe,
.vision-site .preloader, .vision-site .vision-preloader {display:none!important;pointer-events:none!important}
html {scroll-padding-top:108px}
[id] {scroll-margin-top:108px}
:where(.vision-site) :where(a,button,input,textarea,select):focus-visible {outline:2px solid #7b2942;outline-offset:3px}
.vision-site :where(.container,.vision-home,.vision-footer,.vision-finale,main,section,article) {min-width:0}
.vision-site img {height:auto;max-width:100%}
.vision-site :where(h1,h2,h3,p) {overflow-wrap:break-word}
.wz-journey-links {padding:35px 0 26px;border-top:1px solid rgba(255,255,255,.16)}
.wz-journey-links .container {width:min(1320px,calc(100% - 40px))}
.wz-journey-head {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:14px;flex-wrap:wrap}
.wz-journey-head strong {font:400 clamp(26px,3vw,36px)/1.1 'Instrument Serif',Georgia,serif;color:#fff9ef}
.wz-journey-head small {font:700 10px/1.7 Manrope,Arial,sans-serif;letter-spacing:.16em;color:#efc3b6;text-transform:uppercase}
.wz-journey-grid {display:flex;flex-wrap:wrap;gap:9px}
.wz-journey-grid a {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:11px 16px;border:1px solid rgba(255,255,255,.28);border-radius:99px;text-decoration:none;font:700 11px/1.4 Manrope,Arial,sans-serif;letter-spacing:.02em;color:#fff7ed;background:rgba(255,255,255,.045);transition:background .2s,border-color .2s,transform .2s}
.wz-journey-grid a:hover,.wz-journey-grid a[aria-current='page'] {background:#fff5ed;color:#69243c;border-color:#fff5ed}
.wz-journey-grid a:hover {transform:translateY(-2px)}
@media(max-width:767px){
 html{scroll-padding-top:87px}[id]{scroll-margin-top:87px}
 #siteHeader .vision-nav{width:calc(100% - 20px);max-width:100%;}
 #siteHeader .vision-brand b{font-size:clamp(17px,5vw,21px)}
 #siteHeader .vision-nav-actions{min-width:0;gap:5px}
 #siteHeader .vision-discover{padding:0 9px;min-height:40px;font-size:10px}
 #siteHeader .vision-menu-btn{width:42px;height:42px;flex-shrink:0}
 .wz-journey-links {padding:28px 0}
 .wz-journey-links .container {width:calc(100% - 28px)}
 .wz-journey-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .wz-journey-grid a {padding:10px 8px;font-size:11px;min-width:0}
 .vision-footer :where(.container) {max-width:calc(100% - 28px)}
 .vision-site :where(input,select,textarea){font-size:max(16px,1em)}
}
@media(max-width:360px){
 #siteHeader .vision-brand b{font-size:17px}
 #siteHeader .vision-discover{font-size:9px;padding:0 7px}
 #siteHeader .wz-brand-mark{width:30px;height:30px}
}
@media(prefers-reduced-motion:reduce){
 .wz-journey-grid a{transition:none}
 .vision-site :where(.reveal,.vision-reveal,.wzi-pending,.vc-pending){opacity:1!important;transform:none!important;visibility:visible!important;animation:none!important}
}
