/* ==========================================================================
   EVERYTHINQ - 3D-PRINTED IDEAS MARKETPLACE
   Design System & Neo-Brutalist Stylesheet
   ========================================================================== */

/* --- Custom Variables & Palette --- */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-num: 'Plus Jakarta Sans', sans-serif;

  --neo-blue: #1b3aff;
  --neo-blue-hover: #1228c7;
  --neo-yellow: #e6ff00;
  --neo-lime: #d4ff00;
  --neo-black: #000000;
  --neo-cream: #fbfbf8;
  --neo-pink: #ff3385;
  --neo-orange: #ff6b35;
  --neo-cyan: #38bdf8;
  --neo-purple: #8b5cf6;
  --neo-bg: #f8f9fa;
  --border-color: #000000;

  --shadow-xs: 2px 2px 0px #000000;
  --shadow-sm: 3px 3px 0px #000000;
  --shadow-md: 4px 4px 0px #000000;
  --shadow-card: 5px 5px 0px #000000;
  --shadow-lg: 6px 6px 0px #000000;
  --shadow-xl: 8px 8px 0px #000000;
  
  --shadow-blue-sm: 4px 4px 0px #1b3aff;
  --shadow-blue: 5px 5px 0px #1b3aff;
  --shadow-blue-hover: 7px 7px 0px #1b3aff;

  --radius-3xl: 10px;
  --radius-2xl: 7px;
  --radius-xl: 5px;
  --radius-lg: 4px;
  --radius-md: 3px;
  --radius-sm: 2px;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background-color: var(--neo-bg);
  color: var(--neo-black);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background-image: radial-gradient(#000000 0.85px, transparent 0.85px);
  background-size: 24px 24px;
  line-height: 1.5;
}

/* Selection */
::selection {
  background-color: var(--neo-yellow);
  color: #000000;
}

/* --- Typography Helpers --- */
.font-display {
  font-family: var(--font-display) !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.font-body {
  font-family: var(--font-body) !important;
}

.font-sans, .price-num {
  font-family: var(--font-num) !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- Neo-Brutalist Radii Overrides --- */
.rounded-3xl { border-radius: 10px !important; }
.rounded-2xl { border-radius: 7px !important; }
.rounded-xl { border-radius: 5px !important; }
.rounded-lg { border-radius: 4px !important; }
.rounded-md { border-radius: 3px !important; }
.rounded { border-radius: 3px !important; }

/* --- Neo Borders --- */
.neo-border {
  border: 2.5px solid var(--border-color) !important;
}
.neo-border-2 {
  border: 2px solid var(--border-color) !important;
}
.neo-border-3 {
  border: 3px solid var(--border-color) !important;
}
.neo-border-b-4 {
  border-bottom: 4px solid var(--border-color) !important;
}

/* --- Brutal Shadow Utilities --- */
.shadow-brutal-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-brutal-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-brutal { box-shadow: var(--shadow-md) !important; }
.shadow-brutal-card { box-shadow: var(--shadow-card) !important; }
.shadow-brutal-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-brutal-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-brutal-blue { box-shadow: var(--shadow-blue) !important; }

/* --- Interactive Neo Buttons --- */
.neo-btn {
  border: 2.5px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  transition: all 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  user-select: none;
}
.neo-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000000;
}
.neo-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000000;
}

/* Custom Order Button with Electric Blue Shadow */
.neo-btn-blue-shadow {
  border: 2.5px solid #000000;
  box-shadow: 5px 5px 0px #1b3aff;
  transition: all 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  user-select: none;
}
.neo-btn-blue-shadow:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px #1b3aff;
}
.neo-btn-blue-shadow:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #1b3aff;
}

/* --- Neo Cards --- */
.neo-card {
  border: 2.5px solid #000000;
  box-shadow: 5px 5px 0px #000000;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.neo-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0px #000000;
}

/* --- Top Ticker Marquee --- */
@keyframes marqueeHeader {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee-top {
  display: flex;
  width: 200%;
  animation: marqueeHeader 22s linear infinite;
  will-change: transform;
}
.animate-marquee-top:hover {
  animation-play-state: paused;
}

/* --- Continuous Product Marquees --- */
@keyframes marqueeRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0%); }
}

