/*
  Al-Waha Specialist Establishment — B2B Catalog
  Stylesheet structure
  --------------------
  1. Base resets + typography
  2. Layout helpers (hero, view router)
  3. Catalog: filter bar, category chips, category cards, product cards
  4. Quote basket: lines, summary, empty state
  5. Product detail dialog
  6. Toast + sticky CTA
  7. Mobile responsive overrides
*/

/* ------------------------------------------------------------------
   1. Base resets + typography
------------------------------------------------------------------ */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Cairo:wght@400;600;700;800;900&display=swap");

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  font-family: "IBM Plex Sans Arabic", "Cairo", "Tajawal", Tahoma, Arial, sans-serif;
  direction: rtl;
  overflow-wrap: anywhere;
  /* Avoid horizontal scroll bleed from any wide elements at narrow widths */
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
a,
button,
span,
strong,
small,
label,
input,
select,
textarea {
  overflow-wrap: anywhere;
  white-space: normal;
}

h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.18;
}

/* ------------------------------------------------------------------
   2. Layout helpers (hero, view router)
   Let the hero size to its content + section padding instead of forcing
   a viewport-based min-height (which left big empty space below the CTAs).
------------------------------------------------------------------ */
.hero-section,
.hero-shell {
  min-height: 0;
}

.hero-title {
  max-width: 850px;
  /* Tighter B2B-flavored scale: still confident at large, more honest at small. */
  font-size: clamp(2.25rem, 5.4vw, 4.75rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-subtitle {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.nav-button.active {
  background: linear-gradient(135deg, #20a7dd, #2aa7cf);
  color: #fff;
}

label span {
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.875rem;
  font-weight: 800;
  color: #475569;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.85rem 1rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

#categoryChips .chip {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: #334155;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

#categoryChips .chip:hover {
  transform: translateY(-1px);
  border-color: #7dd3fc;
}

#categoryChips .chip.active {
  border-color: transparent;
  background: #0c1b34;
  color: #fff;
}

.category-card {
  display: grid;
  min-height: 132px;
  gap: 0.35rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 1.1rem;
  text-align: start;
  box-shadow: 0 12px 28px rgba(12, 27, 52, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-card:hover,
.category-card.active {
  transform: translateY(-3px);
  border-color: #7dd3fc;
  box-shadow: 0 20px 48px rgba(12, 27, 52, 0.14);
}

.category-card.active {
  background: #0c1b34;
  color: #fff;
}

.category-card .category-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 1rem;
  background: #e0f2fe;
  color: #075985;
  font-size: 1.35rem;
  font-weight: 900;
}

.category-card.active .category-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.category-card strong {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.category-card small {
  color: #64748b;
  font-weight: 800;
}

.category-card.active small {
  color: #bae6fd;
}

.product-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 14px 38px rgba(12, 27, 52, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #bae6fd;
  box-shadow: 0 24px 70px rgba(12, 27, 52, 0.16);
}

.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.15rem;
}

.product-card .body {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem;
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-kicker span {
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 999px;
  background: #e0f2fe;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 900;
  color: #0369a1;
}

.card-kicker strong {
  flex: 0 0 auto;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

.card-kicker strong.price-ready {
  color: #15803d;
}

.card-kicker strong.price-request {
  font-size: 0.86rem;
  color: #64748b;
}

.product-card h3 {
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.45;
}

.product-card p {
  color: #64748b;
  line-height: 1.7;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: #64748b;
  font-size: 0.78rem;
}

.meta span {
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.3rem 0.65rem;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.primary,
.secondary,
.card-actions button {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-weight: 900;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary,
.card-actions button[data-add] {
  background: #22c55e;
  color: #fff;
}

.secondary,
.card-actions button[data-detail] {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
}

.primary:hover,
.secondary:hover,
.card-actions button:hover {
  transform: translateY(-1px);
}

.quote-line,
.rfq-card,
.admin-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1rem;
}

.quote-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  border-radius: 1.25rem;
  background: #0c1b34;
  padding: 1rem;
  color: #fff;
}

.quote-summary div {
  display: grid;
  gap: 0.2rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.85rem;
}

.quote-summary span {
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 800;
}

.quote-summary strong {
  font-size: 1.15rem;
  font-weight: 900;
}

.quote-thumb {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  object-fit: contain;
  padding: 0.35rem;
}

.quote-info {
  display: grid;
  flex: 1;
  gap: 0.55rem;
}

.quote-info textarea {
  min-height: 4.25rem;
  resize: vertical;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity input {
  width: 5rem;
}

#productDetails {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.detail-media {
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.detail-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  object-fit: contain;
  padding: 1rem;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.detail-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  object-fit: contain;
  padding: 0.35rem;
}

.detail-cta {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  padding: 1rem;
  box-shadow: 0 14px 38px rgba(12, 27, 52, 0.1);
  backdrop-filter: blur(12px);
}

.detail-cta span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
}

.detail-cta strong {
  display: block;
  color: #15803d;
  font-size: 1.35rem;
  font-weight: 900;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.spec-table th,
.spec-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0.5rem;
  text-align: start;
  vertical-align: top;
}

.detail-list {
  margin: 0.5rem 0 1rem;
  padding-inline-start: 1.4rem;
  color: #64748b;
  line-height: 1.8;
}

/* ------------------------------------------------------------------
   4b. Empty quote (basket) state
------------------------------------------------------------------ */
.empty-quote {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 2.25rem 1rem 1.5rem;
  text-align: center;
}

.empty-quote-icon {
  width: 64px;
  height: 64px;
  color: #94a3b8;
}

.empty-quote h3 {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

.empty-quote p {
  max-width: 380px;
  color: #64748b;
  line-height: 1.7;
}

.empty-quote-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.empty-quote-actions .primary,
.empty-quote-actions .secondary {
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-weight: 900;
  text-decoration: none;
  display: inline-block;
}

.empty-quote-actions .primary {
  background: #22c55e;
  color: #fff;
}

.empty-quote-actions .secondary {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
}

.empty-quote-actions .primary:hover,
.empty-quote-actions .secondary:hover {
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------
   4c. Quick RFQ form (homepage panel)
   Inputs inherit the global rounded look but get tighter padding here.
------------------------------------------------------------------ */
#quickRfqForm label span,
#quickRfqForm label > span {
  color: #475569;
}

#quickRfqForm input,
#quickRfqForm textarea {
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------
   6. Toast
------------------------------------------------------------------ */
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------------
   7. Mobile responsive overrides
   Audited to preserve RTL and avoid horizontal overflow.
------------------------------------------------------------------ */
@media (max-width: 760px) {
  .hero-section,
  .hero-shell {
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.1rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  /* Product detail dialog stacks media above content on small screens. */
  #productDetails {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  /* Cart lines stack: image on top, quantity controls below info. */
  .quote-line,
  .admin-product {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-thumb {
    align-self: flex-start;
  }

  .quote-summary {
    grid-template-columns: 1fr;
  }

  .detail-cta {
    grid-template-columns: 1fr;
  }

  /* Filter bar: keep inputs single-column at very small widths so the
     RTL alignment doesn't squish the labels. Tailwind handles the 3-col grid
     at md+; this just protects us if Tailwind's CDN ever lags. */
  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  /* Product cards keep their internal padding lighter on small screens. */
  .product-card .body {
    padding: 0.9rem;
    gap: 0.55rem;
  }

  .product-card h3 {
    font-size: 0.98rem;
  }

  .card-actions {
    grid-template-columns: 1fr 1fr;
  }

  /* Tighter category cards on small screens so they don't bloat the page. */
  .category-card {
    min-height: 108px;
    padding: 0.9rem;
  }

  /* Empty-quote action buttons fill width for easy tap. */
  .empty-quote-actions .primary,
  .empty-quote-actions .secondary {
    width: 100%;
  }
}

/* Very small phones — keep readable without horizontal scroll. */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .quote-thumb {
    width: 56px;
    height: 56px;
  }
}

/* ------------------------------------------------------------------
   8. Landing-page visual alignment
   Keeps the existing catalog sections and behavior, while matching the
   Alwaha landing page palette, spacing, and premium Arabic brand tone.
------------------------------------------------------------------ */
:root {
  --waha-navy: #0d1a35;
  --waha-deep: #14284d;
  --waha-blue: #3a9bc8;
  --waha-blue-light: #5bb8e0;
  --waha-gold: #c8a43a;
  --waha-green: #25d366;
  --waha-ink: #1f2937;
  --waha-muted: #6b7280;
  --waha-line: #e5edf5;
  --waha-soft: #f6f8fb;
  --waha-shadow: 0 18px 46px rgba(13, 26, 53, 0.1);
  --waha-shadow-strong: 0 28px 72px rgba(13, 26, 53, 0.16);
  --waha-radius: 1.15rem;
}

body {
  font-family: "Cairo", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  background:
    linear-gradient(180deg, #ffffff 0, var(--waha-soft) 560px),
    var(--waha-soft);
  color: var(--waha-ink);
}

.hero-title {
  letter-spacing: 0;
}

header {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(135deg, rgba(13, 26, 53, 0.98), rgba(20, 40, 77, 0.96)) !important;
  box-shadow: 0 16px 44px rgba(13, 26, 53, 0.18);
}

header img {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.catalog-site-nav {
  background: rgba(13, 26, 53, 0.94) !important;
  backdrop-filter: blur(18px);
}

.catalog-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.catalog-brand-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  background: #fff;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(58, 155, 200, 0.32), 0 10px 24px rgba(0, 0, 0, 0.18) !important;
}

.catalog-brand strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  color: #fff;
}

.catalog-brand small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--waha-blue-light);
}

.catalog-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem;
}

.catalog-nav-links a,
.catalog-nav-links button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0.65rem 0.9rem;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.82rem;
  font-weight: 800;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.catalog-nav-links a:hover,
.catalog-nav-links button:hover,
.catalog-nav-links .active {
  color: #fff;
  background: rgba(58, 155, 200, 0.14);
}

.catalog-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.catalog-whatsapp {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem !important;
  background: linear-gradient(135deg, var(--waha-green), #1aa856);
  padding: 0 1.25rem;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.22);
}

.catalog-quote-mini {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 900;
}

.catalog-quote-mini b {
  min-width: 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0.05rem 0.4rem;
  color: #fff;
  font-size: 0.72rem;
}

.nav-button,
.quote-pill,
.primary,
.secondary,
.card-actions button,
#loadMoreProducts,
a[href^="https://wa.me"] {
  border-radius: var(--waha-radius) !important;
}

.nav-button.active,
.bg-waha-green,
.primary,
.card-actions button[data-add],
.quote-pill {
  background: linear-gradient(135deg, var(--waha-green), #1db954) !important;
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.22);
}

.nav-button:not(.active):hover,
a[href^="https://wa.me"]:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.hero-section {
  background:
    radial-gradient(circle at 12% 18%, rgba(91, 184, 224, 0.3), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(200, 164, 58, 0.16), transparent 28%),
    linear-gradient(135deg, var(--waha-navy), var(--waha-deep) 62%, #10213f) !important;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 96px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(246, 248, 251, 0.96));
}

.hero-shell {
  position: relative;
  z-index: 1;
}

.hero-section .rounded-\[2rem\],
.hero-section .rounded-3xl {
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}

.hero-section .from-sky-400 {
  background: linear-gradient(135deg, var(--waha-blue), var(--waha-blue-light)) !important;
}

.catalog-3d-scene {
  position: absolute;
  inset: 0;
  z-index: -8;
  pointer-events: none;
  opacity: 0.96;
}

.catalog-3d-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.catalog-3d-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 26, 53, 0.88) 0%, rgba(13, 26, 53, 0.58) 46%, rgba(13, 26, 53, 0.22) 100%),
    linear-gradient(180deg, rgba(13, 26, 53, 0.22), rgba(13, 26, 53, 0.68));
}

.value-card,
.rfq-card,
.quote-line,
.admin-product,
section[id="catalog"] > div:first-child,
#branches article,
#faq article {
  border-color: var(--waha-line) !important;
  border-radius: var(--waha-radius) !important;
  box-shadow: var(--waha-shadow) !important;
}

section[id="catalog"] > div:first-child {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(18px);
}

label span {
  color: var(--waha-ink);
}

input,
select,
textarea {
  border-color: var(--waha-line);
  background: #fff;
  color: var(--waha-ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--waha-blue);
  box-shadow: 0 0 0 4px rgba(58, 155, 200, 0.18);
}

#categoryChips .chip {
  border-color: var(--waha-line);
  background: #fff;
  color: var(--waha-ink);
}

