/* ==================================================================
 * TAM ENGINE TYPOGRAPHY SYSTEM
 * Headings: Estedad (Weights: 700 Bold, 800 ExtraBold, 900 Black)
 * Body / UI: Vazirmatn (Weights: 400 Regular, 500 Medium, 700 Bold, 900 Black)
 * Technical Latin / Numbers: ui-sans-serif, system-ui
 * ================================================================== */

/* --- VAZIRMATN (Variable + Static Fallbacks) --- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
       url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --- ESTEDAD (Variable + Static Fallbacks for Headings) --- */
@font-face {
  font-family: 'Estedad';
  src: url('../fonts/Estedad-Variable.woff2') format('woff2-variations'),
       url('../fonts/Estedad-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Estedad';
  src: url('../fonts/Estedad-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Estedad';
  src: url('../fonts/Estedad-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Estedad';
  src: url('../fonts/Estedad-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --- GLOBAL TOKENS & TYPOGRAPHY SYSTEM --- */
:root {
  --font-sans: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Estedad", "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body {
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: Technical automotive presence with Estedad */
h1, h2, h3, h4, .font-heading, [data-heading] {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Hero H1 and Subtitle */
.hero-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2.15rem, 5.2vw, 3.75rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.25vw, 1.125rem);
  line-height: 1.85;
}

/* Navigation items */
nav a, [data-site-header] a {
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Inputs, Selects, and Oil Finder */
input, select, textarea, [data-oil-finder] select {
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Product names & section cards */
.product-title {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Strict preservation for Latin technical codes & numerals */
.latin, [dir="ltr"] .latin, span.latin, p.latin, span.num {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/*
 * TAM ENGINE — Django-side helpers that mirror Tailwind utilities generated
 * from the Lovable source (values are copied exactly; no new design tokens).
 *   .tam-container === Container.tsx  (max-w-[1500px] px-5 md:px-8 lg:px-12)
 *   .tam-messages   === floating feedback stack (design-token styled)
 */
.tam-container {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 768px) {
  .tam-container { padding-inline: 2rem; }
}
@media (min-width: 1024px) {
  .tam-container { padding-inline: 3rem; }
}

.tam-messages {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: calc(100vw - 2rem);
  max-width: 25rem;
  pointer-events: none;
}

@media (max-width: 767px) {
  .tam-messages {
    bottom: 5rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
}

.tam-message {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background-color: color-mix(in oklab, var(--color-surface) 92%, black);
  color: var(--color-foreground);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: tam-toast-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease;
  max-height: 200px;
}

html:not(.dark) .tam-message {
  background-color: color-mix(in oklab, var(--color-surface) 96%, white);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.16), 0 2px 8px -2px rgba(0, 0, 0, 0.08);
}

.tam-message-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.tam-message-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background-color: color-mix(in oklab, var(--color-surface-2, var(--color-surface)) 80%, transparent);
  color: var(--color-primary);
  margin-top: 0.125rem;
}

.tam-message.success .tam-message-icon {
  background-color: color-mix(in oklab, var(--color-primary) 18%, transparent);
  color: var(--color-primary);
}

.tam-message.error .tam-message-icon,
.tam-message.warning .tam-message-icon {
  background-color: color-mix(in oklab, var(--color-destructive) 18%, transparent);
  color: var(--color-destructive);
}

.tam-message-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--color-foreground);
  margin: 0;
  word-break: break-word;
}

.tam-message-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  border: none;
  background: transparent;
  color: var(--color-muted-foreground);
  cursor: pointer;
  padding: 0;
  margin-top: 0.125rem;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.tam-message-close:hover {
  color: var(--color-foreground);
  background-color: color-mix(in oklab, var(--color-foreground) 10%, transparent);
}

.tam-message-close:active {
  transform: scale(0.92);
}

.tam-message.success {
  border-color: color-mix(in oklab, var(--color-primary) 55%, transparent);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 20px -6px color-mix(in oklab, var(--color-primary) 25%, transparent);
}

.tam-message.error,
.tam-message.warning {
  border-color: color-mix(in oklab, var(--color-destructive) 55%, transparent);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 20px -6px color-mix(in oklab, var(--color-destructive) 25%, transparent);
}

/* 5-second progress bar */
.tam-message-progress {
  position: relative;
  width: 100%;
  height: 3px;
  background-color: color-mix(in oklab, var(--color-foreground) 8%, transparent);
  overflow: hidden;
}

.tam-message-bar {
  display: block;
  height: 100%;
  width: 0%;
  background-color: var(--color-primary);
  background-image: linear-gradient(90deg, var(--color-primary), color-mix(in oklab, var(--color-primary) 70%, white));
  animation: tam-progress-fill 5s linear forwards;
  transform-origin: right center;
}

.tam-message.error .tam-message-bar,
.tam-message.warning .tam-message-bar {
  background-color: var(--color-destructive);
  background-image: linear-gradient(90deg, var(--color-destructive), color-mix(in oklab, var(--color-destructive) 70%, white));
}

/* Pause progress bar when hovering */
.tam-message:hover .tam-message-bar {
  animation-play-state: paused;
}

/* Exit state */
.tam-message--exit {
  opacity: 0 !important;
  transform: translateY(14px) scale(0.95) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none !important;
  border-width: 0 !important;
}

@keyframes tam-toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tam-progress-fill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tam-message {
    animation: none;
    transition: opacity 0.2s ease;
  }
  .tam-message-bar {
    animation-duration: 5s;
  }
}

/* Theme switch crossfade — identical motion to theme-toggle.tsx */
[data-theme-moon] {
  transform: scale(0.5) rotate(-90deg);
  opacity: 0;
  transition: transform 300ms cubic-bezier(0, 0, 0.2, 1), opacity 300ms cubic-bezier(0, 0, 0.2, 1);
}
[data-theme-sun] {
  transform: scale(1) rotate(0deg);
  opacity: 1;
  transition: transform 300ms cubic-bezier(0, 0, 0.2, 1), opacity 300ms cubic-bezier(0, 0, 0.2, 1);
}
.dark [data-theme-moon] {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}
.dark [data-theme-sun] {
  transform: scale(0.5) rotate(90deg);
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  [data-theme-moon],
  [data-theme-sun] { transition: none; }
}

/* Native controls follow the active theme tokens */
input[type="checkbox"],
input[type="radio"] { accent-color: var(--color-primary); }

/* ------------------------------------------------------------------ *
 * RESPONSIVE / OVERLAP FIXES (audit-driven, see scratch/audit/)
 * ------------------------------------------------------------------ */

/* The site header is `fixed` and measures 65px; anchor navigation and
   scrollIntoView() must not land content underneath it. */
html { scroll-padding-top: 5rem; }

/* At the smallest breakpoint the checkout eyebrow ("CHECKOUT SYSTEM / TAM-01")
   measures 166px inside a 154px column and ellipsis-loses its tail. One step
   down at <=374px only; 360px and up already fit unclipped. */
@media (max-width: 374px) {
  [data-progress] .latin.truncate { font-size: 9px; }
}

/* The support FAB (bottom-left, z-60) otherwise sits on top of the
   fixed bottom action bars (purchase bar z-50, checkout bar z-40) and
   covers their primary CTA. Mirrors the html[data-bottom-nav] rule that
   already exists in the Tailwind source. */
@media (max-width: 1023px) {
  html:has([data-mobile-purchase-bar].translate-y-0) .tam-support-fab,
  html:has([data-bottom-bar]) .tam-support-fab {
    bottom: 5.5rem;
  }
}

/* Empty-state hook kept from the legacy site.css: list/collection shells already
   carry their own spacing, this only guarantees the block spans the full grid. */
.empty-state { grid-column: 1 / -1; }

/* Hero full-screen cinematic video container */
.hero-fullscreen {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  min-height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background-color: #000;
}
.hero-video-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  background-color: #000;
}

/* Full-bleed copy of the hero artwork (same preloaded poster) used as a
   blurred backdrop. Hidden everywhere except the portrait composition
   below, so desktop rendering is untouched. */
.hero-backdrop { display: none; }

/* ------------------------------------------------------------------ *
 * HERO — PORTRAIT / NARROW COMPOSITION
 * ------------------------------------------------------------------ *
 * The artwork and its poster are 16:9. On a portrait viewport both naive
 * strategies fail:
 *   cover   -> ~70% of the frame is cropped away and the logo is cut off;
 *   contain -> a thin 16:9 strip centred in the hero with huge black bands.
 *
 * The black bands were caused by the previous rule
 *   `@media (max-aspect-ratio: 16/9) { object-fit: contain !important }`
 * which every portrait viewport matches (a phone is ~0.46), letterboxing
 * the video into a ~24%-tall strip. Widescreen desktops (viewport wider
 * than 16:9 once browser chrome is subtracted) never matched it, which is
 * why desktop looked right.
 *
 * Fix: give portrait its own composition, scoped to this component.
 *   - `.hero-backdrop` fills the whole section with the artwork's own
 *     colour/light (blurred + darkened), replacing the flat black;
 *   - the sharp video is sized from its WIDTH (185% of the hero) with
 *     `aspect-ratio: 16/9` pinned, so it renders ~45-75% of the hero
 *     height, can never letterbox inside its own box (no intrinsic-size
 *     flash before `loadedmetadata`), and — because the box is sized from
 *     the width — always exposes the same 54% horizontal window, in which
 *     the emblem, the TAM ENGINE wordmark and the tagline all sit with
 *     margin to spare at every phone width.
 *
 * Landscape phones, landscape tablets and desktop keep plain `cover`.
 * ------------------------------------------------------------------ */
@media (max-aspect-ratio: 1/1) {
  .hero-backdrop {
    display: block;
    position: absolute;
    /* Oversized so the blur falloff falls outside the clipped hero box. */
    inset: -12%;
    background-position: 50% 50%;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(28px) saturate(1.15) brightness(0.6);
    pointer-events: none;
    contain: strict;
    transform: translateZ(0);
    will-change: transform;
  }

  .hero-video-element {
    inset: auto;
    top: 50%;
    left: 50%;
    /* Preflight sets `img, video { max-width: 100% }`, which would clamp
       this back to the hero width and restore the letterbox strip. */
    max-width: none;
    width: 185%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center center;
    transform: translate(-50%, -50%);
    /* Sub-pixel rounding must never paint a black hairline over the
       blurred backdrop; the backdrop is the fallback while loading. */
    background-color: transparent;
  }

  /* Keep the scroll cue clear of the iOS home indicator. Falls back to
     the Tailwind `bottom-8` value if env() is unsupported. */
  .hero-bounce {
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
}
@keyframes hero-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.hero-bounce {
  animation: hero-bounce 1.8s ease-in-out infinite;
}

/* ==================================================================
 * TAM ENGINE Premium Product Card (Automotive Showcase)
 * ================================================================== */
.tam-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 0.75rem;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 320ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .tam-product-card {
    padding: 0.875rem;
  }
}

.tam-product-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  box-shadow: 0 16px 36px -8px oklch(0 0 0 / 0.12);
}

.dark .tam-product-card:hover {
  box-shadow: 0 20px 40px -10px oklch(0 0 0 / 0.5),
              0 0 24px -4px color-mix(in oklab, var(--primary) 15%, transparent);
}

.tam-product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 14.5rem;
  border-radius: 0.875rem;
  overflow: hidden;
  background: radial-gradient(circle at center, var(--surface-2) 0%, var(--background) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.tam-product-media img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-product-card:hover .tam-product-media img {
  transform: scale(1.06);
}

.tam-card-pill {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-color: color-mix(in oklab, var(--background) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  contain: paint;
}

.dark .tam-card-pill {
  background-color: color-mix(in oklab, var(--surface) 85%, transparent);
}

/* ------------------------------------------------------------------
 * Discounted Product Card Effects & Badge
 * ------------------------------------------------------------------ */
.tam-product-card.tam-card-discounted {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
}

.tam-product-card.tam-card-discounted:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 40px -10px oklch(0 0 0 / 0.14),
              0 0 20px -4px color-mix(in oklab, var(--primary) 22%, transparent);
}

.dark .tam-product-card.tam-card-discounted {
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  box-shadow: 0 14px 32px -10px oklch(0 0 0 / 0.5),
              0 0 18px -6px color-mix(in oklab, var(--primary) 18%, transparent);
}

.dark .tam-product-card.tam-card-discounted:hover {
  border-color: var(--primary);
  box-shadow: 0 22px 46px -10px oklch(0 0 0 / 0.65),
              0 0 30px -2px color-mix(in oklab, var(--primary) 32%, transparent);
}

.tam-card-pill-discounted {
  border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
  box-shadow: 0 2px 10px -2px color-mix(in oklab, var(--primary) 20%, transparent);
  transition: border-color 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

.tam-product-card:hover .tam-card-pill-discounted {
  border-color: color-mix(in oklab, var(--primary) 70%, transparent);
  box-shadow: 0 4px 16px -2px color-mix(in oklab, var(--primary) 35%, transparent);
}

.tam-discount-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  overflow: hidden;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in oklab, var(--primary) 85%, #f59e0b) 100%);
  color: var(--primary-foreground);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px -1px color-mix(in oklab, var(--primary) 40%, transparent);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
              filter 300ms ease;
}

.tam-product-card:hover .tam-discount-badge,
.tam-discount-badge:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px 0 color-mix(in oklab, var(--primary) 55%, transparent);
  filter: brightness(1.05);
}

.tam-discount-icon {
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tam-product-card:hover .tam-discount-icon,
.tam-discount-badge:hover .tam-discount-icon {
  transform: rotate(15deg) scale(1.15);
}

.tam-discount-shimmer {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  pointer-events: none;
  transition: transform 650ms ease-in-out;
}

.tam-product-card:hover .tam-discount-shimmer,
.tam-discount-badge:hover .tam-discount-shimmer {
  transform: translateX(100%);
}

/* ==================================================================
 * TAM ENGINE Mobile 5-Card Product Row (Automotive Showcase)
 * Displays exactly 5 product cards side by side on mobile viewports (< 768px)
 * with smooth horizontal scrolling and scroll-snap.
 * Desktop & Tablet (>= 768px) preserve responsive multi-column grid layouts.
 * ================================================================== */
:root {
  --tam-mobile-5card-gap: 0.3125rem; /* 5px */
}

@media (max-width: 360px) {
  :root {
    --tam-mobile-5card-gap: 0.25rem; /* 4px */
  }
}

@media (max-width: 767.98px) {
  .tam-mobile-5card-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x pan-y;
    gap: var(--tam-mobile-5card-gap) !important;
    padding-bottom: 0.5rem;
    padding-inline: 0 !important;
    margin-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--primary) 70%, transparent) color-mix(in oklab, var(--border) 40%, transparent);
  }

  .tam-mobile-5card-row::-webkit-scrollbar {
    height: 3px;
  }

  .tam-mobile-5card-row::-webkit-scrollbar-track {
    background: color-mix(in oklab, var(--border) 40%, transparent);
    border-radius: 9999px;
  }

  .tam-mobile-5card-row::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--primary) 70%, transparent);
    border-radius: 9999px;
  }

  /* Responsive card sizing on mobile: readable dimensions, not 5 squished cards */
  .tam-mobile-5card-row > .tam-product-card,
  .tam-mobile-5card-row > article,
  .tam-mobile-5card-row > .tam-mobile-5card-item {
    flex: 0 0 min(280px, 80%) !important;
    width: min(280px, 80%) !important;
    max-width: 320px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  /* Compact media box on mobile 5-card */
  .tam-mobile-5card-row .tam-product-media {
    padding: 0.125rem !important;
    border-radius: 0.375rem !important;
    aspect-ratio: 1 / 1 !important;
    max-height: none !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  .tam-mobile-5card-row .tam-product-media img {
    max-height: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    aspect-ratio: 1 / 1 !important;
  }

  .tam-mobile-5card-row .tam-product-card:active {
    transform: scale(0.98);
  }
}

@media (min-width: 768px) {
  .tam-mobile-5card-row {
    overflow-x: visible;
  }
  .tam-mobile-5card-row > .tam-product-card,
  .tam-mobile-5card-row > article,
  .tam-mobile-5card-row > .tam-mobile-5card-item {
    flex: initial !important;
    width: auto !important;
    max-width: none !important;
    scroll-snap-align: none !important;
  }
}

/* ==================================================================
 * MAGIC UI — INTERACTIVE HOVER BUTTON
 * Ported for TAM ENGINE (RTL & Light/Dark Theme Compliant)
 * ================================================================== */
.tam-interactive-hover-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  overflow: hidden;
  border-radius: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  background-color: var(--surface-2);
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  transition: border-color 300ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-interactive-hover-btn:hover,
.tam-interactive-hover-btn:focus-visible {
  will-change: transform, box-shadow;
}

.tam-interactive-hover-btn:active {
  transform: scale(0.96);
}

.tam-interactive-hover-btn .tam-ihb-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-interactive-hover-btn:hover .tam-ihb-content,
.tam-interactive-hover-btn:focus-visible .tam-ihb-content {
  will-change: transform, opacity;
}

.tam-interactive-hover-btn .tam-ihb-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--primary);
  box-shadow: 0 0 10px color-mix(in oklab, var(--primary) 70%, transparent);
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.tam-interactive-hover-btn:hover .tam-ihb-dot,
.tam-interactive-hover-btn:focus-visible .tam-ihb-dot {
  will-change: transform;
}

