/* ============================================================
   PLUSASSURE DESIGN SYSTEM
   Premium Pet E-Commerce — Design Tokens & Base Styles
   Brand Colors:
     海涛蓝  #0A2EA8  — Primary
     荷花白  #FBECDE  — Background warm
     柠檬黄  #F8DF08  — Accent
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties (Design Tokens) ───────────────── */
:root {
  /* ── Brand Primary: 海涛蓝 ── */
  --clr-primary:        #0A2EA8;
  --clr-primary-light:  #2D4FC8;
  --clr-primary-dark:   #071F78;
  --clr-primary-soft:   #E8EDFB;

  /* ── Brand Accent: 柠檬黄 ── */
  --clr-accent:         #F8DF08;
  --clr-accent-light:   #FBE94A;
  --clr-accent-dark:    #C8B200;
  --clr-accent-soft:    #FEFBE0;

  /* ── Background: 荷花白 ── */
  --clr-bg:             #FBECDE;
  --clr-surface:        #FFFFFF;
  --clr-surface-2:      #FDF5EE;
  --clr-border:         #EDD8C4;
  --clr-border-light:   #F5EAE0;

  /* Text — 尽量黑字/白字 */
  --clr-text-primary:   #111111;
  --clr-text-secondary: #444444;
  --clr-text-muted:     #888888;
  --clr-text-inverse:   #FFFFFF;
  --clr-text-blue:      #0A2EA8;

  /* Semantic */
  --clr-success:        #4CAF50;
  --clr-warning:        #FFC107;
  --clr-info:           #2196F3;

  /* Category Colors */
  --clr-dog:            #C8A882;
  --clr-cat:            #B8A0D8;
  --clr-harness:        #80C9B4;
  --clr-toys:           #F9B44E;
  --clr-beds:           #E8A0A0;
  --clr-food:           #A8C878;
  --clr-travel:         #7BBFEA;
  --clr-grooming:       #F0A0C0;

  /* Typography */
  --ff-display:         'Playfair Display', Georgia, serif;
  --ff-body:            'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --fs-xs:    0.75rem;   /* 12px */
  --fs-sm:    0.875rem;  /* 14px */
  --fs-base:  1rem;      /* 16px */
  --fs-md:    1.125rem;  /* 18px */
  --fs-lg:    1.25rem;   /* 20px */
  --fs-xl:    1.5rem;    /* 24px */
  --fs-2xl:   1.875rem;  /* 30px */
  --fs-3xl:   2.25rem;   /* 36px */
  --fs-4xl:   3rem;      /* 48px */
  --fs-5xl:   3.75rem;   /* 60px */
  --fs-6xl:   4.5rem;    /* 72px */

  --fw-light:   300;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-black:   800;

  --lh-tight:  1.2;
  --lh-snug:   1.35;
  --lh-normal: 1.5;
  --lh-relaxed:1.625;
  --lh-loose:  2;

  /* Spacing Scale */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Border Radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-2xl:  40px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(26,23,20,.06), 0 1px 2px rgba(26,23,20,.04);
  --shadow-sm:  0 4px 6px -1px rgba(26,23,20,.08), 0 2px 4px -1px rgba(26,23,20,.04);
  --shadow-md:  0 10px 25px -3px rgba(26,23,20,.10), 0 4px 6px -2px rgba(26,23,20,.05);
  --shadow-lg:  0 20px 40px -6px rgba(26,23,20,.12), 0 8px 16px -4px rgba(26,23,20,.06);
  --shadow-xl:  0 32px 64px -12px rgba(26,23,20,.18);
  --shadow-glow-primary: 0 8px 32px rgba(10,46,168,.28);
  --shadow-glow-accent:  0 8px 32px rgba(248,223,8,.35);

  /* Transitions */
  --transition-fast:    150ms ease;
  --transition-normal:  250ms ease;
  --transition-slow:    400ms cubic-bezier(.4,0,.2,1);
  --transition-spring:  500ms cubic-bezier(.34,1.56,.64,1);

  /* Z-index Scale */
  --z-base:    1;
  --z-dropdown:100;
  --z-sticky:  200;
  --z-modal:   300;
  --z-toast:   400;
  --z-tooltip: 500;

  /* Container */
  --container-max: 1320px;
  --container-pad: clamp(1rem, 5vw, 3rem);
}

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

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

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

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

