@import url('../fonts/fonts.css');

/* ═══════════ DESIGN SYSTEM ═══════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --navy: #0f1b2d;
  --navy-light: #1a2d47;
  --gold: #c9a96e;
  --gold-light: #e0c992;
  --gold-dark: #a88a4e;
  --emerald: #10b981;
  --coral: #ef4444;
  --surface: #F3F4F6;
  --card: #ffffff;
  --border: rgba(0, 0, 0, .08);
  --text: #1a1a2e;
  --text-muted: #7a7a8e;
  --text-faint: #b0b0be;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .12);
  --shadow-glow: 0 0 0 0 rgba(201, 169, 110, .5);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --bounce: cubic-bezier(.175, .885, .32, 1.275);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased
}

.bg-grain {
  position: fixed;
  inset: 0;
  opacity: .03;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")
}

/* ═══════════ APP SHELL ═══════════ */
.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .4rem
}

.brand-logo {
  height: 22px;
  width: auto;
  display: block;
  transition: all .3s var(--ease);
  mix-blend-mode: multiply
}

.brand-logo:hover {
  opacity: .8
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 0
}

.brand-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  color: var(--navy);
  line-height: 1.1
}

.nav-tagline {
  font-size: .55rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .8
}

/* ═══════════ MAIN CONTENT ═══════════ */
.main-content {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  overflow: visible
}

.step-section {
  animation: fadeUp .5s var(--ease)
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem
}

.step-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 1rem
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .5rem
}

.section-subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  max-width: 500px;
  margin: 0 auto
}

/* ═══════════ HERO SECTION ═══════════ */
.hero-section {
  background-color: #F5EFE6;
  padding: 4rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -2.5rem -2.5rem 2.5rem -2.5rem;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-description {
  font-size: 0.95rem;
  color: #6B7280;
  line-height: 1.6;
  max-width: 90%;
}

.btn-find-matches {
  background-color: #797979;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.btn-find-matches:hover {
  background-color: #666666;
}

/* ═══════════ HOW IT WORKS ═══════════ */
.how-it-works-section {
  text-align: center;
  margin-bottom: 4rem;
}

.how-it-works-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  text-transform: uppercase;
}

.steps-container {
  display: flex;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  flex: 1;
  padding: 0 1.5rem;
}

.step-item:first-child {
  padding-left: 0;
}

.step-item:last-child {
  padding-right: 0;
}

.step-item:not(:last-child) {
  border-right: 1px solid #E5E7EB;
}

.step-number {
  width: 28px;
  height: 28px;
  background-color: #F97316;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.3rem;
}

.step-text p {
  font-size: 0.82rem;
  color: #888888;
  line-height: 1.45;
}

/* ═══════════ AI VISUALIZER HISTORY ═══════════ */
.history-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-top: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
}

.history-section.hidden {
  display: none !important;
}

.history-info {
  flex-shrink: 0;
  min-width: 160px;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.2rem;
  font-family: 'Inter', sans-serif;
}

.history-subtitle {
  font-size: 0.8rem;
  color: #9CA3AF;
  font-weight: 400;
}

.history-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB transparent;
}

.history-grid::-webkit-scrollbar {
  height: 4px;
}

.history-grid::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 4px;
}

.history-item {
  flex-shrink: 0;
  width: 140px;
  height: 90px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

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

.history-item::after {
  content: attr(title);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: white;
  font-size: 0.6rem;
  padding: 0.75rem 0.4rem 0.3rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.history-item:hover::after {
  opacity: 1;
}

/* ═══════════ UPLOAD ZONE ═══════════ */
.upload-zone {
  border: 1px dashed #CCCCCC;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  margin-bottom: 0;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #999999;
  background-color: #FAFAFA;
}

.upload-icon-circle {
  width: 56px;
  height: 56px;
  background-color: #F3F4F6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.upload-icon-circle svg {
  width: 24px;
  height: 24px;
  color: #6B7280;
}

.upload-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.5rem;
}

.upload-subtitle {
  font-size: 0.9rem;
  color: #888888;
  margin-bottom: 1.5rem;
}

.btn-browse {
  background-color: #ffffff;
  color: #2563EB;
  border: 1.5px solid #2563EB;
  padding: 0.75rem 2.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-browse:hover {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border-color: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.btn-browse:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  color: #9CA3AF;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}

.divider span {
  padding: 0 1rem;
}

/* Camera Upload Zone */
.camera-upload-zone {
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-xs);
  padding: 1.5rem;
  text-align: center;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.camera-upload-zone:hover {
  border-color: #D1D5DB;
}

.camera-upload-zone h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.camera-upload-zone p {
  font-size: 0.85rem;
  color: #6B7280;
}

/* Preview */
.preview-wrap {
  margin-top: 2rem;
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%
}

.preview-wrap img {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg)
}

.btn-change {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: .45rem .9rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: all .2s
}

.btn-change:hover {
  background: #fff;
  box-shadow: var(--shadow-sm)
}

/* Primary Button */
.btn-primary-full {
  width: 100%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2rem;
  transition: all .3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: inherit
}

.btn-primary-full:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 27, 45, .25)
}

.btn-primary-full:disabled {
  opacity: .4;
  cursor: not-allowed
}

/* ═══════════ LOADER / ANALYSIS ═══════════ */
.analysis-container {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: #1A1A1A;
}

