/* ============================================================
   THE BATH & BODY SPOT — Global Styles
   Resets, base typography, utilities, layout helpers
   ============================================================ */

/* ── Reset & Box Model ───────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-dark);
  background-color: var(--bg-page);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--text-dark);
}

p {
  line-height: var(--leading-relaxed);
  color: var(--text-mid);
}

/* ── Page Shell ──────────────────────────────────── */
#app-shell {
  min-height: 100vh;
  padding-top: var(--total-header);
}

/* ── Container ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── Sections ────────────────────────────────────── */
.section {
  padding-top: var(--sp-20);
  padding-bottom: var(--sp-20);
}

.section--alt {
  background-color: var(--bg-section-alt);
}

.section--cream {
  background-color: var(--cream);
}

.section--blush {
  background: var(--grad-blush);
}

/* ── Section Header ──────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-gold);
  margin-bottom: var(--sp-3);
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
  color: var(--text-dark);
  line-height: var(--leading-tight);
}

.section-title em {
  font-style: italic;
  color: var(--pink-vibrant);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-light);
  margin-top: var(--sp-4);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 13px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: all var(--ease-med);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(-100%);
  transition: transform var(--ease-silk);
}

.btn:hover::before {
  transform: translateX(0);
}

.btn--primary {
  background: var(--grad-pink);
  color: var(--white);
  box-shadow: var(--shadow-pink);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--pink-vibrant);
  border: 1.5px solid var(--blush-mid);
}

.btn--outline:hover {
  background: var(--blush-light);
  border-color: var(--pink-vibrant);
  transform: translateY(-2px);
}

.btn--gold {
  background: var(--grad-rose-gold);
  color: var(--white);
  box-shadow: var(--shadow-gold);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--ghost {
  background: transparent;
  color: var(--text-mid);
}

.btn--ghost:hover {
  color: var(--pink-vibrant);
  background: var(--blush-light);
}

.btn--sm {
  padding: 9px 18px;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 16px 36px;
  font-size: var(--text-base);
}

.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Badges / Pills ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--new {
  background: var(--pink-vibrant);
  color: var(--white);
}

.badge--sale {
  background: var(--rose-gold);
  color: var(--white);
}

.badge--out {
  background: var(--cream-dark);
  color: var(--text-light);
}

.badge--low {
  background: var(--blush-mid);
  color: var(--pink-dark);
}

.badge--free {
  background: #D4EDDA;
  color: #2E7D4B;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--ease-med);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ── Dividers ────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-soft);
  border: none;
  margin: var(--sp-6) 0;
}

.divider--fancy {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blush-mid), var(--rose-gold), var(--blush-mid), transparent);
  border: none;
  margin: var(--sp-8) 0;
}

/* ── Forms ───────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-dark);
  font-size: var(--text-base);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

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

.form-input:focus {
  border-color: var(--blush-deep);
  box-shadow: 0 0 0 3px rgba(232, 160, 160, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B89090' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ── Toast Notifications ─────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--pink-vibrant);
  pointer-events: all;
  animation: slideInRight var(--ease-bounce) forwards;
  max-width: 320px;
  font-size: var(--text-sm);
  color: var(--text-dark);
}

.toast.success { border-color: #4CAF87; }
.toast.error   { border-color: #E87474; }
.toast.info    { border-color: var(--rose-gold); }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.hiding {
  animation: slideOutRight var(--ease-med) forwards;
}

/* ── Skeleton Loaders ────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--blush-light) 0%, var(--cream) 50%, var(--blush-light) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Star Rating ─────────────────────────────────── */
.stars {
  display: flex;
  gap: 2px;
  color: var(--rose-gold);
  font-size: var(--text-sm);
}

/* ── Quantity Control ────────────────────────────── */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  font-size: var(--text-lg);
  transition: all var(--ease-fast);
  background: transparent;
}

.qty-btn:hover {
  background: var(--blush-light);
  color: var(--pink-vibrant);
}

.qty-display {
  min-width: 36px;
  text-align: center;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dark);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  padding: 0 var(--sp-1);
}

/* ── Overlay / Backdrop ──────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-med);
}

.backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Utility Classes ─────────────────────────────── */
.hidden       { display: none !important; }
.invisible    { visibility: hidden; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.italic       { font-style: italic; }
.fw-300       { font-weight: 300; }
.fw-400       { font-weight: 400; }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.font-display { font-family: var(--font-display); }
.font-label   { font-family: var(--font-label); }
.color-rose   { color: var(--rose-gold); }
.color-pink   { color: var(--pink-vibrant); }
.color-mid    { color: var(--text-mid); }
.color-light  { color: var(--text-light); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-2        { gap: var(--sp-2); }
.gap-3        { gap: var(--sp-3); }
.gap-4        { gap: var(--sp-4); }
.gap-6        { gap: var(--sp-6); }

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

.w-full       { width: 100%; }
.max-w-narrow { max-width: var(--container-narrow); margin: 0 auto; }
.rounded-full { border-radius: var(--radius-full); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--blush-lightest); }
::-webkit-scrollbar-thumb { background: var(--blush-mid); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--blush-deep); }

/* Selection */
::selection {
  background: var(--blush-mid);
  color: var(--text-dark);
}