.tam-interactive-hover-btn .tam-ihb-overlay {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  color: var(--primary-foreground);
  opacity: 0;
  transform: translateX(-1.5rem);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 260ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 10;
}

.tam-interactive-hover-btn:hover .tam-ihb-overlay,
.tam-interactive-hover-btn:focus-visible .tam-ihb-overlay {
  will-change: transform, opacity;
}

/* Hover Interaction: Dot scales up smoothly to fill background, text transitions */
.tam-interactive-hover-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px -4px color-mix(in oklab, var(--primary) 38%, transparent);
}

.tam-interactive-hover-btn:hover .tam-ihb-dot {
  transform: scale(95);
}

.tam-interactive-hover-btn:hover .tam-ihb-content {
  opacity: 0;
  transform: translateX(-1.5rem);
}

.tam-interactive-hover-btn:hover .tam-ihb-overlay {
  opacity: 1;
  transform: translateX(0);
}

.tam-interactive-hover-btn:hover .tam-ihb-overlay svg {
  transform: translateX(-3px);
}

/* sm: upgrades (sm:px-3 / sm:text-xs) — Django templates are not scanned by the
 * Tailwind build, so these utilities do not exist in tam.css; plain CSS instead. */
@media (min-width: 640px) {
  .tam-interactive-hover-btn {
    padding-inline: 0.75rem;
    font-size: 0.75rem;
  }
}

/* ==================================================================
 * ANIMATED CART INTERACTION & VISUAL EFFECTS
 * ================================================================== */