.analysis-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.analysis-subtitle {
  font-size: 0.9rem;
  color: #6B7280;
  margin-bottom: 1.5rem;
}

.analysis-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #4B5563;
}

.analysis-status-text {
  font-size: 0.9rem;
  color: #6B7280;
  margin-bottom: 2rem;
}

.analysis-steps {
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-xs);
  text-align: left;
  margin-bottom: 1rem;
}

.analysis-step {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.9rem;
  color: #4B5563;
}

.analysis-step:last-child {
  border-bottom: none;
}

.analysis-step.done {
  color: #9CA3AF;
}

.analysis-step.active {
  background-color: #F9FAFB;
  color: #111827;
}

.step-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  margin-right: 1rem;
  flex-shrink: 0;
}

.step-circle.filled {
  background-color: #1D4ED8;
  /* Dark blue */
  border-color: #1D4ED8;
  position: relative;
}

.step-circle.filled::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  background-color: white;
  border-radius: 50%;
}

.step-circle.border {
  border-color: #1D4ED8;
  border-width: 2px;
}

.step-label {
  flex: 1;
}

.step-label strong {
  font-weight: 600;
}

.step-badge {
  background-color: #E5E7EB;
  color: #4B5563;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.analysis-step.active .step-circle.border {
  animation: stepPulse 1.4s ease-in-out infinite;
}

@keyframes stepPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.4);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(29, 78, 216, 0);
  }
}

.progress-bar-container {
  margin-bottom: 1.5rem;
}

.progress-bar-track {
  height: 4px;
  background-color: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background-color: #1D4ED8;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.progress-percentage {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1D4ED8;
}

.live-update-text {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-bottom: 0.5rem;
}

.proceed-link {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-decoration: underline;
}

.proceed-link:hover {
  color: #4B5563;
}

/* ═══════════ RESULTS TOPBAR & BOTTOMBAR ═══════════ */
.results-topbar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 1.25rem 1.5rem;
  background: white;
  border-bottom: 1px solid #E5E7EB;
  margin: -2.5rem -2.5rem 1.5rem -2.5rem;
  gap: 1rem;
}

#visualization-topbar {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.viz-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

#visualization-topbar button {
  width: 180px;
  height: 36px;
  flex-shrink: 0;
  justify-content: center;
  white-space: nowrap;
}

.results-bottombar {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.4s ease;
}

.results-bottombar.highlight-step {
  border-color: #2563EB;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}

.step-header-container {
  margin-bottom: 0.75rem;
}

.step-badge-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.step-badge-num {
  background-color: #1D4ED8;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.step-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.step-sub-desc {
  font-size: 0.82rem;
  color: #6B7280;
  margin: 0;
}

.action-and-apply-layout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Scroll Down Prompt Indicator */
.scroll-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #1E293B, #334155);
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  margin: 1.25rem auto;
  width: fit-content;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.scroll-prompt-banner:hover {
  transform: translateY(2px);
  background: linear-gradient(135deg, #0F172A, #1E293B);
}

.bounce-arrow {
  animation: bounceDown 1.2s infinite;
}

@keyframes bounceDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.selected-tiles-cards {
  display: flex;
  gap: 1rem;
  width: 100%;
  flex: none;
  flex-wrap: wrap;
}

.tile-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 140px;
}

.card-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tile-status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  min-height: 48px;
}

.tile-color-box {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tile-color-box.placeholder {
  background: #E5E7EB;
}

.tile-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-card-meta {
  font-size: 0.72rem;
  color: #6B7280;
}

/* What would you like to do action selector */
.action-selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.action-options-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.action-option-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 48px;
  min-width: 0;
}

.action-option-card:hover {
  border-color: #9CA3AF;
}

.action-option-card.active {
  border: 2px solid #2563EB;
  padding: calc(0.5rem - 1px) calc(0.75rem - 1px);
}

.action-option-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #F9FAFB;
  border-color: #E5E7EB !important;
}

.action-option-card.disabled .action-title,
.action-option-card.disabled .action-desc,
.action-option-card.disabled .action-icon {
  color: #9CA3AF !important;
}

.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  flex-shrink: 0;
}

.action-option-card.active .action-icon {
  color: #2563EB;
}

.action-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.action-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111827;
}

.action-option-card .action-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-desc {
  font-size: 0.72rem;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Apply button container */
.apply-button-wrapper {
  display: flex;
  align-items: flex-end;
  width: calc((100% - 1.5rem) / 4);
}

.btn-apply-action {
  background-color: #6B7280;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-apply-action:hover:not(:disabled) {
  background-color: #4B5563;
}

.btn-apply-action:disabled,
.btn-apply-action.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #9CA3AF !important;
}

.btn-ghost:hover {
  border-color: var(--navy);
  color: var(--navy)
}

/* Canvas Container */
.canvas-container {
  position: relative;
  margin-bottom: 1.5rem
}

.canvas-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, rgba(201, 169, 110, .08), rgba(201, 169, 110, .03));
  border: 1px solid rgba(201, 169, 110, .2);
  padding: .6rem 1rem;
  border-radius: var(--radius-xs);
  font-size: .8rem;
  color: var(--gold-dark);
  margin-bottom: 1rem;
  font-weight: 500
}

#interactive-overlays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20
}

/* ═══════════ MAIN VIEWPORT ═══════════ */
.main-view-container {
  position: relative;
  width: 100%;
  min-height: auto;
  border-radius: var(--radius);
  overflow: visible;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center
}

