/* ==========================================================================
   CasaFold v2 — taxonomy, four languages, video cards
   ========================================================================== */

/* ---------- language switch ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 26px;
  padding: 0 6px;
  border-radius: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.lang-link:hover {
  color: var(--ink);
  background: var(--paper-2);
}
.lang-link.is-active {
  background: var(--ink);
  color: var(--paper);
}
.lang-switch--header {
  margin-right: 2px;
}
.lang-switch--mobile {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line-light);
}
.lang-switch--mobile .lang-link {
  color: var(--muted-light);
  border: 1px solid var(--line-light);
}
.lang-switch--mobile .lang-link.is-active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* ---------- header fit ---------- */
.header-actions {
  gap: 10px;
}
.main-nav {
  gap: 25px;
}
@media (max-width: 1240px) {
  .main-nav {
    gap: 17px;
  }
  .nav-link {
    font-size: 12px;
  }
  .lang-switch--header {
    display: none;
  }
}
@media (max-width: 900px) {
  .lang-switch--header {
    display: none;
  }
}

/* ---------- category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  min-width: 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(23, 33, 28, 0.08);
}
.cat-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sand);
}
.cat-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.cat-card:hover .cat-media img {
  transform: scale(1.035);
}
.cat-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.cat-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.cat-body h3 {
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 440;
  margin-bottom: 8px;
}
.cat-body p:not(.cat-kicker) {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.cat-body .text-link {
  margin-top: auto;
  padding-top: 18px;
  align-self: flex-start;
}
.cat-card--style .cat-body {
  padding: 18px 20px 20px;
}
.cat-card--style .cat-body h3 {
  font-size: 21px;
}
.cat-card--style .cat-media {
  aspect-ratio: 3 / 2;
}
#styles {
  background: var(--paper-2);
}
#styles .cat-card {
  background: var(--paper);
}

/* ---------- product cards with video ---------- */
.product-grid--featured {
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.product-card {
  color: var(--ink);
}
.product-media {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 1 / 1;
}
.product-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.3s;
}
.product-card:hover .product-media > img {
  transform: scale(1.035);
}
.card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.product-media.is-playing .card-video {
  opacity: 1;
}
.product-media .product-badge {
  z-index: 3;
}
.video-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(23, 33, 28, 0.82);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 9px;
  backdrop-filter: blur(6px);
}
.sound-toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(247, 243, 234, 0.55);
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.78);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 10px 0 8px;
  backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s;
}
.sound-toggle .icon {
  width: 14px;
  height: 14px;
}
.sound-toggle.is-on {
  background: var(--accent);
  border-color: var(--accent);
}
.sound-toggle:hover {
  background: var(--accent);
}
[dir="rtl"] .sound-toggle {
  left: auto;
  right: 12px;
}
[dir="rtl"] .video-badge {
  right: auto;
  left: 12px;
}
.video-badge .icon {
  width: 10px;
  height: 10px;
}
.product-media.is-playing .video-badge {
  background: var(--accent);
}

/* ---------- filters ---------- */
.filter-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0 16px;
  margin-bottom: 34px;
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 8px 0;
}
.filter-label {
  flex: 0 0 110px;
  padding-top: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.filter-bar {
  margin: 0;
  gap: 6px;
}
.filter-chip {
  padding: 8px 12px;
  font-size: 11.5px;
}
.filter-chip span {
  font-size: 9px;
}
.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.filter-meta p {
  font-size: 11px;
  color: var(--muted);
}
.clear-filters {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  border-bottom: 1px solid currentColor;
}
.coming-soon {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- gallery with images + video ---------- */
.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  overflow: hidden;
}
.gallery-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.gallery-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.gallery-slide .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--paper-2);
}
.gallery-slide--video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.gallery-slide figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  background: rgba(23, 33, 28, 0.78);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 9px;
  backdrop-filter: blur(5px);
}
.gallery-thumbs {
  grid-template-columns: repeat(7, 1fr);
}
.gallery-thumb {
  position: relative;
  padding: 0;
  display: block;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 4px;
  background: rgba(23, 33, 28, 0.72);
  color: var(--paper);
  font-size: 7px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-thumb--video span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--accent);
}
.gallery-thumb--video span .icon {
  width: 8px;
  height: 8px;
}

