/* Visualize page - aligned with visualize.php structure */

body.visualize-modal-open {
  overflow: hidden;
  touch-action: none;
}

.visualize-hero {
  padding: 34px 0 18px;
}

.visualize-hero .hero-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.visualize-hero .hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 62ch;
}

.instructions-section {
  padding: 10px 0 18px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-card,
.artwork-card,
.form-panel {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: var(--shadowSoft);
}

.step-card {
  padding: 16px;
}

.step-icon {
  font-size: 26px;
  margin-bottom: 10px;
}

.step-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.step-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gallery-title {
  margin: 0;
  font-size: 22px;
}

#show-all-artworks-btn {
  white-space: nowrap;
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.artwork-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.artwork-card:hover {
  transform: translateY(-2px);
}

.artwork-card.selected {
  border-color: rgba(183,154,98,.65);
  box-shadow: 0 16px 40px rgba(0,0,0,.12), 0 0 0 3px rgba(183,154,98,.10);
}

.artwork-media {
  background: rgba(0,0,0,.04);
}

.artwork-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.artwork-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.artwork-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.artwork-details {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.artwork-select-btn {
  margin-top: auto;
  width: 100%;
  border-radius: 999px;
  padding: 12px 14px;
  border: 1px solid rgba(183,154,98,.55);
  background: rgba(183,154,98,.12);
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.artwork-select-btn:hover,
.artwork-select-btn:focus-visible {
  background: rgba(183,154,98,.18);
}

.form-panel {
  padding: 22px;
}

.form-header {
  margin-bottom: 18px;
}

.form-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.form-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 18px;
  align-items: start;
}

.form-left,
.form-right {
  min-width: 0;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent2);
  margin-bottom: 6px;
}

.form-note,
.microcopy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

#room-image {
  width: 100%;
}

.selected-label {
  font-weight: 800;
  margin-bottom: 8px;
}

.selected-artwork-info {
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.74);
  border-radius: 16px;
  padding: 14px;
}

.image-preview {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.04);
}

.image-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form-actions .btn {
  flex: 1 1 220px;
}

.empty-artworks {
  grid-column: 1 / -1;
  background: rgba(255,255,255,.82);
  border: 1px dashed rgba(0,0,0,.12);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.artworks-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.artworks-modal.open {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.48);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  max-height: min(88vh, 88dvh);
  margin: 4vh auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.97);
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.96);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.95);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.modal-body {
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 980px) {
  .artwork-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-layout {
    grid-template-columns: 1fr;
  }
}

/* הנחיות שליחת תמונה */
.how-to-send-box {
  background: var(--surface, #f8f6f2);
  border: 1px solid var(--border, #e0dbd4);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.how-to-send-title {
  font-weight: 700;
  margin: 0 0 10px;
  font-size: 15px;
}

.how-to-send-steps {
  margin: 0;
  padding-right: 20px;
  line-height: 1.9;
  font-size: 14px;
  color: var(--text, #222);
}

@media (max-width: 640px) {
  .steps-grid,
  .artwork-grid {
    grid-template-columns: 1fr;
  }

  .gallery-header {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-title {
    font-size: 20px;
  }

  .form-panel {
    padding: 16px;
  }

  .modal-content {
    width: calc(100vw - 20px);
    max-height: min(92vh, 92dvh);
    margin: 10px auto;
    border-radius: 18px;
  }

  .modal-header,
  .modal-body {
    padding: 14px;
  }

  .form-actions .btn,
  #show-all-artworks-btn,
  .artwork-select-btn,
  .close-btn {
    min-height: 46px;
  }
}