.selection-view,
.visualization-view {
  position: relative;
  width: 100%;
  height: auto;
  transition: all .5s var(--ease);
  display: flex;
  justify-content: center;
  align-items: center
}

.selection-view.hidden,
.visualization-view.hidden {
  display: none
}

.analyzed-image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 960px;
  height: 500px;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.analyzed-image-wrapper>img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius);
}

/* ═══════════ COMPARISON SLIDER ═══════════ */
.comparison-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: 960px;
  height: 500px;
  margin: 0 auto;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
}

.comparison-img.original {
  display: block;
  line-height: 0;
  width: 100%;
  height: 100%;
}

.comparison-img.original img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.comparison-img.generated {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  line-height: 0;
  border-right: 1px solid rgba(255, 255, 255, .4);
}

.comparison-img.generated img {
  display: block;
  height: 100%;
  width: var(--container-width, 100%);
  max-width: none;
  object-fit: contain;
  object-position: center;
}

.comparison-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  cursor: ew-resize;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center
}

.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, .5)
}

.slider-button {
  position: relative;
  width: 40px;
  height: 40px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  color: #1A1A1A;
}

.comparison-label {
  position: absolute;
  bottom: 1.5rem;
  padding: .4rem 1rem;
  background: rgba(15, 27, 45, .7);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
  z-index: 10;
  pointer-events: none
}

.comparison-label.before {
  left: 1.5rem
}

.comparison-label.after {
  right: 1.5rem
}

.viz-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #1A1A1A
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .6
  }
}

/* ═══════════ HOTSPOT MARKERS ═══════════ */
.hotspot {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transform: translate(-50%, -50%);
  transition: transform .3s var(--bounce), background .3s var(--bounce);
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  caret-color: transparent !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.hotspot:focus,
.hotspot:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  caret-color: transparent !important;
}

.hotspot::before {
  content: none;
}

.hotspot::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  transition: transform 0.2s;
  pointer-events: none;
  opacity: 1;
  bottom: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  color: transparent;
  white-space: nowrap;
  font-size: 0;
  outline: none !important;
  border: none !important;
  caret-color: transparent !important;
}

.hotspot[hidden] {
  display: none;
}

.hotspot:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 4px;
}

.hotspot.clustered::after {
  content: attr(data-count);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

.hotspot-design-picker {
  padding: 12px 16px;
  max-height: 180px;
  overflow-y: auto;
  border-bottom: 1px solid #e6e6e6;
}

.hotspot-design-picker p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.hotspot-design-option {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  text-align: left;
  white-space: normal;
  background: #f7f7f7;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.hotspot-design-option[aria-pressed="true"] {
  border-color: #1a1a1a;
  background: #eaeaea;
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 255, 255, 0.6);
}

.hotspot:hover::after {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
  bottom: auto;
}

.hotspot.pulse {
  animation: markerPulse 2s infinite
}

@keyframes markerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .6)
  }

  70% {
    box-shadow: 0 0 0 16px rgba(255, 255, 255, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0)
  }
}

.hotspot.selected {
  background: rgba(255, 255, 255, 0.6);
  animation: none;
  transform: translate(-50%, -50%) scale(1.05)
}

.hotspot.fallback {
  border: 2px dashed rgba(255, 255, 255, .7)
}

.hotspot.fallback::after {
  background: rgba(255, 255, 255, .85)
}

.hotspot.fallback.pulse {
  animation: fallbackPulse 2.5s infinite
}

@keyframes fallbackPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .5)
  }

  50% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0)
  }
}

/* ═══════════ SUGGESTION POPUP ═══════════ */
.suggestion-popup {
  position: absolute;
  left: 24px;
  top: 50%;
  width: 330px;
  max-width: 100%;
  height: auto;
  max-height: min(620px, 90vh);
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  border: 1px solid #E5E7EB;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  font-family: 'Inter', sans-serif;
  animation: popupFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #F3F4F6;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.popup-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.popup-close {
  background: #F3F4F6;
  color: #4B5563;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-weight: bold;
  line-height: 1;
  transition: all 0.2s;
}

.popup-close:hover {
  background: #E5E7EB;
  color: #111827;
}

.popup-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.popup-body::-webkit-scrollbar {
  width: 4px;
}

.popup-body::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 4px;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
  background: #ffffff;
}

.match-row:hover {
  border-color: #9CA3AF;
}

.match-row.active {
  border: 2px solid #2563EB;
  padding: 0.7rem;
  /* offset padding to make it visual border */
}

.match-row-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid #E5E7EB;
  background-color: #F3F4F6;
}

.match-row-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  display: block;
}

.match-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.match-row-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-row-desc {
  font-size: 0.8rem;
  color: #6B7280;
  margin: 0 0 0.2rem 0;
}

.match-row-score-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.2rem 0.5rem;
  background: #00249c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 2px;
  line-height: 1;
}

.btn-select-tile {
  background-color: #E5E7EB;
  color: #111827;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-tile:hover {
  background-color: #D1D5DB;
}

.match-row.active .btn-select-tile {
  background-color: #2563EB;
  color: white;
}

.match-row.active .btn-select-tile:hover {
  background-color: #1D4ED8;
}

.popup-scroll-indicator {
  text-align: center;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: #9CA3AF;
  border-bottom: 1px solid #F3F4F6;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.popup-search-container {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.popup-search-label {
  font-size: 0.75rem;
  color: #374151;
  font-weight: 500;
  line-height: 1.4;
}