#categoryChips .chip:hover {
  border-color: rgba(58, 155, 200, 0.45);
  color: var(--waha-blue);
}

#categoryChips .chip.active {
  background: linear-gradient(135deg, var(--waha-navy), var(--waha-deep));
  color: #fff;
}

.category-card {
  min-height: 140px;
  border-color: var(--waha-line);
  border-radius: var(--waha-radius);
  background: linear-gradient(180deg, #fff, #f9fbfd);
  box-shadow: var(--waha-shadow);
}

.category-card-row {
  align-items: stretch;
}

.category-card:hover,
.category-card.active {
  border-color: rgba(58, 155, 200, 0.45);
  box-shadow: var(--waha-shadow-strong);
}

.category-card.active {
  background: linear-gradient(135deg, var(--waha-navy), var(--waha-deep));
}

.category-card .category-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  background: rgba(58, 155, 200, 0.12);
  color: var(--waha-blue);
}

.category-card .category-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-card.active .category-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

@media (min-width: 1024px) {
  .category-card-row .category-card {
    min-height: 126px;
    padding: 1rem;
  }

  .category-card-row .category-card strong {
    font-size: 0.95rem;
  }
}

.product-card {
  border-color: var(--waha-line);
  border-radius: var(--waha-radius);
  box-shadow: var(--waha-shadow);
}

