/* ============================================================
   Ficha modal component: product/use-case detail dialog with a
   photo carousel, attribute list and related-items grid.
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1.25rem;
  overflow-y: auto;
}
.modal.is-open {
  display: flex;
}
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: mFade 0.25s var(--ease);
}
.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 67.5rem;
  background: var(--black);
  color: var(--white);
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 1.875rem 5.625rem rgba(0, 0, 0, 0.55);
  animation: mUp 0.35s var(--ease);
}
@keyframes mFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mUp {
  from { opacity: 0; transform: translateY(1.25rem) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 1.125rem;
  right: 1.125rem;
  z-index: 3;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-size: 1.375rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.modal__close:hover {
  background: var(--green);
  color: var(--black);
  border-color: var(--green);
  transform: rotate(90deg);
}

.modal__body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  align-items: stretch;
}
@media (max-width: 780px) {
  .modal__body {
    grid-template-columns: 1fr;
  }
}

/* ------- Carousel ------- */
.cars {
  position: relative;
  background: #0c0c0c;
  overflow: hidden;
  min-height: 30rem;
}
@media (max-width: 780px) {
  .cars {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}
.cars__track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.cars__slide {
  flex: 0 0 100%;
  min-width: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}
.cars__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.05) 0%, rgba(20, 20, 20, 0.55) 100%);
  pointer-events: none;
}
.cars__slide--ph {
  background: linear-gradient(135deg, var(--blue) 0%, #03306e 100%);
}
.cars__cap {
  position: absolute;
  left: 1.125rem;
  bottom: 0.875rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cars__count {
  position: absolute;
  right: 1.125rem;
  top: 1.125rem;
  z-index: 2;
  padding: 0.3125rem 0.6875rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* On mobile the carousel is full-width, so the count moves to the left
   (top-right would sit under the close button). */
@media (max-width: 780px) {
  .cars__count {
    right: auto;
    left: 1.125rem;
    width: max-content;
  }
}
.cars__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.cars__nav:hover {
  background: var(--green);
  color: var(--black);
  border-color: var(--green);
}
.cars__nav--p {
  left: 0.875rem;
}
.cars__nav--n {
  right: 0.875rem;
}
.cars__nav[disabled] {
  opacity: 0.35;
  cursor: default;
}
.cars__dots {
  position: absolute;
  left: 50%;
  bottom: 0.875rem;
  transform: translateX(-50%);
  z-index: 2;
  display: none;
  gap: 0.375rem;
}
.cars__dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s var(--ease);
}
.cars__dot.is-on {
  background: var(--green);
  width: 1.25rem;
  border-radius: 0.25rem;
}

.modal__content {
  padding: 2.625rem 2.75rem;
}
@media (max-width: 780px) {
  .modal__content {
    padding: 1.875rem 1.625rem;
  }
  .modal__close {
    background: rgba(20, 20, 20, 0.55);
  }  
}
.modal__label {
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.125rem;
}
.modal__name {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
  margin-bottom: 1.125rem;
}
.modal__desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}

.attrs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}
.attr {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
}
.attr__ic {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: var(--black);
  border-radius: 0.5rem;
}
.attr__ic svg {
  width: 1rem;
  height: 1rem;
}
.attr__lb {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  line-height: 1.2;
}
.attr__vl {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.modal__rel {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.375rem;
}
.modal__rel h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.875rem;
}
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.rel-card {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border-radius: 0.375rem;
  cursor: pointer;
  background: #222;
}
.rel-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s var(--ease);
}
.rel-card:hover .rel-card__bg {
  transform: scale(1.08);
}
.rel-card__ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}
.rel-card__lb {
  position: absolute;
  left: 0.625rem;
  bottom: 0.5rem;
  right: 0.625rem;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Lock the page scroll while the modal is open. */
body.modal-locked {
  overflow: hidden;
}