.popup-search-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.popup-search-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
}

.popup-search-input:focus {
  border-color: #9CA3AF;
}

.btn-search {
  background: #6B7280;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-search:hover {
  background: #4B5563;
}

/* Connecting line overlay (disabled) */
.connecting-line {
  display: none !important;
}

/* bottom disclaimer bar */
.bottom-disclaimer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #4A4A4A;
  color: #FFFFFF;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.bottom-disclaimer-bar.hidden {
  display: none;
}

.btn-reset-original {
  background: transparent;
  border: 1px solid #D1D5DB;
  color: #6B7280;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
}

/* Popup Footer */
.popup-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  background: var(--surface)
}

.btn-confirm {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: .65rem 1.75rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit
}

.btn-confirm:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm)
}

/* ═══════════ FLOATING BAR ═══════════ */
.floating-bar {
  position: sticky;
  bottom: 1rem;
  background: var(--card);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  z-index: 100;
  border: 1px solid var(--border)
}

.floating-bar-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  font-size: .9rem;
  color: var(--text-muted)
}

.info-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: dotPulse 2s infinite
}

.floating-bar-actions {
  display: flex;
  gap: .6rem
}

.btn-action {
  border: none;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all .25s var(--ease);
  font-family: inherit;
  text-decoration: none
}

.btn-action--primary {
  background: var(--navy);
  color: #fff
}

.btn-action--primary:hover {
  background: var(--navy-light);
  transform: translateY(-1px)
}

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

.btn-action--gold:hover {
  background: var(--gold-dark);
  transform: translateY(-1px)
}

.btn-action--dark {
  background: #111;
  color: #fff
}

.btn-action--dark:hover {
  background: #000;
  transform: translateY(-1px)
}

.btn-action--ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted)
}

.btn-action--ghost:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(15, 27, 45, .03)
}

/* ═══════════ MODALS ═══════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 45, .5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 1rem;
  animation: fadeIn .25s
}

.modal-panel {
  background: var(--card);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative
}

.modal-panel--lg {
  max-width: 640px
}

.modal-panel--xl {
  max-width: 900px
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-faint);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.modal-close:hover {
  background: rgba(0, 0, 0, .05);
  color: var(--text)
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .5rem
}

.modal-desc {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1.5rem
}

/* Catalog */
.catalog-search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem
}

.catalog-search-bar input {
  flex: 1;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: .9rem;
  transition: border-color .2s
}

.catalog-search-bar input:focus {
  outline: none;
  border-color: var(--gold)
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding: .25rem
}

.catalog-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s var(--ease)
}

.catalog-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md)
}

.catalog-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block
}

.catalog-card-info {
  padding: .75rem
}

.catalog-card-info h4 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .2rem
}

.catalog-card-info span {
  font-size: .7rem;
  color: var(--text-faint)
}

.catalog-card-info .cat-price {
  font-weight: 700;
  color: var(--navy);
  display: block;
  margin-top: .3rem;
  font-size: .8rem
}

/* ═══════════ TOAST / WARNINGS ═══════════ */
.toast-warning {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(252, 211, 77, .1);
  border: 1px solid rgba(252, 211, 77, .3);
  color: #92400e;
  padding: .6rem 1rem;
  border-radius: var(--radius-xs);
  font-size: .8rem;
  margin-bottom: 1rem
}

.status-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem;
  border-radius: var(--radius-xs);
  margin-bottom: 1rem;
  font-size: .9rem
}

/* Prevent negative top margins from overlapping the status/error container when it is active */
#status-container:not(:empty) + .step-section > .hero-section,
#status-container:not(:empty) ~ .step-section > .results-topbar {
  margin-top: 0 !important;
}

/* ═══════════ VISUALIZATION LAYOUT (Window 4) ═══════════ */
.visualization-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.visualization-left {
  flex: 1;
  min-width: 0;
}

.visualization-right {
  width: 360px;
  flex-shrink: 0;
}

/* New Topbar Buttons */
.btn-outline {
  background: transparent;
  border: 1px solid #D1D5DB;
  color: #4B5563;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-outline:hover {
  background: #F9FAFB;
  color: #111827;
}

.btn-dark-grey {
  background: #8D8D8D;
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-dark-grey:hover {
  background: #6B7280;
}

/* Sidebar Card */
.sidebar-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #1A1A1A;
  font-family: 'Inter', sans-serif;
}

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

.sidebar-tile-card {
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  padding: 0.75rem;
}

.sidebar-tile-label {
  font-size: 0.65rem;
  color: #9CA3AF;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.sidebar-tile-content {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.sidebar-tile-color {
  width: 52px;
  height: 52px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sidebar-tile-info {
  flex: 1;
}

.sidebar-tile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.15rem;
  font-family: 'Inter', sans-serif;
}

.sidebar-tile-desc {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.4rem;
}

.sidebar-tile-badge {
  display: inline-block;
  background: #1D4ED8;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #E5E7EB;
}

.btn-add-to-cart,
.btn-finish-design {
  width: 100%;
  background: #5A5A5A;
  color: white;
  border: none;
  padding: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-to-cart:hover,
.btn-finish-design:hover {
  background: #444444;
}

/* ═══════════ UTILITIES ═══════════ */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.hidden {
  display: none !important
}


/* ═══════════ CART REVIEW STYLING ═══════════ */
.cart-review-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeUp .5s var(--ease);
  text-align: left;
}