.product-card:hover {
  border-color: rgba(58, 155, 200, 0.42);
  box-shadow: var(--waha-shadow-strong);
}

.product-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #fff, #f7fafc);
  border-color: var(--waha-line);
}

.card-kicker span,
.meta span {
  border-color: var(--waha-line);
  background: #f6f9fc;
}

.card-kicker span {
  color: var(--waha-blue);
}

.card-kicker strong.price-ready {
  color: #15803d;
}

.card-kicker strong.price-request,
.product-card p,
.meta,
.category-card small {
  color: var(--waha-muted);
}

.secondary,
.card-actions button[data-detail] {
  border-color: var(--waha-line);
  background: #fff;
  color: var(--waha-ink);
}

.secondary:hover,
.card-actions button[data-detail]:hover {
  border-color: rgba(58, 155, 200, 0.5);
  color: var(--waha-blue);
}

#loadMoreProducts,
.quote-summary,
footer {
  background: linear-gradient(135deg, var(--waha-navy), var(--waha-deep)) !important;
}

.text-sky-600,
.text-sky-700,
.text-sky-300,
.hover\:text-sky-300:hover {
  color: var(--waha-blue) !important;
}

.bg-sky-100 {
  background-color: rgba(58, 155, 200, 0.12) !important;
}

.border-sky-200,
.hover\:border-sky-200:hover {
  border-color: rgba(58, 155, 200, 0.32) !important;
}