/* ── Typography Utilities ─────────────────────────────────── */
.display-xl {
  font-family: var(--ff-display);
  font-size: clamp(var(--fs-4xl), 7vw, var(--fs-6xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
.display-lg {
  font-family: var(--ff-display);
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-5xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
.display-md {
  font-family: var(--ff-display);
  font-size: clamp(var(--fs-2xl), 3.5vw, var(--fs-4xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}
.heading-xl { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.heading-lg { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.heading-md { font-size: var(--fs-xl);  font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.heading-sm { font-size: var(--fs-lg);  font-weight: var(--fw-semibold); line-height: var(--lh-normal); }
.body-lg    { font-size: var(--fs-md);  font-weight: var(--fw-regular); line-height: var(--lh-relaxed); }
.body-sm    { font-size: var(--fs-sm);  font-weight: var(--fw-regular); line-height: var(--lh-normal); }
.label      { font-size: var(--fs-xs);  font-weight: var(--fw-semibold); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Button Components ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--clr-primary);
  color: white;
  box-shadow: var(--shadow-glow-primary);
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
  box-shadow: 0 12px 40px rgba(10,46,168,.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--clr-text-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: #2D2A27; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--clr-border);
  color: var(--clr-text-primary);
}
.btn-outline:hover { border-color: var(--clr-primary); color: var(--clr-primary); }

.btn-ghost {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  color: white;
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn-ghost:hover { background: rgba(255,255,255,.25); }

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-base);
  border-radius: var(--radius-full);
}
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
}
.badge-primary { background: var(--clr-primary-soft); color: var(--clr-primary-dark); }
.badge-accent  { background: var(--clr-accent); color: #111111; font-weight:700; }
.badge-new     { background: var(--clr-accent); color: #111111; font-weight:700; }
.badge-sale    { background: var(--clr-primary); color: white; }
.badge-dark    { background: var(--clr-text-primary); color: white; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  background: var(--clr-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-slow);
  border: 1.5px solid var(--clr-border-light);
  position: relative;
  cursor: pointer;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--clr-primary);
}

.product-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--clr-surface-2);
}
.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.product-card:hover .product-card__img { transform: scale(1.06); }

.product-card__quick-add {
  position: absolute;
  bottom: -48px;
  left: var(--space-3);
  right: var(--space-3);
  transition: bottom var(--transition-normal);
}
.product-card:hover .product-card__quick-add { bottom: var(--space-3); }

.product-card__wishlist {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1.5px solid rgba(255,255,255,.6);
}
.product-card__wishlist:hover { background: var(--clr-accent); color: #111; }

.product-card__body { padding: var(--space-4); }
.product-card__brand { color: var(--clr-text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: 0.06em; }
.product-card__name  { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin-top: var(--space-1); line-height: 1.4; color: var(--clr-text-primary); }
.product-card__stars { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); }
.product-card__price { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.price-current { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--clr-text-primary); }
.price-original { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--clr-text-muted); text-decoration: line-through; }
.price-save { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--clr-primary-dark); background: var(--clr-accent-soft); padding: 1px 6px; border-radius: 4px; }

/* ── Star Rating ──────────────────────────────────────────── */
.stars { color: #F8DF08; display: flex; align-items: center; gap: 2px; }
.stars svg { width: 14px; height: 14px; }
.rating-count { font-size: var(--fs-xs); color: var(--clr-text-muted); margin-left: var(--space-1); }

/* ── Section Headers ──────────────────────────────────────── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--clr-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 3px;
  background: var(--clr-accent);
  border-radius: 2px;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes shimmer {
  from { background-position: -600px 0; }
  to   { background-position: 600px 0; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,.4); }
  50%       { box-shadow: 0 0 0 12px rgba(255,107,107,0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fadeInUp  { animation: fadeInUp  .6s var(--transition-slow) both; }
.animate-fadeIn    { animation: fadeIn    .5s ease both; }
.animate-scaleIn   { animation: scaleIn   .5s var(--transition-slow) both; }
.animate-float     { animation: float 3s ease-in-out infinite; }
.animate-delay-1   { animation-delay: .1s; }
.animate-delay-2   { animation-delay: .2s; }
.animate-delay-3   { animation-delay: .3s; }
.animate-delay-4   { animation-delay: .4s; }
.animate-delay-5   { animation-delay: .5s; }

/* Intersection observer reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-left.visible, .reveal-right.visible { transform: translateX(0); }
.reveal-scale  { transform: scale(.95); }
.reveal-scale.visible { transform: scale(1); }

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--clr-surface-2) 25%, #EDEAE4 50%, var(--clr-surface-2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--clr-surface-2); }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-muted); }

/* ── Selection ────────────────────────────────────────────── */
::selection { background: var(--clr-accent-soft); color: var(--clr-primary-dark); }

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Utility Classes ──────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-primary { color: var(--clr-primary); }
.text-muted   { color: var(--clr-text-muted); }
.text-center  { text-align: center; }
.gradient-text {
  background: linear-gradient(135deg, var(--clr-primary) 0%, #2D4FC8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--clr-border-light);
  margin: var(--space-8) 0;
}

/* ── Input ────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--clr-text-primary);
  background: var(--clr-surface);
  transition: border-color var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(255,107,107,.12);
}
.input::placeholder { color: var(--clr-text-muted); }

/* ── Tooltip ──────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-text-primary);
  color: white;
  font-size: var(--fs-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Responsive Grid ──────────────────────────────────────── */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* ── Aspect Ratios ────────────────────────────────────────── */
.aspect-square   { aspect-ratio: 1; }
.aspect-video    { aspect-ratio: 16/9; }
.aspect-portrait { aspect-ratio: 3/4; }

/* ── Overlay ──────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,.5);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.overlay.active { opacity: 1; pointer-events: auto; }