.cart-review-view.hidden {
  display: none !important;
}

.cart-review-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  width: 100%;
}

.cart-review-header.single-item,
.cart-review-header:has(+ .cart-review-layout .cart-items-container > .cart-item-card:only-child) {
  max-width: 540px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.cart-review-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-top: 0.75rem;
}

.cart-review-subtitle {
  font-size: 0.95rem;
  color: #6B7280;
}

.cart-review-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 100%;
}

.cart-review-layout.single-item,
.cart-review-layout:has(.cart-items-container > .cart-item-card:only-child) {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.cart-items-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.cart-items-container.single-item,
.cart-items-container:has(> .cart-item-card:only-child) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  grid-template-columns: none !important;
  max-width: 540px !important;
  width: 100% !important;
  flex: none !important;
  margin: 0 auto !important;
}

.cart-items-container.single-item .cart-item-card,
.cart-items-container:has(> .cart-item-card:only-child) .cart-item-card {
  width: 100% !important;
  max-width: 540px !important;
}

.cart-review-layout.single-item .cart-sidebar-container,
.cart-review-layout:has(.cart-items-container > .cart-item-card:only-child) .cart-sidebar-container {
  width: 100% !important;
  max-width: 540px !important;
  margin: 0 auto !important;
}

.cart-item-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.cart-item-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  text-transform: none;
}

.cart-item-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: #F3F4F6;
}

.cart-item-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.cart-item-subtitle {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: -0.5rem;
}

.cart-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cart-specs-table tr {
  border-bottom: 1px solid #F3F4F6;
}

.cart-specs-table tr:last-child {
  border-bottom: none;
}

.cart-specs-table td {
  padding: 0.5rem 0;
}

.cart-specs-table td.spec-label {
  color: #6B7280;
  text-align: left;
}

.cart-specs-table td.spec-value {
  color: #111827;
  font-weight: 600;
  text-align: right;
}

.cart-item-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-family: 'Inter', sans-serif;
  text-align: left;
}

.cart-quantity-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.quantity-label {
  font-size: 0.75rem;
  color: #6B7280;
  display: block;
  margin-bottom: 0.25rem;
  text-align: left;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
}

.btn-qty {
  background: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  transition: background 0.2s;
}

.btn-qty:hover {
  background: #F9FAFB;
}

.qty-input {
  width: 40px;
  height: 32px;
  border: none;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  background: #fff;
  outline: none;
}

.btn-cart-action {
  width: 100%;
  background: #8C8681;
  color: white;
  border: none;
  padding: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  margin-top: auto;
}

.btn-cart-action:hover {
  background: #7D7772;
}

.btn-cart-action.added {
  background: #10b981;
}

.cart-sidebar-container {
  width: 300px;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: none;
  border-top: 4px solid var(--navy);
  text-align: left;
}

.sidebar-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  border-bottom: 1px solid #F3F4F6;
  padding-bottom: 0.5rem;
}

.sidebar-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #6B7280;
}

.sidebar-divider {
  border-top: 1px solid #E5E7EB;
  margin: 0.25rem 0;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin-top: 0.25rem;
}

.summary-total-desc {
  font-size: 0.7rem;
  color: #9CA3AF;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.btn-checkout {
  width: 100%;
  background: #5A5A5A;
  color: white;
  border: none;
  padding: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  margin-bottom: 0.25rem;
}

.btn-checkout:hover {
  background: #404040;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #4B5563;
}

