/* ============================================================
   PetalLoops — Global Design System
   Author: PetalLoops
   ============================================================ */

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

/* ── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
  /* Colors */
  --color-rose:         #E8B4B8;
  --color-rose-dark:    #D4929B;
  --color-rose-light:   #F5D8DB;
  --color-blush:        #F9EEF0;
  --color-teal:         #6BAED6;
  --color-teal-dark:    #4A90BB;
  --color-teal-light:   #B8DCEE;
  --color-sage:         #8FAF8F;
  --color-sage-dark:    #6A9A6A;
  --color-sage-light:   #C8DEC8;
  --color-cream:        #FDF6EC;
  --color-cream-dark:   #F5E8D4;
  --color-gold:         #D4A853;
  --color-gold-light:   #EDD59A;
  --color-dark:         #2D2D2D;
  --color-dark-mid:     #4A4A4A;
  --color-gray:         #8A8A8A;
  --color-gray-light:   #E8E8E8;
  --color-white:        #FFFFFF;
  --color-purple:       #B39DDB;

  /* Gradients */
  --gradient-hero:      linear-gradient(135deg, #FDF6EC 0%, #F9EEF0 40%, #EDD5DE 100%);
  --gradient-rose:      linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-dark) 100%);
  --gradient-teal:      linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
  --gradient-gold:      linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  --gradient-card:      linear-gradient(180deg, rgba(253,246,236,0) 0%, rgba(253,246,236,0.95) 100%);
  --gradient-overlay:   linear-gradient(135deg, rgba(232,180,184,0.15) 0%, rgba(107,174,214,0.1) 100%);

  /* Typography */
  --font-display:       'Playfair Display', Georgia, serif;
  --font-body:          'Inter', system-ui, sans-serif;
  --font-script:        'Dancing Script', cursive;

  /* Font sizes (fluid scale) */
  --text-xs:            0.75rem;
  --text-sm:            0.875rem;
  --text-base:          1rem;
  --text-lg:            1.125rem;
  --text-xl:            1.25rem;
  --text-2xl:           1.5rem;
  --text-3xl:           1.875rem;
  --text-4xl:           2.25rem;
  --text-5xl:           3rem;
  --text-6xl:           3.75rem;

  /* Spacing */
  --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:          0.375rem;
  --radius-md:          0.75rem;
  --radius-lg:          1.25rem;
  --radius-xl:          2rem;
  --radius-full:        9999px;

  /* Shadows */
  --shadow-sm:          0 1px 3px rgba(45,45,45,0.08), 0 1px 2px rgba(45,45,45,0.05);
  --shadow-md:          0 4px 16px rgba(45,45,45,0.1), 0 2px 6px rgba(45,45,45,0.06);
  --shadow-lg:          0 12px 40px rgba(45,45,45,0.12), 0 4px 14px rgba(45,45,45,0.08);
  --shadow-xl:          0 24px 64px rgba(45,45,45,0.14);
  --shadow-rose:        0 8px 32px rgba(232,180,184,0.4);
  --shadow-teal:        0 8px 32px rgba(107,174,214,0.35);
  --shadow-gold:        0 8px 32px rgba(212,168,83,0.35);

  /* Transitions */
  --transition-fast:    0.15s ease;
  --transition-base:    0.25s ease;
  --transition-slow:    0.4s ease;
  --transition-spring:  0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-sm:       640px;
  --container-md:       768px;
  --container-lg:       1024px;
  --container-xl:       1200px;
  --container-2xl:      1400px;
  --nav-height:         80px;

  /* Glass */
  --glass-bg:           rgba(255,255,255,0.65);
  --glass-border:       rgba(255,255,255,0.5);
  --glass-shadow:       0 8px 32px rgba(45,45,45,0.08);
  --glass-blur:         blur(16px);
}