/* ---------- product page tweaks ---------- */
.product-intro {
  grid-template-columns: 1.05fr 0.95fr;
}
.buy-panel h1 {
  font-size: clamp(34px, 3.4vw, 48px);
}
.buy-panel .product-cat {
  font-size: 9.5px;
}
.highlight-list li {
  font-size: 10.5px;
}
.spec-panel .eyebrow {
  color: var(--accent);
}
.product-overview {
  background: var(--paper-2);
}
.product-overview h2 {
  font-size: clamp(32px, 3.4vw, 44px);
  margin-bottom: 20px;
}
.product-details-grid > div > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin-top: 14px;
}
.related-section {
  background: var(--paper-2);
}
.related-section .product-grid {
  margin-top: 10px;
}

/* ---------- RTL ---------- */
[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] .brand-name,
[dir="rtl"] .stat-num,
[dir="rtl"] .factory-stat {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}
[dir="rtl"] .hero h1 {
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 1.15;
}
[dir="rtl"] .hero h1 em,
[dir="rtl"] h2 em {
  font-style: normal;
}
[dir="rtl"] .hero-copy {
  padding-left: clamp(30px, 5vw, 90px);
  padding-right: max(28px, calc((100vw - 1280px) / 2 + 28px));
}
[dir="rtl"] .nav-link::after {
  transform-origin: right;
}
[dir="rtl"] .dropdown {
  left: auto;
  right: -22px;
}
[dir="rtl"] .spec-row dd {
  text-align: left;
}
[dir="rtl"] .footer-legal {
  text-align: left;
}
[dir="rtl"] .hero-tag {
  border-left: 0;
  border-right: 3px solid var(--accent);
}
[dir="rtl"] .gallery-slide figcaption {
  left: auto;
  right: 14px;
}
[dir="rtl"] .video-badge {
  right: auto;
  left: 12px;
}
[dir="rtl"] .text-link .icon {
  transform: scaleX(-1);
}
[dir="rtl"] .text-link:hover .icon {
  transform: scaleX(-1) translateX(3px);
}
[dir="rtl"] .contact-arrow {
  margin-left: 0;
  margin-right: auto;
  transform: scaleX(-1);
}
[dir="rtl"] .topbar-links a span,
[dir="rtl"] .footer-contact a,
[dir="rtl"] .contact-value,
[dir="rtl"] .hero-tag-model,
[dir="rtl"] .footer-hours {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"] {
  direction: ltr;
  text-align: left;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-grid--featured {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-thumbs {
    grid-template-columns: repeat(5, 1fr);
  }
  .filter-label {
    flex-basis: 90px;
  }
}
@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .cat-grid--style {
    grid-template-columns: repeat(2, 1fr);
  }
  .cat-card--style .cat-media {
    aspect-ratio: 4 / 3;
  }
  .product-grid--featured {
    grid-template-columns: 1fr;
  }
  .filter-row {
    flex-direction: column;
    gap: 8px;
  }
  .filter-label {
    padding-top: 0;
    flex-basis: auto;
  }
  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
  .product-intro {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .cat-grid--style {
    grid-template-columns: 1fr;
  }
  .lang-switch--mobile {
    margin-top: 24px;
  }
  .filter-chip {
    font-size: 10.5px;
    padding: 7px 10px;
  }
  .filter-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
  .gallery-slide figcaption {
    font-size: 8px;
  }
}
@media (max-width: 420px) {
  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* hide floating chat on contact page where the form is the CTA */
body:has(.inquiry-form) .wa-float {
  display: none;
}