.checklist-dot {
  width: 5px;
  height: 5px;
  background: #ef4444;
  border-radius: 50%;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media(max-width:1100px) {
  .app-shell {
    padding: .5rem
  }

  .main-content {
    padding: 1.5rem
  }

  .nav-bar {
    padding: .75rem 1rem
  }

  .nav-tagline {
    display: none
  }

  .section-title {
    font-size: 1.5rem
  }

  /* Negative margins alignment on mobile */
  .hero-section {
    padding: 2rem 1.25rem;
    flex-direction: column;
    gap: 1rem;
    margin: -1.5rem -1.5rem 2rem -1.5rem;
  }

  .hero-content {
    max-width: 100%;
  }

  /* Redesigned responsive results topbar */
  .results-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  }

  .selected-tiles-cards {
    width: 100%;
    flex: none;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .tile-card-wrapper {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 120px;
  }

  .action-selector-wrapper {
    width: 100%;
    flex: none;
  }

  .action-options-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .apply-button-wrapper {
    width: calc((100% - 0.5rem) / 2);
    flex: none;
  }

  .btn-visualize-top {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-left: 0;
  }

  /* Step item layout on mobile */
  .steps-container {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

  .step-item {
    width: 100%;
    max-width: 340px;
    border-right: none !important;
    padding: 0 !important;
  }

  /* Upload zone padding */
  .upload-zone {
    padding: 2.5rem 1.25rem;
  }

  /* Popup modal on mobile */
  .suggestion-popup {
    position: fixed;
    width: 100%;
    max-height: 80vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 16px 16px 0 0;
    animation: slideUpMobile 0.35s var(--ease);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    z-index: 2000;
  }

  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  .popup-body {
    max-height: 45vh;
  }

  .match-row-thumb {
    width: 64px;
    height: 64px;
  }

  .catalog-search-bar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .catalog-search-bar button {
    width: 100%;
  }

  /* Catalog modal overrides */
  .modal-panel {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .modal-title {
    font-size: 1.4rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    max-height: 300px;
  }

  /* Touch Slider and Labels */
  .slider-button {
    width: 44px;
    height: 44px;
  }

  .comparison-label {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    bottom: 1rem;
  }

  .comparison-label.before {
    left: 1rem;
  }

  .comparison-label.after {
    right: 1rem;
  }

  .floating-bar {
    flex-direction: column;
    gap: .75rem;
    text-align: center
  }

  .visualization-layout {
    flex-direction: column
  }

  .visualization-right {
    width: 100%
  }

  /* Hide connecting line on tablet/mobile sheet */
  .connecting-line {
    display: none !important;
  }

  /* Cart Review Mobile Adjustments */
  .cart-review-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .cart-items-container,
  .cart-items-container.single-item {
    width: 100%;
    max-width: 520px;
    flex: none;
    grid-template-columns: 1fr;
  }

  .cart-item-card {
    min-width: 280px;
    width: 100%;
  }

  .cart-sidebar-container {
    width: 100%;
    max-width: 520px;
  }
}

/* ═══════════ MOBILE POPUP BACKDROP ═══════════ */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 45, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1500;
  animation: fadeIn 0.25s ease-out;
}

/* ═══════════ EXTRA MOBILE RESPONSIVENESS ═══════════ */
@media(max-width:576px) {
  #visualization-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .viz-topbar-actions {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

  #visualization-topbar button {
    width: 100%;
  }

  .hero-section {
    padding: 1.5rem 1rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  }

  .hero-title,
  .hero-subtitle {
    font-size: 1.5rem !important;
  }

  .hero-description {
    font-size: 0.85rem;
    max-width: 100%;
  }

  .main-content {
    padding: 1rem;
  }

  .upload-zone {
    padding: 2.5rem 1rem;
  }

  .upload-title {
    font-size: 1.1rem;
  }

  .upload-subtitle {
    font-size: 0.8rem;
  }

  .action-options-row {
    grid-template-columns: 1fr;
  }

  .apply-button-wrapper {
    width: 100%;
  }

  .tile-card-wrapper {
    flex: 1 1 100% !important;
  }

  .modal-panel {
    padding: 1rem !important;
    border-radius: 8px !important;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)) !important;
    gap: 0.5rem !important;
  }
}

/* ═══════════ LAST PAGE ACTION BUTTONS (SIDEBAR FOOTER) ═══════════ */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.last-page-action-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  font-family: inherit;
  box-sizing: border-box;
  min-height: 52px;
}

.last-page-action-card:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.last-page-action-card:active {
  background: #F3F4F6;
  transform: translateY(0);
}

.last-page-action-card .action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.last-page-action-card .action-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.last-page-action-card .action-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
}

.last-page-action-card .action-desc {
  font-size: 0.74rem;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.last-page-action-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #F9FAFB;
  border-color: #E5E7EB !important;
  box-shadow: none;
}

.last-page-action-card:disabled .action-title,
.last-page-action-card:disabled .action-desc,
.last-page-action-card:disabled .action-icon {
  color: #9CA3AF !important;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.btn-download-pdf {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #ffffff;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 14px rgba(15, 27, 45, 0.15);
}