.tam-cart-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  transition: border-color 260ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 260ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-cart-action-btn:hover,
.tam-cart-action-btn:focus-visible {
  will-change: transform, box-shadow;
}

.tam-cart-action-btn:hover {
  border-color: var(--primary);
  background-color: color-mix(in oklab, var(--primary) 12%, transparent);
  box-shadow: 0 6px 20px -3px color-mix(in oklab, var(--primary) 35%, transparent),
              0 0 12px 1px color-mix(in oklab, var(--primary) 25%, transparent);
}

/* Subtle ambient halo pulse */
.tam-cart-halo {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid color-mix(in oklab, var(--primary) 50%, transparent);
  opacity: 0;
  transform: scale(0.85);
  transition: all 300ms ease-out;
  pointer-events: none;
}

.tam-cart-action-btn:hover .tam-cart-halo {
  opacity: 1;
  transform: scale(1);
}

/* Cart Icon Micro-Wobble / Bounce on hover */
.tam-cart-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tam-cart-action-btn:hover .tam-cart-icon-wrap {
  animation: tam-cart-wobble 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tam-cart-wobble {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-14deg) scale(1.2) translateY(-1px);
  }
  50% {
    transform: rotate(10deg) scale(1.15) translateY(-1px);
  }
  75% {
    transform: rotate(-4deg) scale(1.08);
  }
  100% {
    transform: rotate(0deg) scale(1.12);
  }
}

/* Header Cart Button */
.tam-header-cart-btn {
  position: relative;
  overflow: visible !important;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-header-cart-btn:hover {
  color: var(--primary);
  background-color: color-mix(in oklab, var(--primary) 8%, transparent);
  box-shadow: 0 4px 16px -2px color-mix(in oklab, var(--primary) 25%, transparent);
}

.tam-header-cart-btn .tam-cart-icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.15;
}

.tam-header-cart-btn:hover .tam-cart-icon {
  animation: tam-cart-wobble 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Header Search Button */
.tam-header-search-btn {
  position: relative;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-header-search-btn:hover {
  color: var(--primary);
  background-color: color-mix(in oklab, var(--primary) 8%, transparent);
  box-shadow: 0 4px 16px -2px color-mix(in oklab, var(--primary) 25%, transparent);
}

.tam-header-search-btn .tam-search-icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.15;
}

.tam-header-search-btn:hover .tam-search-icon {
  animation: tam-search-wobble 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tam-search-wobble {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-16deg) scale(1.18);
  }
  50% {
    transform: rotate(10deg) scale(1.14);
  }
  75% {
    transform: rotate(-4deg) scale(1.08);
  }
  100% {
    transform: rotate(0deg) scale(1.12);
  }
}

/* Header Theme Button */
.tam-header-theme-btn {
  position: relative;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tam-header-theme-btn:hover {
  color: var(--primary);
  background-color: color-mix(in oklab, var(--primary) 8%, transparent);
  box-shadow: 0 4px 16px -2px color-mix(in oklab, var(--primary) 25%, transparent);
}

.tam-header-theme-btn .tam-theme-icon {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.15;
}

.tam-header-theme-btn:hover [data-theme-sun] {
  animation: tam-theme-sun-wobble 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.dark .tam-header-theme-btn:hover [data-theme-moon] {
  animation: tam-theme-moon-wobble 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tam-theme-sun-wobble {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(25deg);
  }
  50% {
    transform: scale(1.14) rotate(-12deg);
  }
  75% {
    transform: scale(1.08) rotate(6deg);
  }
  100% {
    transform: scale(1.12) rotate(0deg);
  }
}

@keyframes tam-theme-moon-wobble {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-18deg);
  }
  50% {
    transform: scale(1.14) rotate(10deg);
  }
  75% {
    transform: scale(1.08) rotate(-4deg);
  }
  100% {
    transform: scale(1.12) rotate(0deg);
  }
}

/* Dynamic Elastic Cart Badge Bump Animation */
.tam-cart-badge {
  position: absolute;
  top: -0.25rem;
  left: -0.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--primary) 45%, transparent);
  border: 2px solid var(--background);
  z-index: 20;
  pointer-events: none;
  transform-origin: center center;
}

.tam-cart-action-btn .tam-cart-icon {
  stroke-width: 2.15;
}

.tam-badge-bump {
  animation: tam-badge-bounce 650ms cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes tam-badge-bounce {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.4) rotate(-10deg);
  }
  50% {
    transform: scale(0.9) rotate(5deg);
  }
  75% {
    transform: scale(1.15) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Success Checkmark Pop */
.tam-cart-done-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tam-check-icon {
  animation: tam-check-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tam-check-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.35);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tam-check-ring {
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 2px solid oklch(0.72 0.22 150);
  opacity: 0;
  animation: tam-ring-expand 700ms ease-out forwards;
}

@keyframes tam-ring-expand {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* ==================================================================
 * CHECKOUT PROGRESS — PRECISION MECHANICAL GEAR
 * Compact 24px automotive cogwheel with live engine breathing pulse
 * ================================================================== */
.tam-checkout-gear-wrap {
  position: absolute;
  top: 1.5rem; /* 24px (top-6) */
  z-index: 25;
  pointer-events: none;
}

@media (min-width: 768px) {
  .tam-checkout-gear-wrap {
    top: 1.75rem; /* 28px (top-7) */
  }
}

.tam-checkout-gear-body {
  position: relative;
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  margin-top: -11px;
  transform-origin: 50% 50%;
  will-change: transform;
}

.tam-checkout-gear-svg {
  display: block;
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--primary) 70%, transparent));
}

/* Live engine breathing halo & core glow */
.tam-gear-glow-halo {
  animation: tam-gear-halo-pulse 2.2s ease-in-out infinite alternate;
}

@keyframes tam-gear-halo-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.35);
    opacity: 0.85;
  }
}

.tam-gear-center-dot {
  animation: tam-gear-dot-pulse 1.8s ease-in-out infinite alternate;
  transform-origin: 24px 24px;
}

@keyframes tam-gear-dot-pulse {
  0% {
    opacity: 0.7;
    filter: drop-shadow(0 0 1px var(--primary));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--primary));
  }
}

/* ==================================================================
 * TAM ENGINE SUPPORT FLOATING PROMPT PILL & LIVE INDICATOR
 * Floating interactive prompt next to bottom-left support widget FAB.
 * Responsive, dark/light theme aware, animated bob & live status pulse.
 * ================================================================== */
.tam-support-pill {
  position: absolute;
  left: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  white-space: nowrap;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--foreground);
  box-shadow: 0 6px 20px -3px oklch(0 0 0 / 0.1), 0 2px 6px -1px oklch(0 0 0 / 0.05);
  cursor: pointer;
  user-select: none;
  z-index: 10;
  max-width: calc(100vw - 6.5rem);
  animation: tam-support-pill-float 3.2s ease-in-out infinite;
  transition: border-color 0.25s ease,
              color 0.25s ease,
              box-shadow 0.25s ease,
              background-color 0.25s ease;
}

.dark .tam-support-pill {
  border-color: color-mix(in oklab, var(--border) 90%, transparent);
  background-color: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--foreground);
  box-shadow: 0 8px 24px -4px oklch(0 0 0 / 0.55), 0 0 0 1px oklch(1 1 1 / 0.05);
}

.tam-support-pill:hover {
  border-color: color-mix(in oklab, var(--primary) 70%, var(--border));
  color: var(--primary);
  box-shadow: 0 10px 28px -4px oklch(0 0 0 / 0.16),
              0 0 16px -2px color-mix(in oklab, var(--primary) 35%, transparent);
}

.dark .tam-support-pill:hover {
  border-color: color-mix(in oklab, var(--primary) 75%, var(--border));
  color: var(--primary);
  box-shadow: 0 12px 32px -4px oklch(0 0 0 / 0.65),
              0 0 20px -2px color-mix(in oklab, var(--primary) 45%, transparent);
}

