/* =============================================================
   pages/product.css — PRODUCT / REGISTRATION PAGE
   ============================================================= */

.product-shell {
  --flow-lift: 100px;
  padding: calc(var(--nav-height) + var(--space-xl) - var(--flow-lift)) var(--page-pad-x) var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── Header ── */
.product-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-xl);
}

.product-hero h1 { margin-bottom: var(--space-sm); }

.product-hero p {
  font-size: var(--size-md);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Categories grid ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

/* ── Category card / code window ── */
.code-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition);
}

.code-window:hover,
.code-window.selected {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.code-content {
  padding: var(--space-md);
  text-align: center;
}

.category-icon {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.code-window.selected .category-icon { color: var(--accent); }

.category-title {
  font-size: var(--size-base);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 4px;
}

.category-desc {
  font-size: var(--size-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.category-desc-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-desc-stack strong {
  display: block;
  color: var(--text);
  font-size: var(--size-xs);
  font-weight: 600;
  line-height: 1.3;
}

/* ── Upload modal ── */
.registration-page.product-upload-open {
  overflow: hidden;
}

.product-upload-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.product-upload-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.registration-page.product-scan-progress-open {
  overflow: hidden;
}

.product-scan-progress-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.product-scan-progress-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.product-upload-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--modal-border);
  border-radius: var(--radius-lg);
  background: var(--modal-bg);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.97);
  transition: transform var(--transition-slow);
}

.product-upload-modal.is-open .product-upload-dialog {
  transform: translateY(0) scale(1);
}

.product-scan-progress-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: 24px 22px;
  border: 1px solid var(--modal-border);
  border-radius: var(--radius-lg);
  background: var(--modal-bg);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.97);
  transition: transform var(--transition-slow);
}

.product-scan-progress-modal.is-open .product-scan-progress-dialog {
  transform: translateY(0) scale(1);
}

.product-upload-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.product-scan-progress-close {
  /* Tarama sonuca ulasana kadar bu modal kapatilamasin - X butonu gizli. */
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.product-upload-close:hover {
  color: var(--text);
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.product-scan-progress-close:hover {
  color: var(--text);
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.product-scan-progress-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 10px 12px;
  text-align: center;
}

.product-scan-progress-stage[hidden] {
  display: none;
}

.product-scan-progress-title,
.product-scan-progress-label,
.product-scan-progress-duration,
.product-scan-progress-timer {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.product-scan-progress-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.product-scan-progress-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.product-scan-progress-duration {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.product-scan-progress-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 136px;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
}

.product-scan-progress-timer strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.product-scan-progress-timer strong[hidden] {
  display: none;
}

.product-upload-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 6px 28px 10px;
  text-align: center;
}

.product-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 24px;
}

.product-upload-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.product-upload-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--size-sm);
  line-height: 1.35;
}

.product-upload-head p::after {
  content: '';
  display: block;
  width: 96px;
  height: 1px;
  margin: 10px auto 0;
  background: rgba(244, 241, 234, 0.26);
}

.product-upload-copy {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 2px;
  color: var(--text-muted);
  text-align: center;
}

.product-upload-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.product-upload-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.product-upload-copy p:empty {
  display: none;
}

.product-upload-copy .product-upload-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.product-balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-align: left;
}

