/* ATELIER INTÉRIEUR — Global Styles */
/* ================================= */

/* CSS Variables from wizard-config.json — DO NOT MODIFY */
:root {
  /* Colors */
  --bg-primary: #F8EDE3;
  --bg-secondary: #DFD3C3;
  --accent-primary: #F8EDE3;
  --accent-secondary: #DFD3C3;
  --text-primary: #85586F;
  --text-secondary: #D0B8A8;
  --cta: #F8EDE3;
  --border: #85586F;
  
  /* Extended palette */
  --text-primary-hover: #6E4A5D;
  --border-subtle: rgba(133, 88, 111, 0.2);
  
  /* Typography */
  --font-heading: 'Bodoni Moda', 'Didot', 'Playfair Display', Georgia, serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  
  /* Heading scale */
  --h1-size: 4.5rem;
  --h2-size: 3rem;
  --h3-size: 2rem;
  --h4-size: 1.5rem;
  --h5-size: 1.25rem;
  --h6-size: 1rem;
  
  /* Body text */
  --body-size: 16px;
  --caption-size: 14px;
  --small-size: 12px;
  --line-height: 1.6;
  
  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows (informed by color palette) */
  --shadow-sm: 0 1px 2px rgba(133, 88, 111, 0.06);
  --shadow-md: 0 4px 12px rgba(133, 88, 111, 0.08);
  --shadow-lg: 0 8px 24px rgba(133, 88, 111, 0.12);
  --shadow-xl: 0 16px 48px rgba(133, 88, 111, 0.16);
  
  /* Animation timing */
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.6s;
  
  /* Z-index scale */
  --z-loader: 9999;
  --z-cursor: 9998;
  --z-nav: 100;
  --z-overlay: 90;
  --z-dropdown: 80;
  --z-modal: 70;
  --z-toast: 60;
  --z-scroll-progress: 50;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto !important;
  font-size: var(--body-size);
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }
h4 { font-size: var(--h4-size); }
h5 { font-size: var(--h5-size); }
h6 { font-size: var(--h6-size); }

p, span, a, li, label, input, textarea, button {
  font-family: var(--font-body);
}

/* Links */
a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--text-primary-hover);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Focus styles (accessibility) */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-nav);
  padding: var(--space-2) var(--space-4);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: top var(--duration-fast);
}

.skip-to-content:focus {
  top: var(--space-4);
}

/* Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  transform: scaleX(0);
  transform-origin: left;
  z-index: var(--z-scroll-progress);
  pointer-events: none;
}

/* Custom Cursor (desktop only) */
.custom-cursor {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-radius: 50%;
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid var(--text-primary);
  border-radius: 50%;
}

/* Loading Screen */
.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: var(--z-loader);
}

.loader-text {
  font-family: var(--font-heading);
  font-size: var(--h3-size);
  color: var(--text-primary);
  letter-spacing: 0.1em;
  opacity: 0;
}

.loader-line {
  width: 200px;
  height: 2px;
  background: var(--text-primary);
  margin-top: var(--space-4);
  transform: scaleX(0);
  transform-origin: left;
}

/* Buttons */
.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-body);
  font-size: var(--body-size);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--text-primary-hover);
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(133, 88, 111, 0.05);
}

.btn:disabled {
  background: rgba(133, 88, 111, 0.4);
  cursor: not-allowed;
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--body-size);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid rgba(133, 88, 111, 0.3);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(133, 88, 111, 0.6);
  box-shadow: 0 0 0 3px rgba(133, 88, 111, 0.15);
}

input.error, textarea.error, select.error {
  border-color: #C53030;
}