.sticky-quote {
  border-color: rgba(58, 155, 200, 0.18) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 18px 48px rgba(13, 26, 53, 0.14);
  backdrop-filter: blur(16px);
}

.hero-section {
  background-size: 150% 150%, 140% 140%, 100% 100% !important;
  animation: wahaHeroDrift 16s ease-in-out infinite alternate;
}

.hero-section .absolute {
  animation: wahaPatternDrift 22s linear infinite alternate;
}

.value-card,
.category-card,
.product-card,
#branches article,
.branch-map-panel {
  will-change: transform;
}

.branch-feature,
.branch-map-panel {
  position: relative;
  overflow: hidden;
}

.branch-feature::before,
.branch-map-panel::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(91, 184, 224, 0.2), transparent 70%);
  transform: translate3d(0, 0, 0);
  animation: wahaGlowFloat 9s ease-in-out infinite alternate;
}

.branch-feature > *,
.branch-map-panel > * {
  position: relative;
  z-index: 1;
}

@keyframes wahaHeroDrift {
  from {
    background-position: 0% 0%, 100% 100%, center;
  }

  to {
    background-position: 100% 20%, 20% 80%, center;
  }
}

@keyframes wahaPatternDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(24px, -18px, 0);
  }
}

@keyframes wahaGlowFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(42px, 28px, 0) scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section,
  .hero-section .absolute,
  .branch-feature::before,
  .branch-map-panel::before {
    animation: none;
  }
}

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  header .max-w-7xl {
    gap: 0.75rem;
  }

  .catalog-site-nav {
    position: sticky;
  }

  .catalog-site-nav > div {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
  }

  .catalog-brand {
    width: 100%;
    justify-self: stretch;
    grid-column: auto;
    justify-content: center;
    text-align: start;
  }

  .catalog-brand-logo {
    width: 2.85rem;
    height: 2.85rem;
  }

  .catalog-brand strong {
    font-size: 0.9rem;
  }

  .catalog-brand small {
    font-size: 0.68rem;
  }

  .catalog-nav-links {
    grid-column: auto;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .catalog-nav-links::-webkit-scrollbar {
    display: none;
  }

  .catalog-nav-links a,
  .catalog-nav-links button {
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
  }

  .catalog-nav-actions {
    grid-column: auto;
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.6rem;
  }

  .catalog-whatsapp,
  .catalog-quote-mini {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding-inline: 0.75rem;
  }

  .catalog-quote-mini {
    order: 2;
  }

  .catalog-whatsapp {
    order: 1;
  }

  .hero-shell {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 2.25rem 1rem 4.25rem !important;
    overflow: hidden;
  }

  .hero-shell > * {
    max-width: 100%;
  }

  .catalog-3d-scene {
    opacity: 0.94;
  }

  .catalog-3d-scene::after {
    background:
      radial-gradient(circle at 50% 18%, rgba(13, 26, 53, 0.48), rgba(13, 26, 53, 0.76) 54%, rgba(13, 26, 53, 0.9) 100%),
      linear-gradient(180deg, rgba(13, 26, 53, 0.58) 0%, rgba(13, 26, 53, 0.42) 42%, rgba(13, 26, 53, 0.88) 100%);
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(2.3rem, 12vw, 3.15rem);
    line-height: 1.18;
    overflow-wrap: break-word;
  }

  .hero-subtitle {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.9;
  }

  .hero-section .max-w-3xl > .mt-8.flex {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .hero-section .max-w-3xl > .mt-8.flex > * {
    width: 100%;
  }

  .hero-section ul.mt-8 {
    grid-template-columns: 1fr !important;
  }

  .hero-section .rounded-\[2rem\] {
    margin-top: 1.25rem;
    border-radius: 1.35rem !important;
  }

  section[id="catalog"] > div:first-child,
  .product-card .body,
  .value-card {
    padding: 1rem !important;
  }

  section[id="catalog"] {
    padding-bottom: 2.25rem !important;
  }

  .filter-toolbar,
  section[id="catalog"] .grid {
    gap: 0.85rem;
  }

  .category-card {
    min-height: 118px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .product-thumb {
    aspect-ratio: 1 / 0.82;
  }

  #categoryCards {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.8rem;
  }

  #categoryCards .category-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    min-height: 96px;
  }

  .category-card {
    min-height: 112px;
    padding: 0.85rem;
  }

  .category-card .category-icon {
    width: 2.45rem;
    height: 2.45rem;
  }

  .category-card strong {
    font-size: 0.9rem;
  }

  .category-card small {
    font-size: 0.78rem;
  }

  #productGrid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  section:has(#productGrid) .mb-5 {
    align-items: center;
    margin-bottom: 1rem;
  }

  #resultTitle {
    font-size: 1.75rem;
    line-height: 1.15;
  }

  #resultCount {
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .product-card {
    border-radius: 1.25rem;
  }

  .product-thumb {
    aspect-ratio: 4 / 3;
    padding: 1rem;
  }

  .card-kicker {
    align-items: flex-start;
  }

  .card-actions {
    gap: 0.55rem;
  }

  .primary,
  .secondary,
  .card-actions button {
    min-height: 3.15rem;
    padding: 0.85rem 0.9rem;
  }
}