/* Tooltip tail pointer pointing toward the FAB */
.tam-support-pill-tail {
  position: absolute;
  left: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  background-color: color-mix(in oklab, var(--surface) 95%, transparent);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.dark .tam-support-pill-tail {
  background-color: color-mix(in oklab, var(--surface) 90%, transparent);
  border-left-color: color-mix(in oklab, var(--border) 90%, transparent);
  border-bottom-color: color-mix(in oklab, var(--border) 90%, transparent);
}

.tam-support-pill:hover .tam-support-pill-tail {
  border-left-color: color-mix(in oklab, var(--primary) 70%, var(--border));
  border-bottom-color: color-mix(in oklab, var(--primary) 70%, var(--border));
}

.dark .tam-support-pill:hover .tam-support-pill-tail {
  border-left-color: color-mix(in oklab, var(--primary) 75%, var(--border));
  border-bottom-color: color-mix(in oklab, var(--primary) 75%, var(--border));
}

/* Online live status indicator */
.tam-support-dot {
  position: relative;
  display: flex;
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
}

.tam-support-dot-ping {
  position: absolute;
  inset: 0;
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background-color: #34d399;
  opacity: 0.75;
  animation: tam-support-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.tam-support-dot-core {
  position: relative;
  display: inline-flex;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

@keyframes tam-support-ping {
  75%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes tam-support-pill-float {
  0%, 100% {
    translate: 0 0px;
  }
  50% {
    translate: 0 -3.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tam-product-card,
  .tam-product-media img,
  .tam-interactive-hover-btn,
  .tam-interactive-hover-btn .tam-ihb-dot,
  .tam-interactive-hover-btn .tam-ihb-content,
  .tam-interactive-hover-btn .tam-ihb-overlay,
  .tam-cart-action-btn,
  .tam-cart-action-btn:hover .tam-cart-icon-wrap,
  .tam-header-cart-btn:hover .tam-cart-icon,
  .tam-header-search-btn:hover .tam-search-icon,
  .tam-header-theme-btn:hover [data-theme-sun],
  .dark .tam-header-theme-btn:hover [data-theme-moon],
  .tam-checkout-gear-body,
  .tam-gear-glow-halo,
  .tam-gear-center-dot,
  .tam-badge-bump,
  .tam-check-icon,
  .tam-check-ring,
  .tam-support-pill,
  .tam-support-dot-ping {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
  }
  .tam-support-pill-tail {
    transition: none !important;
  }
  .tam-interactive-hover-btn:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
  }
  .tam-interactive-hover-btn:hover .tam-ihb-content {
    display: none;
  }
  .tam-interactive-hover-btn:hover .tam-ihb-overlay {
    opacity: 1;
    color: var(--primary-foreground);
  }
}

/* ==================================================================
 * VENGEANCE UI "ANIMATED RAYS" — TAM ENGINE GLOBAL BACKGROUND LAYER
 * ================================================================== */
:root {
  --stripe-color: #ffffff;
  --tam-ray-c1: rgba(220, 38, 38, 0.20);
  --tam-ray-c2: rgba(217, 119, 6, 0.16);
  --tam-ray-c3: rgba(100, 116, 139, 0.18);
  --tam-ray-c4: rgba(148, 163, 184, 0.16);
  --tam-rays-filter: blur(14px) invert(100%) opacity(12%) saturate(120%);
}

.dark {
  --stripe-color: #000000;
  --tam-ray-c1: rgba(220, 38, 38, 0.50);
  --tam-ray-c2: rgba(245, 158, 11, 0.40);
  --tam-ray-c3: rgba(240, 246, 252, 0.55);
  --tam-ray-c4: rgba(148, 163, 184, 0.45);
  --tam-rays-filter: blur(14px) opacity(22%) saturate(180%);
}

@keyframes aurora-smooth-bg {
  from {
    background-position: 50% 50%, 50% 50%;
  }
  to {
    background-position: 350% 50%, 350% 50%;
  }
}

.animate-aurora-bg {
  animation: aurora-smooth-bg 60s linear infinite;
}

.tam-rays-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none !important;
  overflow: hidden;
  z-index: 0;
  user-select: none;
  contain: strict;
  isolation: isolate;
  transform: translateZ(0);
}

.tam-rays-viewport {
  position: absolute;
  inset: -10% -10% -10% -10%;
  width: 120%;
  height: 120%;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.tam-rays-base {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      100deg,
      var(--stripe-color) 0%,
      var(--stripe-color) 7%,
      transparent 10%,
      transparent 12%,
      var(--stripe-color) 16%
    ),
    repeating-linear-gradient(
      100deg,
      var(--tam-ray-c1) 10%,
      var(--tam-ray-c2) 15%,
      var(--tam-ray-c3) 20%,
      var(--tam-ray-c4) 25%,
      var(--tam-ray-c1) 30%
    );
  background-size: 300% 200%, 300% 200%;
  background-position: 50% 50%, 50% 50%;
  filter: var(--tam-rays-filter);
  mask-image: radial-gradient(ellipse at 50% 15%, black 35%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 15%, black 35%, transparent 75%);
  transform: translateZ(0);
}

.tam-rays-overlay {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      100deg,
      var(--stripe-color) 0%,
      var(--stripe-color) 7%,
      transparent 10%,
      transparent 12%,
      var(--stripe-color) 16%
    ),
    repeating-linear-gradient(
      100deg,
      var(--tam-ray-c1) 10%,
      var(--tam-ray-c2) 15%,
      var(--tam-ray-c3) 20%,
      var(--tam-ray-c4) 25%,
      var(--tam-ray-c1) 30%
    );
  background-size: 200% 100%, 200% 100%;
  /* Removed CPU-bound background-attachment: fixed */
  mix-blend-mode: difference;
  transform: translateZ(0);
}

@media (max-width: 767px) {
  .animate-aurora-bg {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-aurora-bg {
    animation: none !important;
  }
}

/* ==================================================================
 * TAM ENGINE — Animated account icon (top-left header, authenticated)
 * Premium circular profile button: glass base + metallic user glyph +
 * subtle animated ring. Driven by real Django auth state in header.html;
 * entrance / idle / hover motion is GSAP (tam.js — initAccountIcon()).
 * All colors come from existing TAM ENGINE tokens — no new palette.
 * ================================================================== */
.tam-account-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border));
  background-color: color-mix(in oklab, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--metal);
  box-shadow: 0 0 0 0 transparent;
  transition: border-color 240ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 240ms cubic-bezier(0.4, 0, 0.2, 1),
              background-color 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tam-account-btn:hover,
.tam-account-btn:focus-visible {
  border-color: color-mix(in oklab, var(--primary) 70%, transparent);
  box-shadow: 0 0 16px -4px color-mix(in oklab, var(--primary) 55%, transparent);
}
html:not(.dark) .tam-account-btn {
  border-color: color-mix(in oklab, var(--border) 85%, transparent);
  background-color: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--foreground);
}
html:not(.dark) .tam-account-btn:hover,
html:not(.dark) .tam-account-btn:focus-visible {
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  box-shadow: 0 0 10px -5px color-mix(in oklab, var(--primary) 40%, transparent);
}

/* Soft animated ring around the button (GSAP animates scale/opacity) */
.tam-account-ring {
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--primary) 50%, transparent);
  opacity: 0.45;
  pointer-events: none;
}
html:not(.dark) .tam-account-ring {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  opacity: 0.35;
}

.tam-account-avatar {
  display: grid;
  place-items: center;
  line-height: 0;
}

/* Hover tooltip — laid out so it can never shift navbar siblings */
.tam-account-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, -4px);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
  transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 180ms;
}
.tam-account-btn:hover .tam-account-tip,
.tam-account-btn:focus-visible .tam-account-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
/* Never show the tooltip while the dropdown panel is open */
.tam-account-btn[aria-expanded="true"] .tam-account-tip {
  opacity: 0;
  visibility: hidden;
}
@media (max-width: 640px) {
  .tam-account-btn {
    width: 40px;
    height: 40px;
  }
}

/* Reduced motion: static icon, no entrance/idle/hover tweening */
@media (prefers-reduced-motion: reduce) {
  .tam-account-btn,
  .tam-account-ring,
  .tam-account-tip {
    transition: none !important;
    animation: none !important;
  }
  .tam-account-btn:hover,
  .tam-account-btn:focus-visible {
    box-shadow: none;
  }
}

/* ==================================================================
 * CARD SPOTLIGHT - vanilla port of the Aceternity UI component
 * https://ui.aceternity.com/components/card-spotlight
 *
 * Markup:
 *   <div class="tam-spotlight" data-spotlight>
 *     <div class="tam-spotlight__glow" aria-hidden="true">
 *       <canvas class="tam-spotlight__dots"></canvas>
 *       <div class="tam-spotlight__fade"></div>
 *     </div>
 *     <div class="tam-spotlight__content"> ...children... </div>
 *   </div>
 *
 * Component props -> CSS custom properties:
 *   radius (350)  -> --spotlight-radius
 *   color (#262626) -> --spotlight-color (mapped to the light/dark theme)
 *   children      -> .tam-spotlight__content
 * The radial mask coordinates (--spotlight-x / --spotlight-y) and the
 * CanvasRevealEffect dot matrix are driven by static/tam.js (initSpotlight).
 * ================================================================== */
.tam-spotlight {
  --spotlight-radius: 350px;
  --spotlight-color: rgb(255 255 255 / 0.9);
  --spotlight-fade: var(--surface-2);
  --spotlight-dots: 0.7;
  --spotlight-x: 50%;
  --spotlight-y: 50%;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface-2);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 20px 45px -28px oklch(0 0 0 / 0.55);
}

.dark .tam-spotlight {
  --spotlight-color: rgb(255 255 255 / 0.1);
  --spotlight-dots: 1;
  box-shadow: 0 24px 50px -30px oklch(0 0 0 / 0.85);
}

@media (min-width: 768px) {
  .tam-spotlight {
    padding: 2.5rem;
  }
}

/* radial spotlight layer - masked, follows the pointer */
.tam-spotlight__glow {
  position: absolute;
  inset: -1px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-color: var(--spotlight-color);
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-mask-image: radial-gradient(
    var(--spotlight-radius) circle at var(--spotlight-x) var(--spotlight-y),
    #fff 0%,
    transparent 80%
  );
  mask-image: radial-gradient(
    var(--spotlight-radius) circle at var(--spotlight-x) var(--spotlight-y),
    #fff 0%,
    transparent 80%
  );
}

.tam-spotlight:hover .tam-spotlight__glow,
.tam-spotlight.is-active .tam-spotlight__glow,
.tam-spotlight:focus-within .tam-spotlight__glow {
  opacity: 1;
}

/* CanvasRevealEffect dot matrix (2D canvas port in static/tam.js) */
.tam-spotlight__dots {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  image-rendering: pixelated;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tam-spotlight:hover .tam-spotlight__dots,
.tam-spotlight.is-active .tam-spotlight__dots,
.tam-spotlight:focus-within .tam-spotlight__dots {
  opacity: var(--spotlight-dots);
}

/* pointer-less devices keep a centred spotlight instead of a dead card */
@media (hover: none) {
  .tam-spotlight__glow {
    opacity: 0.6;
  }
  .tam-spotlight__dots {
    opacity: calc(var(--spotlight-dots) * 0.6);
  }
}

/* bottom fade - dots dissolve into the card surface (showGradient) */
.tam-spotlight__fade {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to top, var(--spotlight-fade) 0%, transparent 84%);
}

