/* Generic Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-brand);
  color: #0e0f12;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-brand-glow);
}

.btn-primary:hover {
  background: var(--accent-brand-hover);
  color: #0e0f12;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--status-loss-bg);
  border-color: var(--status-loss-border);
  color: var(--status-loss);
}

.btn-danger:hover {
  background: var(--status-loss);
  color: #fff;
}

.btn-success {
  background: var(--status-profit-bg);
  border-color: var(--status-profit-border);
  color: var(--status-profit);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Category Filter Chips */
.chips-scroll-container {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips-scroll-container::-webkit-scrollbar {
  display: none;
}

.chip-filter {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.chip-filter.active {
  background: var(--accent-brand);
  border-color: var(--accent-brand);
  color: #0e0f12;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--accent-brand-glow);
}

/* Search Bar */
.search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: var(--space-md);
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--trans-fast);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--accent-terracotta);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* Atelier Cards */
.card-atelier {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--trans-fast), border-color var(--trans-fast);
}

/* Badges */
.badge-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.badge-green {
  background: var(--status-profit-bg);
  color: var(--status-profit);
  border: 1px solid var(--status-profit-border);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.badge-soldout {
  background: rgba(108, 117, 125, 0.15);
  color: var(--status-soldout);
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.badge-unique {
  background: linear-gradient(135deg, rgba(224, 122, 95, 0.2), rgba(244, 162, 97, 0.2));
  color: var(--accent-ochre);
  border: 1px solid rgba(244, 162, 97, 0.4);
}

/* Giant POS Tap Buttons */
.btn-giant-tap {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-brand), #f5cc66);
  color: #0e0f12;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-brand-glow);
  transition: transform 0.08s ease, filter 0.15s ease;
  user-select: none;
}

.btn-giant-tap:active {
  transform: scale(0.94);
  filter: brightness(1.2);
}

.btn-giant-tap.sold-out {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-tap-minus {
  width: 44px;
  height: 52px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.btn-tap-minus:hover {
  background: var(--bg-surface-hover);
  color: var(--status-loss);
}

.btn-tap-minus:active {
  transform: scale(0.92);
}

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  align-items: flex-end; /* Bottom sheet on mobile */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-elevated);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@media (min-width: 640px) {
  .modal-sheet {
    border-radius: var(--radius-xl);
    transform: scale(0.95) translateY(0);
  }
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-overlay.open .modal-sheet {
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Playfair Display', var(--font-family-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  padding-bottom: max(var(--space-md), var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: var(--bg-surface-elevated);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color var(--trans-fast);
}

.form-control:focus {
  border-color: var(--accent-terracotta);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

/* Segmented Control (Toggle) */
.segmented-control {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.segment-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.segment-btn.active {
  background: var(--accent-terracotta);
  color: #fff;
}
