/* Moto Bro - Refined Motorsport High-Contrast (Eye-Friendly & Responsive) */

:root {
  --moto-red: #E5252A;
  --moto-red-hover: #C4161B;
  --moto-red-light: #FF3B41;
  --moto-black: #0A0A0C;
  --moto-black-card: #121318;
  --moto-white: #FFFFFF;
  --moto-gray: #F7F8FA;
  --moto-border: #E5E7EB;
}

/* Eye-friendly soft canvas: smooth on retinas, not blinding, not washed out */
body {
  background-color: #F7F8FA;
  color: #0A0A0C;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Racing heading font */
.font-race {
  font-family: 'Montserrat', sans-serif;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* Subtle, gentle speed dot pattern for light sections (pleasant on eyes) */
.bg-race-dots {
  background-color: #F7F8FA;
  background-image: radial-gradient(rgba(203, 213, 225, 0.7) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}

/* Subtle carbon fiber pattern for dark elements */
.bg-carbon-pattern {
  background-color: #0A0A0C;
  background-image: 
    linear-gradient(45deg, #141418 25%, transparent 25%), 
    linear-gradient(-45deg, #141418 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #141418 75%), 
    linear-gradient(-45deg, transparent 75%, #141418 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Enlarged, Easy-to-Tap Language Switcher Buttons */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  border-radius: 8px;
  transition: all 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.lang-btn.active-lang {
  background-color: #E5252A !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(229, 37, 42, 0.35);
}

/* Category pills */
.category-pill {
  transition: all 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.category-pill.active-category {
  background-color: #0A0A0C !important;
  color: #FFFFFF !important;
  border-color: #0A0A0C !important;
  box-shadow: 0 4px 12px rgba(10, 10, 12, 0.15);
}

/* Clean, eye-friendly cards (not cutting eyes with harsh black lines) */
.moto-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 1px 3px 0 rgba(10, 10, 12, 0.04), 0 4px 12px -2px rgba(10, 10, 12, 0.03);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.moto-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 12px 24px -4px rgba(10, 10, 12, 0.08), 0 4px 8px -2px rgba(10, 10, 12, 0.04);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0A0A0C;
}
::-webkit-scrollbar-thumb {
  background: #E5252A;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #FF3B41;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Product Cards & Photo Container */
.product-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(10, 10, 12, 0.04), 0 4px 14px -2px rgba(10, 10, 12, 0.04);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: #CBD5E1;
  box-shadow: 0 16px 28px -6px rgba(10, 10, 12, 0.09), 0 6px 12px -2px rgba(10, 10, 12, 0.05);
}

.product-photo-wrap {
  position: relative;
  width: 100%;
  height: 216px;
  background: #F3F4F6;
  overflow: hidden;
}

.product-photo-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
  outline: none;
}

.product-photo-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.product-photo-button:hover img,
.product-photo-button:focus-visible img {
  transform: scale(1.05);
  filter: brightness(0.96);
}

.product-photo-button:focus-visible {
  outline: 3px solid var(--moto-red);
  outline-offset: -3px;
}

/* Hover overlay badge on product card */
.product-zoom-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.product-photo-wrap:hover .product-zoom-hint,
.product-photo-button:focus-visible ~ .product-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Badge indicating multiple photos */
.product-count-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mini thumbnail strip inside product card (for multi-image products) */
.card-mini-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #F8F9FA;
  border-bottom: 1px solid #E5E7EB;
  overflow-x: auto;
  scrollbar-width: thin;
}

.card-mini-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #E2E8F0;
  background: #FFFFFF;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card-mini-thumb:hover {
  border-color: #94A3B8;
  transform: scale(1.06);
}

.card-mini-thumb.is-active {
  border-color: var(--moto-red);
  box-shadow: 0 0 0 1px var(--moto-red);
}

.card-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* WhatsApp action button on product card */
.card-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding: 10px 16px;
  border-radius: 12px;
  background: #0A0A0C;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  user-select: none;
}

.card-wa-btn:hover {
  background: var(--moto-red);
  box-shadow: 0 4px 14px rgba(229, 37, 42, 0.35);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------- */
/* Fullscreen Lightbox (MotoBro Motorsport Dark Theme)            */
/* ------------------------------------------------------------- */
body.lightbox-open {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none !important;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}

.product-lightbox.is-open {
  display: flex;
}

/* Dimmed backdrop with blur */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1;
}

/* Top bar with title, counter & controls */
.lightbox-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.9) 0%, rgba(8, 8, 10, 0.4) 70%, transparent 100%);
  pointer-events: none;
}

.lightbox-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  pointer-events: auto;
}

.lightbox-title {
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  max-width: 50vw;
}

.lightbox-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.lightbox-tool-btn,
.lightbox-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(22, 23, 29, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.lightbox-tool-btn:hover,
.lightbox-tool-btn:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
  outline: none;
}

.lightbox-close {
  background: rgba(229, 37, 42, 0.85);
  border-color: rgba(229, 37, 42, 0.9);
  font-size: 18px;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--moto-red);
  border-color: var(--moto-red);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(229, 37, 42, 0.5);
  outline: none;
}

/* Left / Right navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(22, 23, 29, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: var(--moto-red);
  border-color: var(--moto-red);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 18px rgba(229, 37, 42, 0.45);
  outline: none;
}

.lightbox-nav[hidden] {
  display: none !important;
}

/* Image Stage */
.lightbox-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 80px 84px 90px;
  padding-left: max(84px, env(safe-area-inset-left));
  padding-right: max(84px, env(safe-area-inset-right));
  overflow: hidden;
  touch-action: none;
}

.lightbox-spinner {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lightbox-spinner[hidden] {
  display: none !important;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.18s ease-out;
  will-change: transform;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-image.is-dragging {
  cursor: grabbing;
  transition: none !important;
}

/* Bottom thumbnail preview bar (when product has > 1 image) */
.lightbox-thumbs-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 680px);
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(18, 19, 24, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow-x: auto;
  scrollbar-width: thin;
}

.lightbox-thumbs-bar[hidden] {
  display: none !important;
}

.lightbox-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #0A0A0C;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  padding: 0;
  transition: all 0.2s ease;
}

.lightbox-thumb:hover {
  opacity: 0.9;
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-thumb.is-active {
  border-color: var(--moto-red);
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(229, 37, 42, 0.6);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- */
/* Mobile Screen Adaptations (Smartphones & Tablets)             */
/* ------------------------------------------------------------- */
@media (max-width: 640px) {
  .product-photo-wrap {
    height: 220px;
  }

  .product-zoom-hint {
    display: none; /* Hide hover hint on mobile touch devices */
  }

  .lightbox-header {
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .lightbox-title {
    font-size: 13px;
    max-width: 44vw;
  }

  .lightbox-counter {
    font-size: 11px;
    padding: 3px 9px;
  }

  .lightbox-tool-btn {
    display: none; /* Hide extra zoom buttons on mobile in favor of touch gestures */
  }

  .lightbox-close {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .lightbox-stage {
    padding: 64px 12px 80px;
    padding-top: max(64px, env(safe-area-inset-top));
    padding-bottom: max(80px, env(safe-area-inset-bottom));
  }

  .lightbox-nav {
    width: 46px;
    height: 46px;
    font-size: 18px;
    background: rgba(18, 19, 24, 0.85);
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-thumbs-bar {
    bottom: 12px;
    padding: 6px 10px;
    gap: 8px;
    max-width: 94vw;
  }

  .lightbox-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }
}
