/* -------------------------------------------------------------
   AVENZA ENTERPRISES - Elevated Minimalist B2B Styles
   Inspired by Mott & Bow Clean Aesthetic & Mobile-First UX
   ------------------------------------------------------------- */

:root {
  --primary-color: #09090b; /* Stark Deep Black */
  --secondary-color: #71717a; /* Muted Charcoal Gray */
  --border-color: #e4e4e7; /* Clean Light Zinc */
  --surface-color: #ffffff;
  --bg-subtle: #f9fafb;
}

html {
  scroll-behavior: smooth;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #18181b;
  background-color: #ffffff;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  letter-spacing: -0.01em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f4f4f5;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

/* Minimalist Glass Nav */
.glass-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Clean Mott & Bow Card Aesthetics */
.product-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
}
@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.06), 0 4px 8px -4px rgba(0, 0, 0, 0.03);
  }
}

/* Minimalist Badges */
.badge-dark {
  background-color: #09090b;
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Dialog & Drawer Animations */
dialog::backdrop {
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease-out;
}

dialog[open] {
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Slide Drawer */
.cart-drawer-backdrop {
  transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
}
.cart-drawer-panel {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Minimalist Toast */
#toast-container {
  position: fixed;
  bottom: 5.5rem; /* Raised on mobile to sit above bottom bar */
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.12);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Touch-optimized horizontal scrolling tabs */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Tabs right-edge scroll hint fade */
.tabs-scroll-wrapper {
  position: relative;
}
.tabs-scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 1rem;
  width: 36px;
  background: linear-gradient(to right, transparent, rgba(249, 250, 251, 0.95));
  pointer-events: none;
}

/* Better mobile touch feedback & tap targets */
button, a {
  touch-action: manipulation;
}
button:active, a:active {
  transform: scale(0.98);
  transition: transform 0.08s ease;
}

/* -------------------------------------------------------------
   MOBILE SPECIFIC OPTIMIZATIONS (<= 640px)
   ------------------------------------------------------------- */
@media (max-width: 640px) {
  #toast-container {
    right: 1rem;
    left: 1rem;
    bottom: 5rem;
  }
  .toast {
    min-width: 100%;
  }

  /* Full-width slide drawer on mobile */
  .cart-drawer-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    border-left: none !important;
  }

  /* Native Bottom Sheet on Mobile for Quick View & RFQ Modals */
  dialog[open] {
    position: fixed !important;
    inset-inline: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 88vh !important;
    margin: 0 !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
    border-bottom: none !important;
    border-inline: none !important;
    animation: bottomSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25) !important;
  }

  @keyframes bottomSheetSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Prevent iOS automatic input zoom */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* -------------------------------------------------------------
   3D HERO KNIFE CAROUSEL STYLING (TOUCH & DESKTOP TUNED)
   ------------------------------------------------------------- */
.hero-carousel-stage {
  perspective: 1200px;
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hero-carousel-ring {
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
}

.hero-carousel-card {
  position: absolute;
  width: 270px;
  height: 195px;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: filter 0.4s ease, opacity 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  cursor: pointer;
}

.hero-card-media {
  width: 100%;
  height: 130px;
  overflow: hidden;
  position: relative;
  background-color: transparent;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
}

.hero-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
  display: block;
}

.hero-carousel-card.is-active {
  border-color: rgba(24, 24, 27, 0.3);
  box-shadow: 0 20px 42px -10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(24, 24, 27, 0.12);
  filter: brightness(1);
  opacity: 1;
  z-index: 10;
}

.hero-carousel-card:not(.is-active) {
  filter: brightness(0.92);
  opacity: 0.72;
}

@media (hover: hover) and (pointer: fine) {
  .hero-carousel-card:not(.is-active):hover {
    opacity: 0.95;
    filter: brightness(0.98);
  }
}

@media (max-width: 640px) {
  .hero-carousel-stage {
    height: 240px !important;
    perspective: 800px;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  .hero-carousel-card {
    width: 175px !important;
    height: 145px !important;
    border-radius: 0.875rem;
  }

  .hero-card-media {
    height: 92px !important;
    padding: 0.25rem;
  }
}

/* -------------------------------------------------------------
   STICKY MOBILE BOTTOM CONVERSION BAR
   ------------------------------------------------------------- */
.mobile-bottom-bar {
  padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
}
