/* ============================================
   WowPetStore — Base Styles
   ============================================ */

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

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-bold);
  overflow-wrap: break-word;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-5xl); }
  h2 { font-size: var(--fs-4xl); }
  h3 { font-size: var(--fs-3xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--fs-6xl); }
  h2 { font-size: var(--fs-5xl); }
}

p {
  overflow-wrap: break-word;
  max-width: 72ch;
}

strong { font-weight: var(--fw-semibold); }

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ---- Focus Styles ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Utility Classes ---- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--space-8); }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--space-12); }
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid { display: grid; }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-accent { font-family: var(--font-accent); }
.font-heading { font-family: var(--font-heading); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.uppercase {
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
}

/* Spacing */
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.relative { position: relative; }

/* Misc */
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Button Base ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-inverse);
  box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.45);
}

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

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-4);
}

.btn-ghost:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-base);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

.btn-block {
  width: 100%;
}

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

/* ---- Section ---- */
.section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .section { padding: var(--space-20) 0; }
}

@media (min-width: 1024px) {
  .section { padding: var(--space-24) 0; }
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-3);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--fs-lg);
  max-width: 600px;
  margin: 0 auto var(--space-12);
}

.section-label {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-inverse);
}

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

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

.badge-subscribe {
  background: linear-gradient(135deg, var(--color-sky), #4A8DC2);
  color: white;
}

/* ---- Skeleton Loader ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border-light) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-spring);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delay for children */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }
.stagger > *:nth-child(7) { transition-delay: 480ms; }
.stagger > *:nth-child(8) { transition-delay: 560ms; }

/* ---- Toast Notification ---- */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--announcement-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  transform: translateX(120%);
  transition: transform var(--duration-base) var(--ease-spring);
  max-width: 380px;
  font-size: var(--fs-sm);
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.toast-close {
  margin-left: auto;
  padding: var(--space-1);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--color-text);
}

/* ---- Star Rating ---- */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-primary);
}

.stars .star-empty {
  color: var(--color-border);
}

/* ---- Price ---- */
.price {
  font-family: var(--font-accent);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

.price-original {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-weight: var(--fw-regular);
  font-size: 0.875em;
}

.price-subscribe {
  color: var(--color-sky);
  font-weight: var(--fw-bold);
}

/* ---- Input Styles ---- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group label {
  font-family: var(--font-accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

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