.error-message {
  color: #C53030;
  font-size: var(--caption-size);
  margin-top: var(--space-1);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--text-primary);
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal), box-shadow var(--duration-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

.toast-success { background: #38A169; }
.toast-error { background: #C53030; }
.toast-info { background: var(--text-primary); }
.toast-warning { background: #D69E2E; }

/* Gradient Text (for scroll fill effect) */
.gradient-text {
  background: linear-gradient(var(--text-primary), var(--text-primary)) no-repeat;
  background-size: 0%;
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--text-secondary);
}

/* Transformation section (before/after image reveal) */
.transformation-section {
  --reveal-progress: 0%;
}

.transform-reveal-layer {
  will-change: clip-path;
}

.transformation-content {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Section backgrounds */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }

/* Utility classes */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-padding {
  padding: var(--space-24) 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Reduced Motion (ALWAYS include) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  
  .custom-cursor {
    display: none !important;
  }
}

/* Responsive Typography */
@media (max-width: 1023px) {
  :root {
    --h1-size: 3rem;
    --h2-size: 2.25rem;
    --h3-size: 1.75rem;
    --h4-size: 1.25rem;
  }
}

@media (max-width: 639px) {
  :root {
    --h1-size: 2.5rem;
    --h2-size: 1.75rem;
    --h3-size: 1.5rem;
    --h4-size: 1.25rem;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
  
  .section-padding {
    padding: var(--space-16) 0;
  }
  
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }
}

/* Mobile tab bar safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ==========================================
   MAIN NAVIGATION
   ========================================== */

/* Main nav styling */
.main-nav {
  z-index: 100;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Scrolled state for main nav */
.main-nav.nav-scrolled {
  background-color: rgba(248, 237, 227, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(133, 88, 111, 0.1);
}

/* ==========================================
   MOBILE MENU OVERLAY
   ========================================== */

/* Mobile menu overlay active state */
.mobile-menu-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger menu animation */
.menu-toggle {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu links styling */
.mobile-menu-link {
  opacity: 0;
  transform: translateY(40px);
}

.mobile-menu-overlay.active .mobile-menu-link {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ==========================================
   MOBILE NATIVE APP EXPERIENCE
   ========================================== */

/* Prevent horizontal overflow on html element */
html {
  overflow-x: hidden;
}

/* Fixed Mobile Navigation - Always Visible */
.mobile-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  transform: translateZ(0); /* Force GPU acceleration */
  will-change: transform;
}

/* Add bottom padding to body/main to prevent content being hidden behind nav */
@media (max-width: 1023px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  
  footer {
    margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile tab bar safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ==========================================
   HORIZONTAL SCROLL CONTAINERS (MOBILE)
   ========================================== */

/* Horizontal scroll for lists and cards on mobile */
@media (max-width: 767px) {
  .mobile-scroll-x {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 1rem;
    padding: 0.5rem 0 1.5rem;
    margin: 0;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .mobile-scroll-x::-webkit-scrollbar {
    display: none;
  }
  
  .mobile-scroll-x > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 82vw;
    max-width: 300px;
    min-width: 260px;
  }
  
  /* Smaller cards for lists */
  .mobile-scroll-x.mobile-scroll-sm > * {
    width: 75vw;
    max-width: 260px;
    min-width: 220px;
  }
  
  /* Cards in horizontal scroll */
  .mobile-scroll-x .card {
    height: 100%;
    margin-bottom: 0;
  }
}

/* ==========================================
   MOBILE FOOTER ACCORDION
   ========================================== */

@media (max-width: 767px) {
  .footer-accordion {
    border-top: 1px solid var(--border-subtle);
  }
  
  .footer-accordion-item {
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .footer-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  
  .footer-accordion-header::after {
    content: '';
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
  }
  
  .footer-accordion-header[aria-expanded="true"]::after {
    transform: rotate(-135deg);
  }
  
  .footer-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0;
  }
  
  .footer-accordion-content[aria-hidden="false"] {
    max-height: 300px;
    padding: 0 0 1rem;
  }
  
  .footer-accordion-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  
  .footer-accordion-content li {
    padding: 0.5rem 0;
  }
  
  /* Desktop footer columns - hide on mobile */
  .footer-desktop-cols {
    display: none;
  }
  
  .footer-mobile-accordion {
    display: block;
  }
}

@media (min-width: 768px) {
  .footer-mobile-accordion {
    display: none;
  }
  
  .footer-desktop-cols {
    display: grid;
  }
}
