/* ==========================================================
   BREAD FIX — Global Stylesheet
   Glassmorphism system, theme variables, motion, utilities
   ========================================================== */

:root {
  --bg: #FFFBF5;
  --bg-elev: rgba(255,255,255,0.72);
  --border: rgba(30,20,10,0.08);
  --border-strong: rgba(30,20,10,0.14);
  --text: #201509;
  --muted: #7A6A57;
  --accent: #F97316;
  --glass-blur: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Brand gradient system — warm sourdough (light) / purple-cyan (dark) */
  --brand-a: #F97316; /* orange */
  --brand-b: #FBBF24; /* gold */
  --brand-c: #F59E0B; /* amber */
  --brand-glow-rgb: 249,115,22;
}

html.dark {
  --bg: #07070A;
  --bg-elev: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.18);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --accent: #8B5CF6;

  --brand-a: #8B5CF6; /* purple */
  --brand-b: #22D3EE; /* cyan */
  --brand-c: #A855F7; /* violet */
  --brand-glow-rgb: 139,92,246;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body { background: var(--bg); overflow-x: hidden; }

/* ---------------- Skip link ---------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 12px 20px;
  border-radius: 0 0 12px 0; z-index: 100; font-weight: 600; font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------------- Focus states ---------------- */
.focus-ring:focus-visible,
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand-a);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- Glassmorphism core ---------------- */
.glass-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.06) inset, 0 8px 32px rgba(0,0,0,0.10);
}
html.dark .glass-panel {
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.05) inset, 0 8px 40px rgba(0,0,0,0.45);
}

.glass-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.glass-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: transform 0.35s cubic-bezier(.16,1,.3,1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(var(--brand-glow-rgb), 0.45);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  transform: translateY(-4px);
}
html.dark .glass-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Gradient border helper */
.gradient-border {
  position: relative;
  border-radius: 1.5rem;
}
.gradient-border::before {
  content: '';
  position: absolute; inset: 0; padding: 1px; border-radius: inherit;
  background: linear-gradient(135deg, rgba(var(--brand-glow-rgb),0.5), rgba(var(--brand-glow-rgb),0.15), transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ---------------- Brand gradient system (theme-aware) ---------------- */
.brand-grad {
  background: linear-gradient(135deg, var(--brand-a), var(--brand-c), var(--brand-b));
}
.brand-grad-text {
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text { color: var(--brand-a); }
.brand-border { border-color: var(--brand-a) !important; }
.brand-glow { box-shadow: 0 0 60px rgba(var(--brand-glow-rgb), 0.28); }
.brand-glow-sm { box-shadow: 0 6px 20px rgba(var(--brand-glow-rgb), 0.35); }
.brand-bg-soft { background: rgba(var(--brand-glow-rgb), 0.12); }
.brand-icon-bg { background: linear-gradient(135deg, rgba(var(--brand-glow-rgb),0.16), rgba(var(--brand-glow-rgb),0.06)); color: var(--brand-a); }

/* Filter pills use brand gradient when active */
.filter-pill[aria-pressed="true"] {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-c));
  box-shadow: 0 6px 20px rgba(var(--brand-glow-rgb), 0.35);
}

/* ---------------- Nav shell scroll state ---------------- */
#nav-shell {
  background: transparent;
  border-color: transparent;
}
header[data-state="scrolled"] #nav-shell {
  background: var(--bg-elev);
  border-color: var(--border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
html.dark header[data-state="scrolled"] #nav-shell {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ---------------- Hero video background ---------------- */
.hero-video-wrap {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
}
.hero-video-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero-video-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,7,10,0.55) 0%, rgba(7,7,10,0.72) 55%, rgba(7,7,10,0.92) 100%);
}
html:not(.dark) .hero-video-scrim {
  background:
    linear-gradient(180deg, rgba(23,23,26,0.45) 0%, rgba(23,23,26,0.62) 55%, rgba(23,23,26,0.85) 100%);
}

/* Ambient glow blobs */
.glow-blob {
  position: absolute; border-radius: 999px; filter: blur(80px);
  opacity: 0.35; pointer-events: none;
  animation: glowMove 18s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .glow-blob { animation: none; } }

