/* ==========================================================================
   TIRE BRAND SHOWCASE — Logo grid, modal & product vitrin
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Brand logo cards (logo only, no text) ── */
button.brands__card.brands__card--logo-only {
  width: 100%;
  margin: 0;
  padding: clamp(16px, 2.5vw, 24px);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  flex-direction: column;
  gap: 0;
  min-height: 108px;
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 320ms ease,
    box-shadow 320ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 320ms ease;
}

.brands__card--logo-only .brands__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 56px;
  margin: 0;
}

.brands__card--logo-only .brands__logo img,
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 148px);
  max-height: 48px;
  object-fit: contain;
  object-position: center;
  opacity: 0.94;
  filter: none;
  mix-blend-mode: normal;
  image-rendering: -webkit-optimize-contrast;
  transition:
    opacity 280ms ease,
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optik hizalama — marka bazlı boyut ayarı */
.logo-michelin { max-height: 50px; max-width: 132px; }
.logo-goodyear { max-height: 44px; max-width: 140px; }
.logo-pirelli { max-height: 46px; max-width: 128px; }
.logo-continental { max-height: 42px; max-width: 136px; }
.logo-bridgestone { max-height: 36px; max-width: 144px; }
.logo-lassa { max-height: 38px; max-width: 132px; }
.logo-petlas { max-height: 40px; max-width: 120px; }
.logo-hankook { max-height: 34px; max-width: 140px; }
.logo-kumho { max-height: 36px; max-width: 128px; }
.logo-nexen { max-height: 40px; max-width: 120px; }
.logo-yokohama { max-height: 42px; max-width: 132px; }
.logo-bfgoodrich { max-height: 38px; max-width: 144px; }
.logo-starmaxx { max-height: 34px; max-width: 136px; }

.brands__card--logo-only:hover .brands__logo img,
.brands__card--logo-only:hover .brand-logo {
  opacity: 1;
  transform: scale(1.06);
}

.brands__card--logo-only:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(59, 130, 246, 0.18);
}

.brands__card--logo-only:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  button.brands__card.brands__card--logo-only {
    min-height: 92px;
    padding: 14px 12px;
  }

  .brands__card--logo-only .brands__logo img,
  .brand-logo {
    max-height: 40px;
    max-width: min(100%, 120px);
  }

  .logo-michelin { max-height: 42px; max-width: 112px; }
  .logo-bridgestone { max-height: 32px; max-width: 120px; }
  .logo-hankook { max-height: 30px; max-width: 120px; }
}

html.is-tire-modal-open,
body.is-tire-modal-open {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

/* ── Modal shell ── */
.tire-modal {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tire-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow: hidden;
}

.tire-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tire-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 1180px);
  max-height: min(92vh, 920px);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    165deg,
    rgba(18, 18, 22, 0.98) 0%,
    rgba(10, 10, 12, 0.99) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.48);
  transform: scale(0.94);
  opacity: 0.92;
  transition:
    transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tire-modal.is-open .tire-modal__dialog {
  transform: scale(1);
  opacity: 1;
}

.tire-modal__watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: min(70%, 520px);
  height: min(70%, 520px);
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: screen;
}

.tire-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.tire-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

/* ── Modal header ── */
.tire-modal__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 3vw, 32px);
  padding: clamp(28px, 3.5vw, 40px) clamp(24px, 3vw, 36px) clamp(12px, 1.5vw, 16px);
  border-bottom: none;
}

.tire-modal__brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: clamp(96px, 14vw, 128px);
  height: clamp(96px, 14vw, 128px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.tire-modal__brand-logo img,
.tire-modal__brand-logo .brand-logo {
  display: block;
  max-width: 78%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: none;
  mix-blend-mode: normal;
  opacity: 0.96;
}

.tire-modal__brand-logo .logo-michelin { max-height: 72%; max-width: 70%; }
.tire-modal__brand-logo .logo-bridgestone { max-height: 62%; max-width: 82%; }
.tire-modal__brand-logo .logo-hankook { max-height: 58%; max-width: 84%; }
.tire-modal__brand-logo .logo-continental { max-height: 64%; max-width: 78%; }
.tire-modal__brand-logo .logo-kumho { max-height: 60%; max-width: 76%; }
.tire-modal__brand-logo .logo-starmaxx { max-height: 58%; max-width: 80%; }

.tire-modal__brand-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.tire-modal__brand-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.65;
  max-width: 760px;
}

.tire-modal__divider {
  margin-top: clamp(16px, 2vw, 20px);
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.45) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
}

/* ── Toolbar: filters + search ── */
.tire-modal__toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: clamp(12px, 1.5vw, 16px) clamp(24px, 3vw, 36px) clamp(16px, 2vw, 20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tire-modal__search--top {
  flex: none;
  width: 100%;
  max-width: 100%;
}

.tire-modal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.tire-modal__filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    color 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease;
}

.tire-modal__filter:hover {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.35);
}

.tire-modal__filter.is-active {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.16);
}

.tire-modal__search {
  flex: 0 1 220px;
  min-width: min(100%, 180px);
}

.tire-modal__search-input {
  width: 100%;
  min-height: 40px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.tire-modal__search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.tire-modal__search-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ── Product grid ── */
.tire-modal__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(20px, 2.5vw, 28px) clamp(24px, 3vw, 36px) clamp(24px, 3vw, 36px);
  -webkit-overflow-scrolling: touch;
}

.tire-modal__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 20px);
}

.tire-modal__empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
}

.tire-product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 250ms ease,
    box-shadow 250ms ease;
}

.tire-product:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(59, 130, 246, 0.12);
}

.tire-product__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0e0e14;
}

.tire-product__media img {
  display: block;
  width: 88%;
  height: 88%;
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  object-position: center;
  transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tire-product:hover .tire-product__media img {
  transform: scale(1.04);
}

.tire-product__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: clamp(14px, 1.8vw, 18px);
}

.tire-product__name {
  margin: 0;
  color: #ffffff;
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.tire-product__category {
  margin: 0;
  color: rgba(59, 130, 246, 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tire-product__desc {
  margin: 0;
  flex: 1;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.55;
}

.tire-product__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tire-product__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.tire-product__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tire-product__actions .hero__btn {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero__btn--whatsapp {
  color: #ffffff;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border: 1px solid rgba(37, 211, 102, 0.35);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
}

.hero__btn--whatsapp:hover {
  background: linear-gradient(135deg, #2ee676 0%, #17a589 100%);
  border-color: rgba(37, 211, 102, 0.55);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.28);
}

.hero__btn--whatsapp .bi {
  font-size: 1.1em;
}

@media (max-width: 1024px) {
  .tire-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tire-modal {
    padding: 0;
    align-items: stretch;
  }

  .tire-modal__dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .tire-modal__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 56px;
  }

  .tire-modal__brand-info {
    padding-top: 0;
  }

  .tire-modal__brand-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .tire-modal__divider {
    width: 100%;
  }

  .tire-modal__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tire-modal__search {
    flex: 1 1 auto;
    width: 100%;
  }

  .tire-modal__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tire-modal,
  .tire-modal__dialog,
  .tire-product,
  .tire-product__media img,
  button.brands__card.brands__card--logo-only,
  .brands__card--logo-only .brands__logo img,
  .brand-logo {
    transition: none;
  }

  .tire-product:hover,
  .brands__card--logo-only:hover {
    transform: none;
  }
}