.btn-download-pdf:hover {
  background: linear-gradient(135deg, #16263e 0%, #223a5d 100%);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 27, 45, 0.22);
}

.btn-download-pdf svg {
  color: var(--gold-light);
}

.btn-whatsapp-rocell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp-rocell:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

.btn-download-pdf:disabled,
.btn-whatsapp-rocell:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ═══════════ EXACT ROCELL INSPIRESPACE PDF EXPORT THEME ═══════════ */
.pdf-page,
.pdf-page * {
  font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pdf-page {
  width: 1080px;
  min-height: auto;
  height: auto;
  box-sizing: border-box;
  background: #FFFFFF;
  padding: 38px 46px 36px 46px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: #111827;
  position: relative;
  overflow: hidden;
}

.pdf-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.pdf-header-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  background: #FFFFFF;
}

.pdf-header-text {
  display: flex;
  flex-direction: column;
}

.pdf-header-title {
  font-size: 32px;
  font-weight: 400;
  color: #000000;
  margin: 0 0 2px 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.pdf-header-subtitle {
  font-size: 16px;
  color: #333333;
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
}

/* Before and After Visuals Section - Supports 1, 2, or 3 images with Portrait / Landscape Layouts */
.pdf-images-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 22px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pdf-images-row {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  box-sizing: border-box;
}

/* 1 Image: Single image centered */
.pdf-images-section.single-image .pdf-images-row {
  justify-content: center;
  align-items: center;
}

.pdf-images-section.single-image .pdf-image-col {
  max-width: 580px;
  width: 100%;
}

.pdf-images-section.single-image .pdf-image-box {
  max-height: 520px;
}

.pdf-images-section.single-image .pdf-image-box img {
  max-height: 520px;
}

/* 2 Portrait Images: BOTH on ONE line (side-by-side) */
.pdf-images-section.two-portrait-images .pdf-images-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.pdf-images-section.two-portrait-images .pdf-image-col {
  flex: 1 1 calc(50% - 10px);
  max-width: calc(50% - 10px);
  display: flex;
  flex-direction: column;
}

.pdf-images-section.two-portrait-images .pdf-image-box {
  max-height: 540px;
}

.pdf-images-section.two-portrait-images .pdf-image-box img {
  max-height: 540px;
}

/* 2 Landscape Images: TWO lines for the two images */
.pdf-images-section.two-landscape-images {
  gap: 16px;
}

.pdf-images-section.two-landscape-images .pdf-images-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.pdf-images-section.two-landscape-images .pdf-image-col {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
}

.pdf-images-section.two-landscape-images .pdf-image-box {
  max-height: 360px;
}

.pdf-images-section.two-landscape-images .pdf-image-box img {
  max-height: 360px;
}

/* 3 Images: Line 1 for first two images, Line 2 for third image (both portrait and landscape) */
.pdf-images-section.three-images {
  gap: 16px;
}

.pdf-images-section.three-images .two-cols-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.pdf-images-section.three-images .two-cols-row .pdf-image-col {
  flex: 1 1 calc(50% - 10px);
  max-width: calc(50% - 10px);
  display: flex;
  flex-direction: column;
}

.pdf-images-section.three-images .third-image-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.pdf-images-section.three-images .third-image-row .pdf-image-col {
  width: 100%;
  max-width: calc(50% - 10px);
  display: flex;
  flex-direction: column;
}

/* Heights for 3 Portrait images */
.pdf-images-section.three-images.portrait-mode .pdf-image-box {
  max-height: 340px;
}

.pdf-images-section.three-images.portrait-mode .pdf-image-box img {
  max-height: 340px;
}

/* Heights for 3 Landscape images */
.pdf-images-section.three-images.landscape-mode .pdf-image-box {
  max-height: 310px;
}

.pdf-images-section.three-images.landscape-mode .pdf-image-box img {
  max-height: 310px;
}

.pdf-image-col {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.pdf-image-label {
  font-size: 15.5px;
  font-weight: 500;
  color: #1F2937;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-image-box {
  width: 100%;
  height: auto;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pdf-image-box img {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  margin: 0 auto;
}

/* Matched Tile Specifications Section - COMPACT CARDS */
.pdf-products-section {
  width: 100%;
  margin-bottom: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.pdf-section-title {
  font-size: 17px;
  font-weight: 400;
  color: #1F2937;
  margin-bottom: 12px;
}

.pdf-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.pdf-products-grid.single-item {
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: 0 auto;
}

.pdf-products-grid.two-items {
  grid-template-columns: repeat(2, 1fr);
  max-width: 880px;
  gap: 24px;
  margin: 0 auto;
}

.pdf-products-grid.four-items {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.pdf-products-grid.six-items {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.pdf-products-grid.many-items {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.pdf-product-card {
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  padding: 16px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: auto;
}

.pdf-card-badge {
  align-self: flex-start;
  background: #D8DFE6;
  color: #475467;
  font-size: 11px;
  font-weight: 500;
  padding: 3.5px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.pdf-card-img-wrap {
  width: 100%;
  height: 165px;
  background: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 6px;
}

.pdf-card-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.pdf-card-name {
  font-size: 16px;
  font-weight: 500;
  color: #111827;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-card-code {
  font-size: 10.5px;
  color: #888888;
  margin: 0 0 4px 0;
  letter-spacing: 0.03em;
  font-weight: 400;
}

.pdf-card-collection {
  font-size: 12px;
  color: #4B5563;
  margin: 0 0 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 17px;
  font-weight: 400;
}

.pdf-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.pdf-specs-table tr {
  border-bottom: 1px solid #F0F2F5;
}

.pdf-specs-table td {
  padding: 4.5px 0;
  font-size: 11px;
  font-weight: 400;
}

.pdf-specs-table td.spec-key {
  color: #6B7280;
  text-align: left;
}

.pdf-specs-table td.spec-val {
  color: #111827;
  text-align: right;
}

.pdf-card-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 2px;
}

.pdf-view-btn {
  background: #D0D5DD;
  color: #475467 !important;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  padding: 6.5px 20px;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-block;
  letter-spacing: 0.01em;
}

/* Footer Section */
.pdf-footer {
  border-top: 1px solid #E5E7EB;
  padding-top: 14px;
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  flex-shrink: 0;
}

.pdf-disclaimer {
  font-size: 9.5px;
  line-height: 1.45;
  color: #6B7280;
  max-width: 640px;
  font-weight: 400;
}

.pdf-contact-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 10px;
  color: #4B5563;
}

.pdf-contact-title {
  font-size: 11px;
  font-weight: 400;
  color: #1F2937;
  margin-bottom: 2px;
}

.pdf-contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #4B5563;
  font-weight: 400;
}

/* ═══════════ COMPACT SINGLE-PAGE LAYOUT (FOR 4+ PRODUCTS) ═══════════ */
.pdf-page.compact-layout {
  padding: 24px 38px 18px 38px;
}

.pdf-page.compact-layout .pdf-header {
  padding-bottom: 8px;
  margin-bottom: 10px;
  gap: 12px;
}

.pdf-page.compact-layout .pdf-header-logo {
  width: 44px;
  height: 44px;
}

.pdf-page.compact-layout .pdf-header-title {
  font-size: 24px;
  margin: 0 0 1px 0;
}

.pdf-page.compact-layout .pdf-header-subtitle {
  font-size: 13px;
}

/* Compact Visuals Section */
.pdf-page.compact-layout .pdf-images-section {
  margin-bottom: 10px;
}

.pdf-page.compact-layout .pdf-image-label {
  font-size: 12px;
  margin-bottom: 4px;
}

.pdf-page.compact-layout .pdf-images-section.single-image .pdf-image-box,
.pdf-page.compact-layout .pdf-images-section.single-image .pdf-image-box img {
  max-height: 380px;
}

.pdf-page.compact-layout .pdf-images-section.two-portrait-images .pdf-image-box,
.pdf-page.compact-layout .pdf-images-section.two-portrait-images .pdf-image-box img {
  max-height: 380px;
}

.pdf-page.compact-layout .pdf-images-section.two-landscape-images {
  gap: 8px;
}

.pdf-page.compact-layout .pdf-images-section.two-landscape-images .pdf-image-box,
.pdf-page.compact-layout .pdf-images-section.two-landscape-images .pdf-image-box img {
  max-height: 200px;
}

.pdf-page.compact-layout .pdf-images-section.three-images {
  gap: 8px;
}

.pdf-page.compact-layout .pdf-images-section.three-images.portrait-mode .pdf-image-box,
.pdf-page.compact-layout .pdf-images-section.three-images.portrait-mode .pdf-image-box img {
  max-height: 200px;
}

.pdf-page.compact-layout .pdf-images-section.three-images.landscape-mode .pdf-image-box,
.pdf-page.compact-layout .pdf-images-section.three-images.landscape-mode .pdf-image-box img {
  max-height: 180px;
}

/* Compact Products Section */
.pdf-page.compact-layout .pdf-products-section {
  margin-bottom: 8px;
}

.pdf-page.compact-layout .pdf-section-title {
  font-size: 14px;
  margin-bottom: 8px;
}

.pdf-page.compact-layout .pdf-product-card {
  padding: 8px 10px 10px 10px;
  border-radius: 6px;
}

.pdf-page.compact-layout .pdf-card-badge {
  font-size: 8.5px;
  padding: 2px 6px;
  margin-bottom: 5px;
}

.pdf-page.compact-layout .pdf-card-name {
  font-size: 11.5px;
  margin: 0 0 1px 0;
}

.pdf-page.compact-layout .pdf-card-code {
  font-size: 8px;
  margin: 0 0 2px 0;
}

.pdf-page.compact-layout .pdf-card-collection {
  font-size: 9px;
  margin: 0 0 5px 0;
  min-height: 12px;
}

.pdf-page.compact-layout .pdf-specs-table {
  margin-bottom: 5px;
}

.pdf-page.compact-layout .pdf-specs-table td {
  padding: 1.5px 0;
  font-size: 8.5px;
}

.pdf-page.compact-layout .pdf-card-btn-wrap {
  margin-top: 5px;
}

.pdf-page.compact-layout .pdf-view-btn {
  font-size: 8.5px;
  padding: 3px 10px;
}

/* 4-Item Grid Card Heights */
.pdf-page.compact-layout .pdf-products-grid.four-items .pdf-card-img-wrap {
  height: 85px;
  margin-bottom: 6px;
}

/* 5-6 Items and 7+ Items Multi-Row Card Adjustments */
.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-product-card,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-product-card {
  padding: 6px 8px 8px 8px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-card-img-wrap,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-card-img-wrap {
  height: 60px;
  margin-bottom: 4px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-card-name,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-card-name {
  font-size: 10.5px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-card-collection,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-card-collection {
  font-size: 8.5px;
  margin-bottom: 3px;
  min-height: 10px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-specs-table,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-specs-table {
  margin-bottom: 3px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-specs-table td,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-specs-table td {
  padding: 1px 0;
  font-size: 8px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-card-btn-wrap,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-card-btn-wrap {
  margin-top: 4px;
}

.pdf-page.compact-layout .pdf-products-grid.six-items .pdf-view-btn,
.pdf-page.compact-layout .pdf-products-grid.many-items .pdf-view-btn {
  font-size: 8px;
  padding: 2.5px 8px;
}

/* Compact Footer */
.pdf-page.compact-layout .pdf-footer {
  padding-top: 8px;
}

.pdf-page.compact-layout .pdf-disclaimer {
  font-size: 8px;
  line-height: 1.35;
}

.pdf-page.compact-layout .pdf-contact-box {
  font-size: 8.5px;
  gap: 2px;
}

.pdf-page.compact-layout .pdf-contact-title {
  font-size: 9.5px;
  margin-bottom: 1px;
}

/* ═══════════ PDF PREVIEW MODAL ═══════════ */
.pdf-preview-panel {
  max-width: 680px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 27, 45, 0.3);
  overflow: hidden;
}

.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.pdf-preview-header .modal-title {
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
}

.pdf-preview-header .modal-desc {
  font-size: 0.8rem;
  margin-bottom: 0;
  color: #6B7280;
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 2.2rem; /* reserve room for modal-close */
}

.pdf-preview-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: #F3F4F6;
  border-radius: 12px;
  padding: 1.25rem;
  min-height: 200px;
}

.pdf-preview-stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.pdf-preview-page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.pdf-preview-page-label {
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  background: #E5E7EB;
  padding: 4px 12px;
  border-radius: 12px;
}

.pdf-preview-img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  display: block;
}

@media (max-width: 768px) {
  .pdf-preview-panel {
    max-width: 95vw;
    padding: 1rem;
  }
  .pdf-preview-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .pdf-preview-actions {
    width: 100%;
    margin-right: 0;
    margin-top: 0.5rem;
  }
  .pdf-preview-actions .btn-download-pdf {
    width: 100% !important;
  }
}