/* ===========================================================
   v02 design enhancements
   =========================================================== */

/* Smooth dark-hero → light-page transition (change #7) */
.catalog-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 140px;
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 0%, rgba(248, 250, 252, 0.55) 70%, #f8fafc 100%),
    radial-gradient(ellipse at center bottom, rgba(56, 189, 248, 0.10), transparent 70%);
  z-index: 2;
}

/* Filter panel polish (change #9) */
.filter-panel-shell {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 2rem;
  padding: 1.75rem;
  box-shadow: 0 24px 70px rgba(13, 26, 53, 0.12);
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px) {
  .filter-panel-shell { padding: 2rem; }
}
.filter-panel-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9, #38bdf8);
  border-radius: 2rem 2rem 0 0;
}
.filter-panel-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(14, 165, 233, 0.04));
  border: 1px solid rgba(14, 165, 233, 0.22);
  color: #0c4a6e;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}
.filter-panel-label-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}
.filter-panel-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
  margin: 1.25rem 0;
}
.filter-search-row {
  position: relative;
  margin-bottom: 0.25rem;
}
.filter-search-row .filter-search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 1rem;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: #0ea5e9;
  pointer-events: none;
}
#searchInput.filter-search-input {
  width: 100%;
  padding: 1.15rem 1rem 1.15rem 3rem;
  padding-inline-start: 3rem;
  padding-inline-end: 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 1.25rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
