.accessory-flow-open {
  overflow: hidden;
}

.accessory-flow-modal[hidden] {
  display: none !important;
}

.accessory-flow-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.accessory-flow-shell {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
}

.accessory-flow-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  animation: accessory-flow-fade-in 0.3s ease;
}

.accessory-flow-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  overflow: hidden;
  background: #fff;
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  animation: accessory-flow-slide-up 0.3s ease;
}

.accessory-flow-header {
  position: relative;
  flex-shrink: 0;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(180deg, #f8f6f2 0%, #ffffff 100%);
}

.accessory-flow-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #6b6b6b;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.accessory-flow-close:hover {
  background: #f2f2f2;
  color: #111;
}

.accessory-flow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid rgba(180, 140, 60, 0.3);
  border-radius: 999px;
  background: rgba(180, 140, 60, 0.1);
  color: #7a5b16;
  font-size: 11px;
  font-weight: 600;
}

.accessory-flow-badge-icon {
  flex-shrink: 0;
}

.accessory-flow-title {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111;
}

.accessory-flow-subtitle {
  margin: 0.25rem 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b6b6b;
}

.accessory-flow-subtitle strong {
  color: #111;
  font-weight: 600;
}

.accessory-flow-progress-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e8e8e8;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
}

.accessory-flow-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.accessory-flow-progress-label {
  font-weight: 600;
  color: #111;
}

.accessory-flow-progress-value {
  font-variant-numeric: tabular-nums;
  color: #6b6b6b;
}

.accessory-flow-progress-track {
  margin-top: 0.375rem;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 999px;
  background: #ececec;
}

.accessory-flow-progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #333;
  transition: width 0.5s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.accessory-flow-progress-bar.is-qualified {
  background: linear-gradient(90deg, #c9a227 0%, #e8c547 50%, #c9a227 100%);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.35);
}

.accessory-flow-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.75rem 0.25rem;
  -webkit-overflow-scrolling: touch;
}

/* Mobile */
@media (max-width: 639px) {
  .accessory-flow-shell {
    align-items: flex-end;
    padding: 0 0.75rem 0.75rem;
  }

  .accessory-flow-panel {
    position: relative;
    top: -200px;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    border-radius: 1.5rem;
  }

  .accessory-flow-header {
    padding: 1rem 1rem 0.875rem;
  }

  .accessory-flow-title {
    margin-top: 0;
    padding-right: 2.25rem;
    font-size: 18px;
    line-height: 1.3;
  }

  .accessory-flow-subtitle {
    font-size: 13px;
    line-height: 1.5;
  }

  .accessory-flow-body {
    flex: 1 1 auto;
    padding: 0.625rem 1rem 0.5rem;
  }

  .accessory-flow-body--scrollable {
    --accessory-flow-item-height: 6.75rem;
    --accessory-flow-item-gap: 0.75rem;
    --accessory-flow-visible-items: 4;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(
      (var(--accessory-flow-item-height) * var(--accessory-flow-visible-items)) +
      (var(--accessory-flow-item-gap) * (var(--accessory-flow-visible-items) - 1))
    );
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .accessory-flow-list {
    gap: 0.75rem;
  }

  .accessory-flow-card {
    gap: 1rem;
    min-height: 6.75rem;
    padding: 0.875rem;
    border-radius: 0.875rem;
  }

  .accessory-flow-check {
    width: 1.5rem;
    height: 1.5rem;
  }

  .accessory-flow-image-wrap {
    width: 5rem;
    height: 5rem;
    border-radius: 0.875rem;
  }

  .accessory-flow-footer {
    padding: 0.875rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .accessory-flow-btn {
    min-height: 2.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 14px;
    border-radius: 0.75rem;
  }
}

.accessory-flow-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.accessory-flow-item {
  margin: 0;
}

.accessory-flow-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e8e8e8;
  border-radius: 0.75rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.accessory-flow-card:hover {
  border-color: rgba(17, 17, 17, 0.3);
  background: #fafafa;
}

.accessory-flow-card.is-selected {
  border-color: rgba(17, 17, 17, 0.8);
  background: #fafafa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.accessory-flow-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #d4d4d4;
  border-radius: 0.375rem;
  background: #fff;
  color: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.accessory-flow-card.is-selected .accessory-flow-check {
  border-color: #111;
  background: #111;
  color: #fff;
}

.accessory-flow-checkbox {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.accessory-flow-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #f5f5f5;
}

.accessory-flow-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.375rem;
}

.accessory-flow-info {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0.125rem 0;
}

.accessory-flow-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accessory-flow-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111;
}

.accessory-flow-tag {
  display: none;
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(180, 140, 60, 0.15);
  color: #7a5b16;
  font-size: 11px;
  font-weight: 600;
}

.accessory-flow-price {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #111;
}

.accessory-flow-footer {
  flex-shrink: 0;
  border-top: 1px solid #ececec;
  background: #fff;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.accessory-flow-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 0;
}

.accessory-flow-error {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #fecaca;
  border-radius: 0.625rem;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.45;
}

.accessory-flow-error.is-visible {
  display: block;
}

@media (min-width: 640px) {
  .accessory-flow-error {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  #accessory-flow-modal .accessory-flow-error {
    font-size: 15px;
  }
}

.accessory-flow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.625rem;
  padding: 0.75rem 1.25rem;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.accessory-flow-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.accessory-flow-btn-secondary {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #111;
}

.accessory-flow-btn-secondary:hover:not(:disabled) {
  background: #f7f7f7;
}

.accessory-flow-btn-primary {
  border: 0;
  background: #111;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.accessory-flow-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

@keyframes accessory-flow-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes accessory-flow-slide-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .accessory-flow-shell {
    align-items: center;
    padding: 1.5rem;
  }

  .accessory-flow-panel {
    width: min(42rem, calc(100vw - 2rem));
    max-width: min(42rem, calc(100vw - 2rem));
    max-height: 88vh;
    border-radius: 1.5rem;
    animation: accessory-flow-zoom-in 0.3s ease;
  }

  .accessory-flow-header {
    padding: 2.25rem 2rem 1.25rem;
  }

  .accessory-flow-close {
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  .accessory-flow-badge {
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 12px;
  }

  .accessory-flow-title {
    margin-top: 0.75rem;
    font-size: 1.75rem;
  }

  .accessory-flow-subtitle {
    margin-top: 0.375rem;
    font-size: 17px;
  }

  .accessory-flow-progress-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 1rem;
  }

  .accessory-flow-progress-meta {
    font-size: 12px;
  }

  .accessory-flow-progress-track {
    margin-top: 0.5rem;
    height: 0.5rem;
  }

  .accessory-flow-body {
    padding: 1rem 1.5rem 0.5rem;
  }

  .accessory-flow-list {
    gap: 0.75rem;
  }

  .accessory-flow-card {
    gap: 1rem;
    padding: 1rem;
    border-radius: 1rem;
  }

  .accessory-flow-check {
    width: 1.5rem;
    height: 1.5rem;
  }

  .accessory-flow-image-wrap {
    width: 5rem;
    height: 5rem;
  }

  .accessory-flow-name {
    font-size: 15px;
  }

  .accessory-flow-tag {
    display: inline-block;
  }

  .accessory-flow-price {
    margin-top: 0.375rem;
    font-size: 1rem;
  }

  .accessory-flow-footer {
    padding: 1.25rem 2rem 1.5rem;
  }

  .accessory-flow-actions {
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0;
  }

  #accessory-flow-modal .accessory-flow-btn {
    width: auto;
    min-width: 10rem;
    min-height: 2.875rem;
    border-radius: 0.75rem;
    padding: 0.8125rem 1.5rem;
    font-size: 15px;
  }

  #accessory-flow-modal .accessory-flow-btn-primary {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

/* Tablet landscape */
@media (min-width: 768px) {
  #accessory-flow-modal .accessory-flow-panel {
    width: min(44rem, calc(100vw - 3rem));
    max-width: min(44rem, calc(100vw - 3rem));
  }
}

