/* ============================================
   GLOBAL — Base styles using design tokens
   ============================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* --- Page Layout Wrapper --- */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4);
  padding-top: calc(var(--header-height) + var(--space-4));
  padding-bottom: calc(var(--nav-height) + var(--space-8));
  min-height: 100vh;
}

/* --- Typography --- */
.font-display { font-family: var(--font-display); }

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
}

h3, .h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  min-height: 48px;        /* touch target */
  transition: all var(--transition-fast);
  width: 100%;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-primary:disabled {
  background: var(--color-text-light);
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  width: auto;
}

.btn-outline:hover {
  background: var(--color-primary-light);
}

.btn-ghost {
  background: var(--color-surface-2);
  color: var(--color-text);
  width: auto;
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
}

/* --- Inputs --- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.input-field {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}

.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 30, 140, 0.12);
}

.input-field::placeholder {
  color: var(--color-text-light);
}

.input-error {
  border-color: var(--color-danger) !important;
}

.input-error-msg {
  font-size: var(--text-xs);
  color: var(--color-danger);
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-success {
  background: #E8F8EF;
  color: var(--color-success);
}

.badge-warning {
  background: #FFF4E0;
  color: var(--color-warning);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

/* --- Skeleton Loader --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-2) 25%,
    #e8e4df 50%,
    var(--color-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  z-index: var(--z-toast);
  animation: toast-in 0.25s ease, toast-out 0.25s ease 2.5s forwards;
  box-shadow: var(--shadow-lg);
}

.toast-success { background: var(--color-success); }
.toast-danger  { background: var(--color-danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}

.empty-state__icon {
  font-size: 64px;
  line-height: 1;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 240px;
}

/* --- Utility Classes --- */
.text-center  { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-4        { gap: var(--space-4); }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* Page fade-in */
body {
  animation: page-fade-in 0.25s ease;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FLOATING CART BUTTON
   ============================================ */

.floating-cart {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 98;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  transition: all 0.25s ease;
  animation: float-up 0.3s ease;
}

.floating-cart:hover {
  background: var(--color-primary);
  transform: translateX(-50%) translateY(-2px);
}

.floating-cart.hidden {
  display: none;
}

@keyframes float-up {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}