.tam-spotlight__content {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tam-spotlight__glow,
  .tam-spotlight__dots {
    transition: none !important;
  }
}

/* ==================================================================
 * ACETERNITY UI 3D CARD EFFECT — AUTHENTICATION SHOWCASE
 * Port of https://ui.aceternity.com/components/3d-card-effect
 * Features:
 *   .tam-auth-3d-wrap   -> CardContainer (perspective, isolation, boundary)
 *   .tam-auth-3d-card   -> CardBody (preserve-3d, GPU transform, dynamic tilt)
 *   .tam-auth-3d-item   -> CardItem (translateZ depth layering, stereoscopic parallax)
 *   .tam-auth-3d-glare  -> Dynamic cursor-following light reflection
 * ================================================================== */
.tam-auth-3d-wrap {
  perspective: 1200px;
  transform-style: flat;
  isolation: isolate;
}

.tam-auth-3d-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  border-radius: 0;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Individual CardItem depth layers */
.tam-auth-3d-item {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Subtle interactive dynamic lighting reflection */
.tam-auth-3d-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 400ms ease;
  background: radial-gradient(circle 500px at 50% 50%, rgba(255, 255, 255, 0.08), transparent 70%);
}

.tam-auth-3d-wrap:hover .tam-auth-3d-glare {
  opacity: 1;
}

.dark .tam-auth-3d-glare {
  mix-blend-mode: screen;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .tam-auth-3d-wrap {
    perspective: none !important;
  }
  .tam-auth-3d-card,
  .tam-auth-3d-item {
    transform: none !important;
    transition: none !important;
  }
  .tam-auth-3d-glare {
    display: none !important;
  }
}

/* ==================================================================
   UNIFIED BUTTON INTERACTION SYSTEM — TAM ENGINE
   Based on the "انتخاب روغن مناسب" master button interaction language.
   Provides consistent hover, focus, active, and transition behavior
   across all button variants while preserving visual hierarchy.
   ================================================================== */

/* --- Base Interaction Language ---
   All buttons inherit this core interaction DNA from the master button:
   - 320ms cubic-bezier(0.4, 0, 0.2, 1) transitions
   - Subtle scale on hover (1.02)
   - Primary-tinted shadow on hover
   - Border/background/color transitions
   - Active press feedback (0.98 scale)
   - Focus-visible ring (handled globally + enhanced here)
   - Reduced motion support
   ---------------------------------------------------------------- */
.tam-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm, 0.25rem);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  /* Core transition language from master button */
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tam-btn:hover,
.tam-btn:focus-visible {
  will-change: transform, box-shadow;
}

/* Press feedback */
.tam-btn:active {
  transform: scale(0.98);
}

/* Hover state — unified interaction language */
.tam-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--primary) 65%, transparent);
}

/* Focus visible — enhanced from global */
.tam-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Icon inside button — subtle movement on hover */
.tam-btn svg {
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

/* Reduced motion — disable continuous animations, keep transitions */
@media (prefers-reduced-motion: reduce) {
  .tam-btn {
    transition-duration: 0.01ms !important;
  }
  .tam-btn:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .tam-btn:active {
    transform: none !important;
  }
}

/* --- PRIMARY CTA ---
   Strongest version: filled primary background, white text,
   shadow, moving border (optional via .tam-btn-moving-border)
   ---------------------------------------------------------------- */
.tam-btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid transparent;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--primary) 50%, transparent);
}

.tam-btn-primary:hover {
  background-color: color-mix(in srgb, var(--primary) 90%, transparent);
  box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}

/* --- SECONDARY / OUTLINE CTA ---
   Medium strength: outlined, surface background, foreground text
   ---------------------------------------------------------------- */
.tam-btn-secondary {
  background-color: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.tam-btn-secondary:hover {
  background-color: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--primary) 45%, transparent);
}

/* --- GHOST / TEXT BUTTON ---
   Subtle: no background, no border, color transition only
   ---------------------------------------------------------------- */
.tam-btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid transparent;
  padding-inline: 0.75rem;
}

.tam-btn-ghost:hover {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  box-shadow: none;
}

/* --- ICON BUTTON ---
   Compact: square/circular, minimal padding, icon-centered
   ---------------------------------------------------------------- */
.tam-btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius, 0.5rem);
  background-color: transparent;
  color: var(--muted-foreground);
  border: 1px solid transparent;
}

.tam-btn-icon:hover {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  box-shadow: none;
  transform: scale(1.05);
}

.tam-btn-icon:active {
  transform: scale(0.95);
}

/* --- DANGER BUTTON ---
   Semantic destructive action, preserves danger styling
   ---------------------------------------------------------------- */
.tam-btn-danger {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border: 1px solid transparent;
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--destructive) 50%, transparent);
}

.tam-btn-danger:hover {
  background-color: color-mix(in srgb, var(--destructive) 90%, transparent);
  box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--destructive) 70%, transparent);
}

/* --- MOVING BORDER VARIANT ---
   Adds the Aceternity Moving Border orbit effect.
   Apply .tam-btn-moving-border to any .tam-btn variant.
   For primary-filled buttons, also add .tam-btn-moving-border-filled.
   ---------------------------------------------------------------- */
.tam-btn-moving-border {
  /* The SVG overlay is injected via include or template */
}

.tam-btn-moving-border .tam-mb-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.tam-btn-moving-border .tam-mb-rect {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--primary) 55%, transparent));
  transition:
    opacity 320ms cubic-bezier(0.4, 0, 0.2, 1),
    stroke-width 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Primary-filled variant uses foreground tint */
.tam-btn-moving-border-filled .tam-mb-rect,
.tam-btn-primary.tam-btn-moving-border .tam-mb-rect {
  stroke: color-mix(in srgb, var(--primary-foreground) 88%, transparent);
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--primary-foreground) 45%, transparent));
}

/* Live orbit — enabled once JS measures perimeter */
.tam-btn-moving-border--live .tam-mb-rect {
  stroke-dasharray: var(--mb-s) calc(var(--mb-p) - var(--mb-s));
  animation: tam-mb-orbit var(--mb-dur, 3.6s) linear infinite;
  opacity: 0.9;
}

@keyframes tam-mb-orbit {
  to {
    stroke-dashoffset: calc(var(--mb-p) * -1);
  }
}

/* Hover intensity for moving border */
.tam-btn-moving-border:hover .tam-mb-rect {
  opacity: 1;
  stroke-width: 2;
}

/* Reduced motion for moving border */
@media (prefers-reduced-motion: reduce) {
  .tam-btn-moving-border--live .tam-mb-rect {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.55;
  }
  .tam-btn-moving-border:hover .tam-mb-rect {
    stroke-width: 1.5;
  }
}

/* --- RESPONSIVE SIZING ---
   Buttons adapt at sm breakpoint (640px)
   ---------------------------------------------------------------- */
@media (min-width: 640px) {
  .tam-btn {
    padding-inline: 1.5rem;
  }
  .tam-btn-sm {
    padding-inline: 1rem;
    font-size: 0.875rem;
  }
  .tam-btn-icon {
    padding: 0.625rem;
  }
}

/* ==================================================================
   MOVING BORDER CTA — Django/HTML port of Aceternity "Moving Border"
   (https://ui.aceternity.com/components/moving-border)

   A single restrained highlight orbits the button perimeter (SVG
   stroke-dash orbit, seamless because the dash period equals the full
   measured perimeter). Host element carries `.tam-mb`; buttons whose
   background is already `bg-primary` also get `.tam-mb-filled` so the
   highlight switches from primary-red to a primary-foreground tint.

   Perimeter geometry is measured by initMovingBorder() in tam.js which
   then adds `.tam-mb--live`. Before that — or with JS disabled, or
   under prefers-reduced-motion — the button shows a static hairline
   ring, so the accent never depends on JavaScript being available.
   ================================================================== */
.tam-mb {
  position: relative;
  overflow: hidden; /* clips the orbit glow to the button, Aceternity-style */
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    color 320ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tam-mb-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* stroke straddles the border box edge on purpose */
  pointer-events: none; /* clicks/keyboard stay on the real link */
}

.tam-mb-rect {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--primary) 55%, transparent));
  transition:
    opacity 320ms cubic-bezier(0.4, 0, 0.2, 1),
    stroke-width 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* On primary-filled buttons the theme red would vanish against the red
   background — switch to a tinted primary-foreground highlight instead. */
.tam-mb-filled .tam-mb-rect {
  stroke: color-mix(in srgb, var(--primary-foreground) 88%, transparent);
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--primary-foreground) 45%, transparent));
}

/* Live orbit, enabled once JS has measured the perimeter. dasharray period
   == perimeter, so the 0 -> -perimeter loop restart is pixel-identical:
   no visible jump at any button size. */
.tam-mb--live .tam-mb-rect {
  stroke-dasharray: var(--mb-s) calc(var(--mb-p) - var(--mb-s));
  animation: tam-mb-orbit var(--mb-dur, 3.6s) linear infinite;
  opacity: 0.9;
}

@keyframes tam-mb-orbit {
  to {
    stroke-dashoffset: calc(var(--mb-p) * -1);
  }
}

/* Hover: intensity only — the orbit itself never changes speed (a duration
   change mid-flight would make the highlight jump). Keep it subtle. */