@keyframes marqueeLeft {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.carousel-container {
  padding-top: 10px;
  padding-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.carousel-track-right {
  display: flex;
  width: max-content;
  animation: marqueeRight 42s linear infinite;
  will-change: transform;
}

.carousel-track-left {
  display: flex;
  width: max-content;
  animation: marqueeLeft 42s linear infinite;
  will-change: transform;
}

.carousel-container:hover .carousel-track-right,
.carousel-container:hover .carousel-track-left {
  animation-play-state: paused;
}

/* --- Testimonials Marquee & 3D Tilt Hover --- */
.testimonials-container {
  padding-top: 24px;
  padding-bottom: 32px;
  overflow: hidden;
  position: relative;
}

.testimonial-track {
  display: flex;
  width: max-content;
  animation: marqueeLeft 36s linear infinite;
  will-change: transform;
}

.testimonials-container:hover .testimonial-track {
  animation-play-state: paused;
}

.testimonial-card {
  transform-origin: center center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  will-change: transform;
}

.testimonial-card:hover {
  transform: translateY(-6px) rotate(1.5deg) scale(1.02);
  box-shadow: 8px 8px 0px #000000 !important;
  z-index: 25;
}

.testimonial-card:nth-child(even):hover {
  transform: translateY(-6px) rotate(-1.5deg) scale(1.02);
  box-shadow: 8px 8px 0px #000000 !important;
  z-index: 25;
}

/* --- 3D Slicer Print Simulation HUD & Laser --- */
.print-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #e6ff00;
  box-shadow: 0 0 10px #e6ff00, 0 0 20px #e6ff00;
  transition: top 0.15s ease-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes laserSweep {
  0% { top: 5%; opacity: 0.85; }
  50% { top: 92%; opacity: 1; }
  100% { top: 5%; opacity: 0.85; }
}

.laser-active {
  animation: laserSweep 3.5s ease-in-out infinite;
}

/* Grid lines for preview modal */
.print-bed-grid {
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
}

/* --- Scrollbar styling --- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Custom themed scrollbars for modals & drawers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-left: 2px solid #000;
}
::-webkit-scrollbar-thumb {
  background: #000000;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neo-blue);
}

/* --- Floating WhatsApp Quick Connect --- */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 45;
  background: #25d366;
  color: #000000;
  border: 2.5px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  padding: 10px 16px;
  border-radius: 30px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}
.floating-whatsapp:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000000;
  background: #20ba59;
}
.floating-whatsapp:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000000;
}

/* --- Modal & Overlay Transitions --- */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- Badge & Tag Glow --- */
.glow-pulse {
  animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(230, 255, 0, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(230, 255, 0, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(230, 255, 0, 0); }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .floating-whatsapp span {
    display: none;
  }
  .floating-whatsapp {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    bottom: 16px;
    left: 16px;
  }
}

/* ==========================================================================
   MOBILE OPTIMIZATION & ZERO-OVERFLOW SAFEGUARDS
   ========================================================================== */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  position: relative;
}

@media (max-width: 768px) {
  /* Prevent horizontal overflow on mobile for all legacy grids */
  .grid[style*="grid-template-columns"],
  .grid[style*="grid-template-columns:1.1fr 1fr"],
  .grid[style*="grid-template-columns:repeat(3,1fr)"],
  .grid[style*="grid-template-columns:1fr 1.4fr"],
  .grid[style*="grid-template-columns:repeat(2,1fr)"],
  .grid[style*="grid-template-columns:1.7fr 1fr"],
  .grid[style*="grid-template-columns:1fr 2fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .field-row,
  .field-row[style*="align-items:flex-end"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .field-row .field {
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  /* Cart table row responsive wrap */
  .cart-item-row {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  /* General card padding on small screens */
  .wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* --- Validation Error States --- */
.input-error,
.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fff5f5 !important;
  box-shadow: 3px 3px 0px #ef4444 !important;
}

.error-text {
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
  display: block;
}

/* --- Button Loading States --- */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

/* --- Modern Empty State Blocks --- */
.empty-state-box {
  padding: 48px 24px;
  text-align: center;
  background: #ffffff;
  border: 2.5px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  border-radius: 12px;
}