#searchInput.filter-search-input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #f0f9ff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
}


/* ===========================================================
   v03-magic — floating UI (FAB, back-to-top, scroll progress)
   =========================================================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(13, 26, 53, .06);
  z-index: 1000;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9, #38bdf8);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(14, 165, 233, .35);
  animation: scrollGradient 3s linear infinite;
  transition: width .12s linear;
}
@keyframes scrollGradient {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.fab-whatsapp {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25d366, #1aa856);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(37, 211, 102, .35), 0 0 0 6px rgba(37, 211, 102, .12);
  transition: transform .25s ease, box-shadow .25s ease, padding .3s ease;
}
.fab-whatsapp:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 22px 52px rgba(37, 211, 102, .45), 0 0 0 8px rgba(37, 211, 102, .18);
}
.fab-whatsapp svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  position: relative;
  z-index: 1;
}
.fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
  animation: fabPulse 2.4s ease-out infinite;
}
@keyframes fabPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.fab-label { white-space: nowrap; transition: max-width .3s ease, opacity .25s ease, margin .3s ease; max-width: 200px; overflow: hidden; }
.fab-whatsapp.collapsed .fab-label { max-width: 0; opacity: 0; margin: 0; }
.fab-whatsapp.collapsed { padding: 14px; }
@media (max-width: 540px) {
  .fab-whatsapp { padding: 12px; }
  .fab-whatsapp .fab-label { display: none; }
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 59;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(13, 26, 53, .9);
  border: 1px solid rgba(105, 200, 238, .35);
  color: #69c8ee;
  cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease, background .25s ease, border-color .25s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover {
  background: rgba(58, 155, 200, .25);
  border-color: rgba(105, 200, 238, .65);
  color: #fff;
}
.back-to-top svg { width: 22px; height: 22px; }