.tam-mb:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--primary) 65%, transparent);
}
.tam-mb:hover .tam-mb-rect {
  opacity: 1;
  stroke-width: 2;
}

/* Keyboard focus keeps the global :focus-visible outline (red ring,
   2px offset) — it paints outside the border box, so overflow:hidden
   on the host does not clip it. */

@media (prefers-reduced-motion: reduce) {
  .tam-mb--live .tam-mb-rect {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.55;
  }
  .tam-mb:hover {
    transform: none;
  }
}



/* ==================================================================
 * AUTH PANEL — PREMIUM CURVED IMAGE COMPOSITIONS
 * Applied via .auth-panel--login / .auth-panel--register on the
 * .tam-auth-3d-wrap element. Both pages share the same base 3D card
 * architecture; only the visual silhouette differs.
 *
 * Strategy:
 *   1. clip-path on the wrap itself defines the outer silhouette.
 *   2. border-radius on .tam-auth-3d-card mirrors the rounded corners
 *      so the scrim/grid-lines layers respect the same curvature.
 *   3. Values are expressed in percentage coordinates so the shape
 *      scales with any element size without needing JS.
 *
 * LOGIN  — Asymmetric panel: right side has a dramatic inward concave
 *          sweep from top-right toward mid-right, creating a carved
 *          editorial silhouette. Bottom corners are gently rounded.
 *
 * REGISTER — Mirrored editorial intention: a smoother convex arc on
 *            the right edge with a larger top-right radius, producing
 *            a "rising" silhouette that feels distinct yet related.
 * ================================================================== */

/* ---- LOGIN PANEL ------------------------------------------------- */
/*
 * Shape intent:
 *   Top-left  : sharp (0)
 *   Top-right : large outward arc merging into a concave inward bite
 *   Right     : concave inward sweep pulling back ~8% from edge at mid
 *   Bottom-right : soft rounded (3% / ~24px equivalent at typical size)
 *   Bottom-left  : crisp
 *
 * clip-path polygon approximation (12 points):
 *   TL → TR with rounded arc (simulated via 2-point step) →
 *   concave right-side bite → BR soft → BL
 */
.auth-panel--login {
  clip-path: polygon(
    0% 0%,
    94% 0%,
    100% 4%,
    100% 42%,
    97%  50%,
    100% 58%,
    100% 96%,
    96%  100%,
    3%   100%,
    0%   100%
  );
}

/* Mirror the corner geometry on the card body so layers inside also
   respect the boundary (the clip-path on the wrap handles masking,
   but border-radius on the card ensures box-shadow / scrim feathering
   aligns correctly). */
.auth-panel--login .tam-auth-3d-card {
  border-top-right-radius: 2.8rem;
  border-bottom-right-radius: 1.2rem;
  border-bottom-left-radius: 0.4rem;
  border-top-left-radius: 0;
}

/* ---- REGISTER PANEL ---------------------------------------------- */
/*
 * Shape intent:
 *   Top-left     : very gentle curve (editorial, not sharp)
 *   Top-right    : large smooth arc — the panel "rises" at the leading
 *                  edge (right in RTL layout context)
 *   Right        : smoothly convex outward bulge at mid-height, then
 *                  tapering back — opposite of login's concave bite
 *   Bottom-right : soft rounded
 *   Bottom-left  : slightly angled inward
 *
 * clip-path polygon approximation (10 points):
 *   deliberate variation — convex right vs login's concave right
 */
.auth-panel--register {
  clip-path: polygon(
    0%   2%,
    2%   0%,
    92%  0%,
    100% 6%,
    100% 95%,
    97%  100%,
    4%   100%,
    0%   98%
  );
}

.auth-panel--register .tam-auth-3d-card {
  border-top-right-radius: 3.5rem;
  border-bottom-right-radius: 1rem;
  border-bottom-left-radius: 0.5rem;
  border-top-left-radius: 0.25rem;
}

/* ---- TABLET (lg breakpoint breakdown, ~900–1100px) --------------- */
/*
 * At tablet widths the panel is narrower — reduce the concave depth
 * so the image subject is not uncomfortably cropped on the right.
 */
@media (min-width: 1024px) and (max-width: 1280px) {
  .auth-panel--login {
    clip-path: polygon(
      0%  0%,
      95% 0%,
      100% 3%,
      100% 44%,
      98%  50%,
      100% 56%,
      100% 97%,
      97%  100%,
      2%   100%,
      0%   100%
    );
  }

  .auth-panel--register {
    clip-path: polygon(
      0%   1%,
      1%   0%,
      94%  0%,
      100% 5%,
      100% 96%,
      98%  100%,
      3%   100%,
      0%   99%
    );
  }
}

/* ---- REDUCED MOTION --------------------------------------------- */
/*
 * clip-path is a visual-only shape and carries no animation, so
 * nothing extra is needed here. The 3D card transitions already have
 * their own reduced-motion block above.
 */

/* ==================================================================
 * UIVERSE COMPONENT: dangerous-monkey-48 (by augustin_4687)
 * Adapted for TAM ENGINE — Red & Automotive Oil Amber Fusion
 * Source: https://uiverse.io/augustin_4687/dangerous-monkey-48
 * Features:
 *   - Rotating multi-point star background polygon with TAM red aura
 *   - Isometric multi-layer 3D box-shadow bevel (TAM Red -> Amber)
 *   - Halftone animated dot-matrix texture with cockpit glow
 *   - Tactile button press & hover depth transition
 * ================================================================== */
.uiverse-monkey-btn {
  --stone-50: #fafaf9;
  --stone-800: #181a1e;
  --dm-red: var(--primary, #e11d48);
  --dm-amber: #f59e0b;
  --dm-accent: color-mix(in srgb, var(--dm-red) 75%, var(--dm-amber) 25%);
  --dm-accent-glow: color-mix(in srgb, var(--dm-red) 50%, #facc15 50%);

  font-family: inherit;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  font-size: 0.9375rem;
  border-radius: 1rem;
  outline: 2px solid transparent;
  outline-offset: 6px;
  color: #ffffff;
  text-decoration: none;
  isolation: isolate;
  user-select: none;
  vertical-align: middle;
  transition: outline-color 150ms ease;
}

.uiverse-monkey-btn:active {
  outline-color: var(--dm-red);
}

.uiverse-monkey-btn:focus-visible {
  outline-color: var(--dm-red);
  outline-style: dashed;
}

/* Layer 0: Rotating multi-point star background polygon with fiery TAM red bloom */
.uiverse-monkey-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 0;
  height: 200%;
  max-height: 104px;
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--dm-red) 20%, var(--dm-accent) 55%, var(--dm-amber) 85%, #fff 100%);
  clip-path: polygon(
    100% 50%,
    91.48% 56.57%,
    97.55% 65.45%,
    87.42% 69.07%,
    90.45% 79.39%,
    79.7% 79.7%,
    79.39% 90.45%,
    69.07% 87.42%,
    65.45% 97.55%,
    56.57% 91.48%,
    50% 100%,
    43.43% 91.48%,
    34.55% 97.55%,
    30.93% 87.42%,
    20.61% 90.45%,
    20.3% 79.7%,
    9.55% 79.39%,
    12.58% 69.07%,
    2.45% 65.45%,
    8.52% 56.57%,
    0% 50%,
    8.52% 43.43%,
    2.45% 34.55%,
    12.58% 30.93%,
    9.55% 20.61%,
    20.3% 20.3%,
    20.61% 9.55%,
    30.93% 12.58%,
    34.55% 2.45%,
    43.43% 8.52%,
    50% 0%,
    56.57% 8.52%,
    65.45% 2.45%,
    69.07% 12.58%,
    79.39% 9.55%,
    79.7% 20.3%,
    90.45% 20.61%,
    87.42% 30.93%,
    97.55% 34.55%,
    91.48% 43.43%
  );
  animation: uiverse-star-rotate 4s linear infinite;
  opacity: 0.16;
  pointer-events: none;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--dm-red) 65%, transparent));
  transition: opacity 200ms ease, filter 200ms ease;
}

.uiverse-monkey-btn:hover::before {
  opacity: 0.95;
  filter: drop-shadow(0 0 20px color-mix(in srgb, var(--dm-red) 85%, transparent));
}

/* Layer 1: Outer 3D beveled block with stacked TAM Red -> Amber drop shadows */
.uiverse-monkey-btn > div {
  position: relative;
  z-index: 1;
  padding: 2px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--dm-red) 0%, var(--dm-accent) 55%, var(--dm-amber) 100%);
  transform: translate(-4px, -4px);
  transition: all 150ms ease;
  box-shadow:
    0.5px 0.5px 0 0 var(--dm-red),
    1px 1px 0 0 var(--dm-red),
    1.5px 1.5px 0 0 var(--dm-accent),
    2px 2px 0 0 var(--dm-accent),
    2.5px 2.5px 0 0 var(--dm-accent-glow),
    3px 3px 0 0 var(--dm-amber),
    0 0 0 2px var(--stone-800),
    0.5px 0.5px 0 2px var(--stone-800),
    1px 1px 0 2px var(--stone-800),
    1.5px 1.5px 0 2px var(--stone-800),
    2px 2px 0 2px var(--stone-800),
    2.5px 2.5px 0 2px var(--stone-800),
    3px 3px 0 2px var(--stone-800),
    3.5px 3.5px 0 2px var(--stone-800),
    4px 4px 0 2px var(--stone-800),
    0 0 0 4px var(--stone-50),
    0.5px 0.5px 0 4px var(--stone-50),
    1px 1px 0 4px var(--stone-50),
    1.5px 1.5px 0 4px var(--stone-50),
    2px 2px 0 4px var(--stone-50),
    2.5px 2.5px 0 4px var(--stone-50),
    3px 3px 0 4px var(--stone-50),
    3.5px 3.5px 0 4px var(--stone-50),
    4px 4px 0 4px var(--stone-50);
}