.product-balance-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.product-balance-value {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.video-scan-layer {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-align: left;
}

.video-scan-layer[hidden] {
  display: none;
}

.video-scan-layer h4 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.video-scan-layer-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.video-scan-layer-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.video-scan-layer-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.video-scan-layer-item i {
  color: rgba(244, 241, 234, 0.42);
  font-size: 10px;
  transition: color var(--transition);
}

.video-scan-layer-item:has(input:checked) {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
}

.video-scan-layer-item:has(input:checked) i {
  color: #22c55e;
}

.video-scan-accuracy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.video-scan-accuracy[hidden] {
  display: none;
}

.video-scan-accuracy strong {
  color: var(--accent);
  font-size: 12px;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: var(--space-md);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-zone-icon {
  font-size: 36px;
  color: var(--text-faint);
  margin-bottom: var(--space-sm);
}

.upload-zone-text {
  font-size: var(--size-base);
  color: var(--text-muted);
}

.upload-zone-sub {
  font-size: var(--size-sm);
  color: var(--text-faint);
  margin-top: 4px;
}

.product-upload-dialog .upload-zone {
  margin-bottom: 14px;
  padding: 22px 16px;
  border-radius: var(--radius-md);
}

.upload-selected-file {
  margin: -6px 0 14px;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-selected-file[hidden] {
  display: none;
}

.product-upload-dialog .upload-zone-icon {
  margin-bottom: 10px;
  font-size: 30px;
}

.product-upload-dialog .upload-zone-text {
  font-size: var(--size-base);
  font-weight: 600;
  color: var(--text);
}

.product-upload-dialog .upload-zone-sub {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-search-field {
  margin-bottom: 14px;
}

.name-search-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--size-base);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.name-search-input::placeholder {
  color: var(--text-faint);
}

.name-search-input:focus {
  border-color: var(--input-focus);
  background: var(--bg-card-hover);
}

.scan-cta {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: var(--font);
  font-size: var(--size-base);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.scan-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.scan-cta:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ── Progress steps ── */
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space-md);
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border-left: 3px solid transparent;
  font-size: var(--size-sm);
  color: var(--text-muted);
  transition: all var(--transition);
}

.step.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.step.completed {
  background: rgba(34, 197, 94, 0.12);
  border-left-color: #22c55e;
  color: #22c55e;
}

.step.failed {
  background: rgba(239, 68, 68, 0.12);
  border-left-color: #ef4444;
  color: #ef4444;
}

/* ── Responsive ── */

@media (max-width: 767px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .product-shell {
    --flow-lift: 0px;
    padding-top: var(--space-md);
  }

  .product-upload-modal {
    padding: 12px;
  }

  .product-scan-progress-modal {
    padding: 12px;
  }

  .product-upload-dialog {
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: var(--radius-md);
  }

  .product-scan-progress-dialog {
    padding: 20px 18px;
    border-radius: var(--radius-md);
  }

  .product-upload-head {
    padding-bottom: 10px;
  }

  .product-upload-icon {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }

  .product-upload-head h2 {
    font-size: 17px;
  }

  .product-upload-dialog .upload-zone {
    padding: 16px 14px;
  }

  .product-upload-copy {
    gap: 5px;
    margin-bottom: 12px;
  }

  .product-upload-copy h3 {
    font-size: 14px;
  }

  .product-upload-copy p,
  .product-upload-copy .product-upload-kicker {
    font-size: 11.5px;
  }

  .video-scan-layer {
    gap: 8px;
    padding: 10px;
  }

  .product-balance-preview {
    padding: 9px 10px;
  }

  .product-balance-value {
    font-size: 13px;
  }

  .video-scan-layer-grid {
    gap: 4px;
  }

  .video-scan-layer-item {
    min-height: 26px;
    gap: 3px;
    padding: 0 2px;
    font-size: 10px;
  }

  .scan-cta {
    height: 44px;
  }

  .product-scan-progress-stage {
    gap: 8px;
    padding: 24px 6px 8px;
  }

  .product-scan-progress-title {
    font-size: 15px;
  }

  .product-scan-progress-timer {
    min-width: 124px;
    padding: 12px 14px;
    font-size: 24px;
  }
}

@media (max-width: 479px) {
  .categories-grid { grid-template-columns: 1fr; }
}

/* ── Adult scan dual upload zone ── */
.adult-scan-dual-zone {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.adult-scan-dual-zone[hidden] {
  display: none;
}

.adult-scan-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: none;
  color: var(--text);
  font-size: var(--size-base);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.adult-scan-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.adult-scan-btn i {
  font-size: 24px;
  color: var(--text-muted);
}