/* ---------------- Noise overlay ---------------- */
.noise-overlay {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- Reveal on scroll ---------------- */
[data-animate] { opacity: 0; transform: translateY(24px); }
[data-animate].in-view { animation: fadeUp 0.7s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ---------------- Pill filter buttons ---------------- */
.filter-pill {
  padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted);
  transition: all 0.25s ease; white-space: nowrap;
}
/* ---------------- Product image zoom on hover ---------------- */
.product-image-zoom { overflow: hidden; }
.product-image-zoom img { transition: transform 0.6s cubic-bezier(.16,1,.3,1); }
.glass-card:hover .product-image-zoom img { transform: scale(1.06); }

/* ---------------- Hidden honeypot field ---------------- */
.hidden-field {
  position: absolute !important; left: -9999px !important; width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
}

/* ---------------- Modal / overlay ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(7,7,10,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
html:not(.dark) .modal-overlay { background: rgba(23,23,26,0.4); }

.modal-panel {
  animation: modalIn 0.35s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------------- Drawer (centered modal) ---------------- */
#enquiry-drawer.flex { display: flex; }
#enquiry-drawer .modal-panel { animation: modalIn 0.3s cubic-bezier(.16,1,.3,1) forwards; }

/* ---------------- Scrollbar (subtle) ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--brand-glow-rgb),0.35); border-radius: 999px; }

/* ---------------- Horizontal scroll snap (trust strip mobile) ---------------- */
.scroll-snap-x { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.scroll-snap-x > * { scroll-snap-align: start; }
.scroll-snap-x::-webkit-scrollbar { display: none; }

/* ---------------- Star rating ---------------- */
.star-row i { color: #F59E0B; }

/* ---------------- Toast ---------------- */
.toast {
  pointer-events: auto;
  min-width: 260px; max-width: 340px;
  padding: 14px 16px; border-radius: 14px;
  animation: fadeIn 0.25s ease forwards, fadeUp 0.25s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Utility: safe-area padding for fixed bars ---------------- */
#site-header { padding-top: var(--safe-top); }
#mobile-cta-bar { padding-bottom: calc(var(--safe-bottom) + 0.75rem); }

/* ---------------- Step indicator ---------------- */
.step-dot {
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted);
  transition: all 0.3s ease;
}
.step-dot.active { background: linear-gradient(135deg,var(--brand-a),var(--brand-b)); color: #fff; border-color: transparent; }
.step-dot.done { background: linear-gradient(135deg,var(--brand-a),var(--brand-c)); color: #fff; border-color: transparent; }

/* ---------------- Leaflet map container radius fix ---------------- */
.leaflet-container { border-radius: 1.25rem; z-index: 0; font-family: inherit; }

/* ---------------- Floating label inputs ---------------- */
.field-group { position: relative; }
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%; padding: 1.15rem 1rem 0.5rem; border-radius: 0.9rem;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  font-size: 0.95rem; transition: border-color 0.2s ease;
}
.field-group textarea { min-height: 110px; resize: vertical; }
.field-group label {
  position: absolute; left: 1rem; top: 0.85rem; font-size: 0.95rem; color: var(--muted);
  transition: all 0.15s ease; pointer-events: none;
}
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { border-color: var(--brand-a); }
.field-group input:focus ~ label,
.field-group input:not(:placeholder-shown) ~ label,
.field-group select:focus ~ label,
.field-group select.has-value ~ label,
.field-group textarea:focus ~ label,
.field-group textarea:not(:placeholder-shown) ~ label {
  top: 0.4rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--brand-a);
}
.field-error { display: none; color: #EF4444; font-size: 0.8rem; margin-top: 0.4rem; }
.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea { border-color: #EF4444; }
.field-group.has-error .field-error { display: block; }

/* ---------------- Line clamp ---------------- */
.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; }

/* ---------------- No horizontal overflow guard ---------------- */
img, video { max-width: 100%; }

/* ---------------- Animated sticky call button ---------------- */
.call-fab {
  position: fixed;
  z-index: 45;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-c));
  color: #fff;
  box-shadow: 0 10px 30px rgba(var(--brand-glow-rgb), 0.45);
  animation: callFabPulse 2.6s ease-in-out infinite;
}
.call-fab::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 2px solid rgba(var(--brand-glow-rgb), 0.45);
  animation: callFabRing 2.6s ease-out infinite;
}
@keyframes callFabPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes callFabRing {
  0% { transform: scale(0.9); opacity: 0.8; }
  80% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .call-fab, .call-fab::before { animation: none; }
}

/* ---------------- Review section stars + card polish ---------------- */
.review-card { position: relative; overflow: hidden; }
.review-quote-mark {
  position: absolute; top: 0.75rem; right: 1rem;
  font-family: Georgia, serif; font-size: 3.5rem; line-height: 1;
  color: var(--brand-a); opacity: 0.12; pointer-events: none;
}

/* ---------------- Universal hover + border animation ---------------- */
.glass-card, .glass-chip, a, button {
  position: relative;
}

/* Animated gradient border sweep on hover for cards */
.hover-border-sweep {
  position: relative;
  overflow: hidden;
}
.hover-border-sweep::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg, transparent, var(--brand-a), var(--brand-b), transparent);
  background-size: 250% 250%;
  background-position: 0% 0%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.hover-border-sweep:hover::after {
  opacity: 1;
  animation: borderSweep 1.6s linear infinite;
}
@keyframes borderSweep {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}
@media (prefers-reduced-motion: reduce) {
  .hover-border-sweep::after { animation: none !important; }
}

/* Buttons: subtle lift + glow on hover */
.filter-pill, .glass-chip {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.glass-chip:hover {
  border-color: rgba(var(--brand-glow-rgb), 0.4);
  box-shadow: 0 6px 18px rgba(var(--brand-glow-rgb), 0.18);
}

/* Nav links: underline grow from center on hover */
#nav-shell ul a {
  position: relative;
}
#nav-shell ul a::before {
  content: '';
  position: absolute;
  left: 50%; right: 50%; bottom: 2px;
  height: 2px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  transition: left 0.25s ease, right 0.25s ease;
}
#nav-shell ul a:hover::before {
  left: 14px; right: 14px;
}

/* ---------------- Add-to-enquiry feedback animations ---------------- */
@keyframes addBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.add-bounce { animation: addBounce 0.45s cubic-bezier(.34,1.56,.64,1); }

@keyframes basketPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3) rotate(-8deg); }
  70% { transform: scale(0.95) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.basket-pop { animation: basketPop 0.5s cubic-bezier(.34,1.56,.64,1); }

/* Inquiry page: newly added row highlight sweep */
@keyframes rowHighlight {
  0% { background: rgba(var(--brand-glow-rgb), 0.22); }
  100% { background: transparent; }
}
.row-highlight { animation: rowHighlight 1.1s ease-out; border-radius: 1rem; }

@keyframes checkPulse {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.check-pulse { animation: checkPulse 0.5s cubic-bezier(.34,1.56,.64,1); }

@media (prefers-reduced-motion: reduce) {
  .add-bounce, .basket-pop, .row-highlight, .check-pulse { animation: none !important; }
}