.uiverse-monkey-btn:hover > div {
  transform: translate(0, 0);
  box-shadow:
    0 0 0 0 var(--dm-red),
    0 0 0 0 var(--dm-red),
    0 0 0 0 var(--dm-accent),
    0 0 0 0 var(--dm-accent),
    0 0 0 0 var(--dm-accent-glow),
    0 0 0 0 var(--dm-amber),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 2px var(--stone-800),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50),
    0 0 0 4px var(--stone-50);
}

.uiverse-monkey-btn:active > div {
  transform: translate(0, 0);
}

/* Layer 2: Inner surface with halftone animated dot-matrix */
.uiverse-monkey-btn > div > div {
  position: relative;
  pointer-events: none;
  border-radius: calc(1rem - 2px);
  background-color: var(--stone-800);
  overflow: hidden;
}

.uiverse-monkey-btn > div > div::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  opacity: 0.12;
  background-image:
    radial-gradient(color-mix(in srgb, var(--dm-red) 50%, white 50%) 20%, transparent 20%),
    radial-gradient(rgb(255 255 255 / 90%) 20%, transparent 20%);
  background-position: 0 0, 4px 4px;
  background-size: 8px 8px;
  mix-blend-mode: hard-light;
  box-shadow: inset 0 0 0 1px var(--stone-800);
  animation: uiverse-dots 0.4s infinite linear;
  transition: opacity 150ms ease;
}

.uiverse-monkey-btn:hover > div > div::before {
  opacity: 0.28;
}

/* Layer 3: Inner interactive content (icon + label) */
.uiverse-monkey-btn > div > div > div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  gap: 0.5rem;
  color: #ffffff !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  white-space: nowrap;
}

.uiverse-monkey-btn span {
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.uiverse-monkey-btn svg {
  color: #ff5252 !important;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
  transition: transform 150ms ease, color 150ms ease, filter 150ms ease;
  flex-shrink: 0;
}

.uiverse-monkey-btn:hover svg {
  color: #fbbf24 !important;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
  transform: scale(1.12);
}

.uiverse-monkey-btn:hover > div > div > div {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.9));
}

.uiverse-monkey-btn:active > div > div > div {
  transform: translateY(2px);
}