/* Desktop */
@media (min-width: 1024px) {
  #accessory-flow-modal .accessory-flow-shell {
    padding: 2rem;
  }

  #accessory-flow-modal .accessory-flow-panel {
    width: min(56rem, calc(100vw - 4rem));
    max-width: min(56rem, calc(100vw - 4rem));
    min-width: 40rem;
    max-height: min(88vh, 860px);
    border-radius: 1.75rem;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
  }

  #accessory-flow-modal .accessory-flow-header {
    padding: 2.5rem 2.5rem 1.5rem;
  }

  #accessory-flow-modal .accessory-flow-title {
    font-size: 2rem;
  }

  #accessory-flow-modal .accessory-flow-subtitle {
    font-size: 17px;
  }

  #accessory-flow-modal .accessory-flow-body {
    padding: 1rem 2.5rem 0.75rem;
  }

  #accessory-flow-modal .accessory-flow-card {
    gap: 1.25rem;
    padding: 1.125rem 1.25rem;
  }

  #accessory-flow-modal .accessory-flow-image-wrap {
    width: 5.5rem;
    height: 5.5rem;
  }

  #accessory-flow-modal .accessory-flow-footer {
    padding: 1.25rem 2.5rem 1.5rem;
  }

  #accessory-flow-modal .accessory-flow-actions {
    gap: 0.75rem;
  }

  #accessory-flow-modal .accessory-flow-btn {
    min-width: 11rem;
    min-height: 3rem;
    padding: 0.875rem 1.75rem;
    font-size: 15px;
  }

  #accessory-flow-modal .accessory-flow-btn-primary {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Large desktop */
@media (min-width: 1280px) {
  #accessory-flow-modal .accessory-flow-panel {
    width: min(60rem, calc(100vw - 6rem));
    max-width: min(60rem, calc(100vw - 6rem));
    min-width: 44rem;
  }
}

/* Mobile typography — must come after base styles */
@media (max-width: 639px) {
  #accessory-flow-modal .accessory-flow-card .accessory-flow-name {
    font-size: 16px;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #accessory-flow-modal .accessory-flow-card .accessory-flow-price {
    margin-top: 0.375rem;
    font-size: 13px;
    font-weight: 600;
  }
}

@keyframes accessory-flow-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
