/* ============================================================
   MARKUS PRO — UI Components
   Buttons, Inputs, Badges, Tags, Toast, Cards
   ============================================================ */

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  user-select: none;
}

/* Sizes */
.btn-lg { padding: 16px 36px; font-size: var(--text-base); }
.btn-md { padding: 13px 28px; }
.btn-sm { padding: 9px 18px; font-size: var(--text-xs); }

/* Default size */
.btn:not(.btn-lg):not(.btn-md):not(.btn-sm) { padding: 13px 28px; }

/* Primary */
.btn-primary {
  background: var(--accent);
  color: var(--text-on-light);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.btn-primary:active {
  background: var(--accent-active);
  border-color: var(--accent-active);
  transform: translateY(0);
  box-shadow: none;
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--text-primary); }

/* Accent ghost */
.btn-accent-ghost {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent-border);
}
.btn-accent-ghost:hover {
  background: rgba(0, 191, 255, 0.15);
  border-color: rgba(0, 191, 255, 0.5);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Full width */
.btn-full { width: 100%; }

/* Disabled */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Form Inputs ─────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-body);
  line-height: 1.5;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-placeholder);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-subtle);
}

.form-input.is-success { border-color: var(--success); }

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: -var(--sp-1);
}

.form-textarea { min-height: 120px; resize: vertical; }

/* Password toggle wrapper */
.input-wrapper {
  position: relative;
}
.input-wrapper .form-input { padding-right: 48px; }
.input-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}
.input-toggle:hover { color: var(--text-secondary); }

/* ── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-new     { background: var(--accent);   color: #000; }
.badge-sale    { background: var(--error);    color: #fff; }
.badge-hot     { background: #FF6B35;         color: #fff; }
.badge-low     { background: var(--warning);  color: #000; }
.badge-sold    { background: var(--border-default); color: var(--text-muted); }

/* Counter badge (on nav icons) */
.badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--accent);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
  pointer-events: none;
}
.badge-count.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Product Card Tags ───────────────────────────────────── */

.card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: var(--z-base);
}

/* ── Size Selector ───────────────────────────────────────── */

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.size-btn {
  min-width: 48px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}
.size-btn:hover:not(.is-selected):not(.is-unavailable) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.size-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}
.size-btn.is-unavailable {
  opacity: 0.28;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Quantity Stepper ────────────────────────────────────── */

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 38px;
}

.qty-btn {
  width: 36px;
  height: 100%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--border-default); color: var(--text-primary); }
.qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.qty-value {
  min-width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  background: transparent;
  user-select: none;
}

/* ── Filter Pill ─────────────────────────────────────────── */

.filter-pill {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.filter-pill.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ── Toast ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 360px;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--transition-enter),
    transform var(--transition-enter);
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-icon { font-size: 18px; flex-shrink: 0; color: var(--accent); }
.toast-msg { font-size: var(--text-base); color: var(--text-primary); flex: 1; }
.toast-close {
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px;
  cursor: pointer;
  transition: color var(--transition-fast);
  flex-shrink: 0;
  background: none;
  border: none;
  line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

/* ── Divider ─────────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Checkbox ────────────────────────────────────────────── */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.checkbox-group:hover .checkbox-label { color: var(--text-primary); }

/* ── Accordion ───────────────────────────────────────────── */

.accordion-item { border-bottom: 1px solid var(--border-subtle); }

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-5) 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
  transition: color var(--transition-fast);
}
.accordion-trigger:hover { color: var(--accent); }

.accordion-icon {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-base), color var(--transition-fast);
}
.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
  color: var(--accent);
}

.accordion-body {
  display: none;
  padding-bottom: var(--sp-5);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}
.accordion-body.is-open { display: block; }

/* ── Overlay backdrop ────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Empty State ─────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-24) var(--sp-6);
  gap: var(--sp-4);
}
.empty-state-icon {
  font-size: 48px;
  opacity: 0.2;
  margin-bottom: var(--sp-2);
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.empty-state-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 300px;
}

/* ── Product Card ────────────────────────────────────────── */

.product-card { display: flex; flex-direction: column; }

.product-card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: block;
  text-decoration: none;
  margin-bottom: var(--sp-3);
}

.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-standard);
}

.product-card:hover .product-card-img-wrap img { transform: scale(1.04); }

.product-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.product-card:hover .product-card-overlay { opacity: 1; }

.product-card-info { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }

.product-card-cat {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.product-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}
.product-card-name:hover { color: var(--accent); }

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: 2px;
}

.price-current {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
}
.price-current.is-sale { color: var(--accent); }

.price-original {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Wish button on card */
.card-wish-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.card-wish-btn:hover,
.card-wish-btn.is-wishlisted { color: #FF4466; background: rgba(255,68,102,0.18); }