/* ── CSS Reset ────────────────────────────────────────────── */
*, *::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(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-dark);
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl)); }
h4 { font-size: clamp(var(--text-xl), 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { line-height: 1.7; color: var(--color-dark-mid); }

.script-text {
  font-family: var(--font-script);
  font-weight: 600;
}

.text-rose    { color: var(--color-rose-dark); }
.text-teal    { color: var(--color-teal-dark); }
.text-sage    { color: var(--color-sage-dark); }
.text-gold    { color: var(--color-gold); }
.text-gray    { color: var(--color-gray); }
.text-muted   { color: var(--color-gray); font-size: var(--text-sm); }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

.section { padding: var(--space-20) 0; }
.section-sm { padding: var(--space-12) 0; }
.section-lg { padding: var(--space-32) 0; }

/* Flex */
.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    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-2       { gap: var(--space-2); }
.gap-3       { gap: var(--space-3); }
.gap-4       { gap: var(--space-4); }
.gap-6       { gap: var(--space-6); }
.gap-8       { gap: var(--space-8); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

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

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

.section-header .eyebrow {
  display: inline-block;
  font-family: var(--font-script);
  font-size: var(--text-xl);
  color: var(--color-rose-dark);
  margin-bottom: var(--space-2);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--text-lg);
}

/* ── Dividers ─────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-rose), transparent);
}

.divider-icon {
  color: var(--color-rose);
  font-size: var(--text-xl);
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-rose   { background: var(--color-rose-light); color: var(--color-rose-dark); }
.badge-teal   { background: var(--color-teal-light); color: var(--color-teal-dark); }
.badge-sage   { background: var(--color-sage-light); color: var(--color-sage-dark); }
.badge-gold   { background: rgba(212,168,83,0.15); color: var(--color-gold); }
.badge-new    { background: var(--color-rose-dark); color: white; }
.badge-sale   { background: #E53E3E; color: white; }

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

/* ── Page Hero (non-home pages) ───────────────────────────── */
.page-hero {
  background: var(--gradient-hero);
  padding: calc(var(--nav-height) + var(--space-12)) 0 var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E8B4B8' fill-opacity='0.08'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero-content { position: relative; z-index: 1; }

.page-hero .eyebrow {
  font-family: var(--font-script);
  font-size: var(--text-xl);
  color: var(--color-rose-dark);
  display: block;
  margin-bottom: var(--space-2);
}

.page-hero h1 { margin-bottom: var(--space-4); }
.page-hero p  { font-size: var(--text-lg); max-width: 600px; margin: 0 auto; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-gray);
  margin-top: var(--space-4);
  justify-content: center;
}

.breadcrumb a:hover { color: var(--color-rose-dark); }
.breadcrumb-sep { color: var(--color-rose); }

/* ── Toast Notification ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--color-dark);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  min-width: 260px;
  transform: translateX(120%);
  transition: transform var(--transition-slow);
}

.toast.show { transform: translateX(0); }
.toast-icon { font-size: var(--text-lg); }
.toast-success { border-left: 4px solid var(--color-sage-dark); }
.toast-error   { border-left: 4px solid #E53E3E; }
.toast-info    { border-left: 4px solid var(--color-teal); }

/* ── Scroll to Top ────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-rose);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  box-shadow: var(--shadow-rose);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 1000;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(232,180,184,0.5);
}

/* ── Loading ──────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-rose-dark);
  margin-bottom: var(--space-6);
}

.loader-petals {
  display: flex;
  gap: var(--space-2);
}

.loader-petal {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-rose);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader-petal:nth-child(1) { animation-delay: 0s; background: var(--color-rose); }
.loader-petal:nth-child(2) { animation-delay: 0.2s; background: var(--color-teal); }
.loader-petal:nth-child(3) { animation-delay: 0.4s; background: var(--color-rose-dark); }
.loader-petal:nth-child(4) { animation-delay: 0.6s; background: var(--color-sage); }
.loader-petal:nth-child(5) { animation-delay: 0.8s; background: var(--color-gold); }

@keyframes loaderPulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.4); opacity: 1; }
}

/* ── Responsive Breakpoints ───────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 var(--space-5); }
}

@media (max-width: 768px) {
  :root { --nav-height: 70px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: var(--space-12) 0; }
  .section-lg { padding: var(--space-20) 0; }
  .container { padding: 0 var(--space-4); }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: var(--text-4xl); }
}
