@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --bg-sand: #f5f2ec;
  --bg-sand-dark: #e8e2d8;
  --text-noir: #171615;
  --accent-terra: #a64b38;
  --accent-terra-hover: #8f3e2d;
  --accent-rose: #c77962;
  --border-subtle: rgba(23, 22, 21, 0.12);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-sand);
  color: var(--text-noir);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-sand);
}
::-webkit-scrollbar-thumb {
  background: rgba(23, 22, 21, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(23, 22, 21, 0.4);
}

/* Subtle Film Grain */
.noise-overlay {
  background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 0);
  background-size: 8px 8px;
}

/* Fabric Zoom Loupe */
.loupe-container {
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

.loupe-lens {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3), inset 0 0 10px rgba(0,0,0,0.2);
  pointer-events: none;
  display: none;
  background-repeat: no-repeat;
  z-index: 30;
  backdrop-filter: blur(1px);
}

/* Look Builder Staging Canvas */
.outfit-stage {
  background: linear-gradient(145deg, #eee8de, #fdfbf7);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.04);
}

.mannequin-slot {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mannequin-slot:hover {
  transform: translateY(-2px);
}

/* Animated pulsing markers for map */
@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.rider-pulse-dot {
  position: relative;
}
.rider-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--accent-terra);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  z-index: -1;
}

/* Leaflet dark custom tiles */
.custom-map .leaflet-tile {
  filter: brightness(0.96) contrast(1.08) saturate(0.85) sepia(0.15);
}

/* Drawer animations */
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-in {
  animation: slide-in-right 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-up {
  animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Luxury hover effect */
.editorial-hover {
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.editorial-hover:hover {
  transform: scale(1.03);
}

/* Button pulse subtle */
.btn-primary {
  background-color: var(--text-noir);
  color: #f5f2ec;
  transition: all 0.25s ease;
}
.btn-primary:hover {
  background-color: #2b2927;
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--accent-terra);
  color: #ffffff;
  transition: all 0.25s ease;
}
.btn-accent:hover {
  background-color: var(--accent-terra-hover);
  transform: translateY(-1px);
}

/* ==================== COLOUR PALETTE & SWATCH STYLES ==================== */
.swatch-circle {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.swatch-circle:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.swatch-circle.active-swatch {
  transform: scale(1.15);
  outline: 2px solid var(--accent-terra);
  outline-offset: 2px;
  box-shadow: 0 4px 12px rgba(166, 75, 56, 0.35);
}

/* Duotone / Gradient Swatch Circle */
.swatch-duotone {
  background: linear-gradient(135deg, var(--col1) 50%, var(--col2) 50%);
}

/* Luxury Swatch Tooltip */
.swatch-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #171615;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.swatch-circle:hover .swatch-tooltip,
.group:hover .swatch-tooltip,
.color-card:hover .swatch-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ==================== MOBILE OPTIMIZATION & TOUCH UX ==================== */
/* Safe area padding for notch & home indicators */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* iOS Touch optimization */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a, select, input, textarea {
  touch-action: manipulation;
}

/* Prevent auto-zoom on iOS inputs while keeping compact desktop styling */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Add bottom padding to body so floating bottom bar never obstructs content */
  body {
    padding-bottom: calc(64px + var(--safe-bottom));
  }
}

/* Horizontal scroll without scrollbars for touch racks */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  padding-bottom: calc(8px + var(--safe-bottom));
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #171615;
  transition: all 0.2s ease;
  min-width: 52px;
  padding: 6px 4px;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: var(--accent-terra);
}

/* Bottom Sheet Modal Styles on Mobile */
@media (max-width: 767px) {
  .mobile-bottom-sheet {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .mobile-bottom-sheet > div {
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    padding-bottom: calc(16px + var(--safe-bottom)) !important;
  }

  /* Drag handle visual for mobile sheets */
  .sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background-color: rgba(0, 0, 0, 0.2);
    margin: 0 auto 12px auto;
  }
}

@media (min-width: 768px) {
  .sheet-handle {
    display: none;
  }
}

/* Enhanced Touch Feedback */
.touch-press:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}