/* Theme adaptation — box-shadow outer border against page background */
html:not(.dark) .uiverse-monkey-btn,
html[data-theme="light"] .uiverse-monkey-btn {
  --stone-50: #18181b; /* dark outer rim against light page */
  --stone-800: #1c1f24;
  --dm-red: var(--primary, #dc2626);
  --dm-amber: #d97706;
}

html.dark .uiverse-monkey-btn,
html[data-theme="dark"] .uiverse-monkey-btn {
  --stone-50: #fafaf9; /* bright outer rim against dark page */
  --stone-800: #14161a;
  --dm-red: var(--primary, #e11d48);
  --dm-amber: #f59e0b;
}

@keyframes uiverse-star-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes uiverse-dots {
  0% {
    background-position: 0 0, 4px 4px;
  }
  100% {
    background-position: 8px 0, 12px 4px;
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .uiverse-monkey-btn::before {
    animation: none !important;
  }
  .uiverse-monkey-btn > div > div::before {
    animation: none !important;
  }
  .uiverse-monkey-btn > div {
    transition: none !important;
  }
}

/* ==================================================================
 * HOLOGRAPHIC GLOWING CARD (by Lucas Bonomi @LukyVj)
 * Adapted for TAM ENGINE Auth Panel Image Asset (pistons.jpg)
 * Features:
 *   - CSS Houdini @property smooth custom property transitions
 *   - Orbiting chromatic glow aura (.glow)
 *   - Animated radial-gradient burning border (::before)
 *   - Pulsing white shadow on hover
 * ================================================================== */
@property --hue {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --rotate {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --bg-y {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --bg-x {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --glow-translate-y {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --bg-size {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --glow-opacity {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --glow-blur {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@property --glow-scale {
  syntax: "<number>";
  inherits: true;
  initial-value: 2;
}
@property --glow-radius {
  syntax: "<number>";
  inherits: true;
  initial-value: 2;
}
@property --white-shadow {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

:root {
  --supported: 0;
  --not-supported: 0;
}

.tam-holo-card {
  --card-color: hsl(260deg 100% 3%);
  --text-color: hsl(260deg 10% 55%);
  --card-radius: inherit;
  --card-width: 100%;
  --border-width: 3px;
  --bg-size: 1;

  --hue: 0;
  --hue-speed: 1;

  --rotate: 0;
  --animation-speed: 4s;

  --interaction-speed: 0.55s;
  --glow-scale: 1.5;
  --scale-factor: 1;
  --glow-blur: 6;
  --glow-opacity: 1;
  --glow-radius: 100;
  --glow-rotate-unit: 1deg;

  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: white;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border-radius: inherit;
  cursor: pointer;
  overflow: hidden;
}

.tam-holo-card:before,
.tam-holo-card:after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.tam-holo-card .tam-holo-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--card-color);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow var(--interaction-speed) ease;
}

.tam-holo-card .tam-holo-inner:before {
  content: "";
  display: block;
  position: absolute;
  inset: calc(var(--border-width) * -0.5);
  width: calc(100% + var(--border-width));
  height: calc(100% + var(--border-width));
  border-radius: inherit;
  box-shadow: 0 0 20px black;
  mix-blend-mode: color-burn;
  z-index: 2;
  pointer-events: none;
  background: hsl(0deg 0% 16%)
    radial-gradient(
      30% 30% at calc(var(--bg-x) * 1%) calc(var(--bg-y) * 1%),
      hsl(calc(calc(var(--hue) * var(--hue-speed)) * 1deg) 100% 90%)
        calc(0% * var(--bg-size)),
      hsl(calc(calc(var(--hue) * var(--hue-speed)) * 1deg) 100% 80%)
        calc(20% * var(--bg-size)),
      hsl(calc(calc(var(--hue) * var(--hue-speed)) * 1deg) 100% 60%)
        calc(40% * var(--bg-size)),
      transparent 100%
    );
  animation: hue-animation var(--animation-speed) linear infinite,
    rotate-bg var(--animation-speed) linear infinite;
  transition: --bg-size var(--interaction-speed) ease;
}

.tam-holo-card .glow {
  --glow-translate-y: 0;
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 50%;
  height: 50%;
  animation: rotate var(--animation-speed) linear infinite;
  transform: rotateZ(calc(var(--rotate) * var(--glow-rotate-unit)));
  transform-origin: center;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.tam-holo-card .glow:after {
  content: "";
  display: block;
  z-index: -2;
  filter: blur(calc(var(--glow-blur) * 10px));
  width: 140%;
  height: 140%;
  left: -20%;
  top: -20%;
  background: hsl(
    calc(calc(var(--hue) * var(--hue-speed)) * 1deg) 100% 60%
  );
  position: relative;
  border-radius: 50%;
  animation: hue-animation var(--animation-speed) linear infinite;
  transform: scaleY(calc(var(--glow-scale) * var(--scale-factor) / 1.1))
    scaleX(calc(var(--glow-scale) * var(--scale-factor) * 1.2))
    translateY(calc(var(--glow-translate-y) * 1%));
  opacity: var(--glow-opacity);
}

/* Hover state interactions */
.tam-auth-3d-wrap:hover .tam-holo-card .tam-holo-inner,
.tam-holo-card:hover .tam-holo-inner {
  mix-blend-mode: darken;
  --text-color: white;
  box-shadow: 0 0 calc(var(--white-shadow) * 1vw)
    calc(var(--white-shadow) * 0.15vw) rgb(255 255 255 / 20%);
  animation: shadow-pulse calc(var(--animation-speed) * 2) linear infinite;
}

.tam-auth-3d-wrap:hover .tam-holo-card .tam-holo-inner:before,
.tam-holo-card:hover .tam-holo-inner:before {
  --bg-size: 15;
  animation-play-state: paused;
  transition: --bg-size var(--interaction-speed) ease;
}

.tam-auth-3d-wrap:hover .tam-holo-card .glow,
.tam-holo-card:hover .glow {
  --glow-blur: 1.5;
  --glow-opacity: 0.6;
  --glow-scale: 2.5;
  --glow-radius: 0;
  --rotate: 900;
  --glow-rotate-unit: 0;
  --scale-factor: 1.25;
  animation-play-state: paused;
}

.tam-auth-3d-wrap:hover .tam-holo-card .glow:after,
.tam-holo-card:hover .glow:after {
  --glow-translate-y: 0;
  animation-play-state: paused;
  transition: --glow-translate-y 0s ease, --glow-blur 0.05s ease,
    --glow-opacity 0.05s ease, --glow-scale 0.05s ease,
    --glow-radius 0.05s ease;
}

@keyframes shadow-pulse {
  0%,
  24%,
  46%,
  73%,
  96% {
    --white-shadow: 0.5;
  }
  12%,
  28%,
  41%,
  63%,
  75%,
  82%,
  98% {
    --white-shadow: 2.5;
  }
  6%,
  32%,
  57% {
    --white-shadow: 1.3;
  }
  18%,
  52%,
  88% {
    --white-shadow: 3.5;
  }
}

@keyframes rotate-bg {
  0% {
    --bg-x: 0;
    --bg-y: 0;
  }
  25% {
    --bg-x: 100;
    --bg-y: 0;
  }
  50% {
    --bg-x: 100;
    --bg-y: 100;
  }
  75% {
    --bg-x: 0;
    --bg-y: 100;
  }
  100% {
    --bg-x: 0;
    --bg-y: 0;
  }
}

@keyframes rotate {
  from {
    --rotate: -70;
    --glow-translate-y: -65;
  }
  25% {
    --glow-translate-y: -65;
  }
  50% {
    --glow-translate-y: -65;
  }
  60%,
  75% {
    --glow-translate-y: -65;
  }
  85% {
    --glow-translate-y: -65;
  }
  to {
    --rotate: calc(360 - 70);
    --glow-translate-y: -65;
  }
}

@keyframes hue-animation {
  0% {
    --hue: 0;
  }
  100% {
    --hue: 360;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tam-holo-card .glow,
  .tam-holo-card .glow:after,
  .tam-holo-card .tam-holo-inner:before {
    animation: none !important;
  }
}

/* ==================================================================
 * UIVERSE COMPONENT: sekaiking Neo-Brutalist Pill Button
 * Source: https://uiverse.io by sekaiking
 * Features:
 *   - Pill shape (border-radius: 10em)
 *   - Hard offset box-shadow on hover
 *   - Tactile translateY/translateX press
 * ================================================================== */
.tam-neobrutal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: white;
  color: black;
  border-radius: 10em;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  min-height: 3rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border: 1.5px solid black;
  box-shadow: 0 0 0 0 black;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

.tam-neobrutal-btn:hover {
  transform: translateY(-4px) translateX(-2px);
  box-shadow: 3px 6px 0 0 black;
}

.tam-neobrutal-btn:active {
  transform: translateY(2px) translateX(1px);
  box-shadow: 0 0 0 0 black;
}

.tam-neobrutal-btn svg {
  color: black;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.tam-neobrutal-btn:hover svg {
  transform: scale(1.15);
}

/* Dark mode adaptation: hard shadow with primary contrast */
html.dark .tam-neobrutal-btn {
  background-color: white;
  color: black;
  border-color: black;
  box-shadow: 0 0 0 0 black;
}

html.dark .tam-neobrutal-btn:hover {
  box-shadow: 3px 6px 0 0 var(--primary, #e11d48);
}

html.dark .tam-neobrutal-btn:active {
  box-shadow: 0 0 0 0 black;
}

@media (prefers-reduced-motion: reduce) {
  .tam-neobrutal-btn,
  .tam-neobrutal-btn:hover,
  .tam-neobrutal-btn:active {
    transform: none !important;
    transition: none !important;
  }
}

/* ==================================================================
   Password Strength Meter
   Scoped indicator styles for registration and password reset forms.
   Weak:   #DC3545 (Red)
   Medium: #FD7E14 (Orange)
   Strong: #198754 (Green)
   ================================================================== */
[data-password-strength] {
  --strength-weak: #DC3545;
  --strength-medium: #FD7E14;
  --strength-strong: #198754;
}

/* --- Progress Bar Fill (Active Segments) --- */
[data-password-strength] [data-strength-segment].is-weak,
[data-password-strength] [data-strength-segment].tam-strength-weak,
[data-password-strength] [data-strength-segment][data-state="weak"],
[data-password-strength][data-strength="weak"] [data-strength-segment].is-active {
  background-color: var(--strength-weak);
}

[data-password-strength] [data-strength-segment].is-medium,
[data-password-strength] [data-strength-segment].tam-strength-medium,
[data-password-strength] [data-strength-segment][data-state="medium"],
[data-password-strength][data-strength="medium"] [data-strength-segment].is-active {
  background-color: var(--strength-medium);
}

[data-password-strength] [data-strength-segment].is-strong,
[data-password-strength] [data-strength-segment].tam-strength-strong,
[data-password-strength] [data-strength-segment][data-state="strong"],
[data-password-strength][data-strength="strong"] [data-strength-segment].is-active {
  background-color: var(--strength-strong);
}

/* --- Text Label Colors --- */
[data-password-strength] [data-strength-label].is-weak,
[data-password-strength] [data-strength-label].tam-strength-weak,
[data-password-strength] [data-strength-label][data-state="weak"],
[data-password-strength][data-strength="weak"] [data-strength-label] {
  color: var(--strength-weak);
}

[data-password-strength] [data-strength-label].is-medium,
[data-password-strength] [data-strength-label].tam-strength-medium,
[data-password-strength] [data-strength-label][data-state="medium"],
[data-password-strength][data-strength="medium"] [data-strength-label] {
  color: var(--strength-medium);
}

[data-password-strength] [data-strength-label].is-strong,
[data-password-strength] [data-strength-label].tam-strength-strong,
[data-password-strength] [data-strength-label][data-state="strong"],
[data-password-strength][data-strength="strong"] [data-strength-label] {
  color: var(--strength-strong);
}

/* Inactive Segment Track */
[data-password-strength] [data-strength-segment][data-state="inactive"] {
  background-color: var(--border);
}




/* ==================================================================

 * TAM ENGINE CAROUSEL & SLIDER SYSTEM (HOMEPAGE PRODUCTS & CATEGORIES)

 * ================================================================== */

.tam-carousel-block {

  position: relative;

  width: 100%;

}

.tam-carousel-header {

  border-bottom: 1px solid var(--border);

  margin-bottom: 1rem;

}

.tam-carousel-controls {

  display: flex;

  align-items: center;

  gap: 0.5rem;

}

.tam-carousel-btn {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 2.25rem;

  height: 2.25rem;

  border-radius: var(--radius);

  border: 1px solid var(--border);

  background-color: var(--surface);

  color: var(--foreground);

  transition: all 0.2s ease;

  cursor: pointer;

}

.tam-carousel-btn:hover:not(:disabled) {

  border-color: var(--primary);

  background-color: color-mix(in oklab, var(--primary) 10%, var(--surface));

  color: var(--primary);

}

.tam-carousel-btn:disabled,

.tam-carousel-btn[aria-disabled="true"] {

  opacity: 0.35;

  cursor: not-allowed;

  pointer-events: none;

}

[dir="ltr"] .tam-carousel-prev svg,

[dir="ltr"] .tam-carousel-next svg {

  transform: rotate(180deg);

}

.tam-carousel-track {

  display: flex;

  flex-direction: row;

  flex-wrap: nowrap;

  gap: 1.25rem;

  overflow-x: auto;

  overflow-y: hidden;

  scroll-snap-type: x mandatory;

  -webkit-overflow-scrolling: touch;

  scroll-behavior: smooth;

  overscroll-behavior-x: contain;

  touch-action: pan-x pan-y;

  padding-bottom: 0.75rem;

  padding-top: 0.25rem;

  padding-inline: 2px;

  scrollbar-width: thin;

  scrollbar-color: color-mix(in oklab, var(--primary) 60%, transparent) color-mix(in oklab, var(--border) 40%, transparent);

}

.tam-carousel-track::-webkit-scrollbar {

  height: 4px;

}

.tam-carousel-track::-webkit-scrollbar-track {

  background: color-mix(in oklab, var(--border) 40%, transparent);

  border-radius: 9999px;

}

.tam-carousel-track::-webkit-scrollbar-thumb {

  background: color-mix(in oklab, var(--primary) 60%, transparent);

  border-radius: 9999px;

}

.tam-carousel-item {

  flex: 0 0 calc((100% - 3 * 1.25rem) / 4);

  width: calc((100% - 3 * 1.25rem) / 4);

  min-width: 0;

  max-width: none;

  scroll-snap-align: start;

  scroll-snap-stop: normal;

  box-sizing: border-box;

}

@media (max-width: 1199.98px) {

  .tam-carousel-item {

    flex: 0 0 calc((100% - 2 * 1rem) / 3);

    width: calc((100% - 2 * 1rem) / 3);

  }

  .tam-carousel-track {

    gap: 1rem;

  }

}

@media (max-width: 767.98px) {

  .tam-carousel-item {

    flex: 0 0 calc((100% - 0.75rem) / 2);

    width: calc((100% - 0.75rem) / 2);

  }

  .tam-carousel-track {

    gap: 0.75rem;

  }

}

@media (max-width: 575.98px) {

  .tam-carousel-item {

    flex: 0 0 min(280px, 80%);

    width: min(280px, 80%);

  }

}

.tam-cat-track {

  gap: 1rem;

}

.tam-cat-item {

  flex: 0 0 calc((100% - 5 * 1rem) / 6);

  width: calc((100% - 5 * 1rem) / 6);

  min-width: 0;

  scroll-snap-align: start;

  box-sizing: border-box;

}

@media (max-width: 1199.98px) {

  .tam-cat-item {

    flex: 0 0 calc((100% - 3 * 1rem) / 4);

    width: calc((100% - 3 * 1rem) / 4);

  }

}

@media (max-width: 991.98px) {

  .tam-cat-item {

    flex: 0 0 calc((100% - 2 * 0.75rem) / 3);

    width: calc((100% - 2 * 0.75rem) / 3);

  }

  .tam-cat-track {

    gap: 0.75rem;

  }

}

@media (max-width: 767.98px) {

  .tam-cat-item {

    flex: 0 0 calc((100% - 0.75rem) / 2.2);

    width: calc((100% - 0.75rem) / 2.2);

  }

}

@media (max-width: 479.98px) {

  .tam-cat-item {

    flex: 0 0 min(240px, 72%);

    width: min(240px, 72%);

  }

}

