/* ====================== FOOTER ====================== */
.footer {
  background: #131316;
  color: var(--color-white, #ffffff);
  padding: 100px 0 30px;
  position: relative;
  overflow: hidden;
}

.footer__inner {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Watermark "Sensei" big text background */
.footer__watermark {
  position: absolute;
  top: -28px;
  left: 60px;
  width: calc(100% - 120px);
  height: auto;
  max-height: 268px;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.footer__top,
.footer__divider,
.footer__bottom {
  position: relative;
  z-index: 1;
}

/* ===================== TOP ===================== */
.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
}

/* Brand */
.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 360px;
  flex-shrink: 0;
}

.footer__logo {
  display: inline-flex;
  width: 106px;
  height: 24px;
}

.footer__logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.footer__about {
  font-size: 14px;
  line-height: 1.4;
  color: #9ca3af;
  letter-spacing: -0.07px;
  margin: 0;
}

/* Columns grid */
.footer__cols {
  flex: 1;
  display: grid;
  grid-template-columns: 213px 1fr 213px;
  grid-template-areas:
    "product  service contacts"
    "warranty service office";
  column-gap: 60px;
  row-gap: 24px;
  align-items: start;
}

.footer__group--product  { grid-area: product;  }
.footer__group--service  { grid-area: service;  }
.footer__group--contacts { grid-area: contacts; }
.footer__group--office   { grid-area: office;   }
.footer__btn-warranty    { grid-area: warranty; align-self: end; }

.footer__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__title {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  margin: 0;
}

.footer__menu {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__menu li {
  padding: 4px 0;
}

.footer__link {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-white, #ffffff);
  text-decoration: none;
  transition: color var(--transition, 0.2s ease);
}

.footer__link:hover {
  color: var(--color-primary, #fc0008);
}

.footer__link--bold  { font-weight: 700; }
.footer__link--light { font-weight: 300; }
.footer__link--muted { color: #9ca3af; }
.footer__link--btn   { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; text-align: left; }

.footer__contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer__address {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--color-white, #ffffff);
  margin: 0;
}

/* Warranty button */
.footer__btn-warranty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  width: 100%;
  padding: 10px 28px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  font-family: var(--font-primary, inherit);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.28px;
  color: #9ca3af;
  text-decoration: none;
  transition: var(--transition, 0.2s ease);
  white-space: nowrap;
  cursor: pointer;
}

.footer__btn-warranty img {
  display: block;
  width: 18px;
  height: 22px;
}

.footer__btn-warranty:hover {
  background: #9ca3af;
  color: #131316;
}

.footer__btn-warranty:hover img {
  filter: brightness(0);
}

/* Divider */
.footer__divider {
  border: 0;
  border-top: 1px solid #28282a;
  margin: 0;
  width: 100%;
}

.footer__divider--mobile {
  display: none;
}

/* ===================== BOTTOM (desktop) ===================== */
/* Layout: [left: ISO + (c) + privacy + return] [center: socials] [right: lang + rights] */
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Left group */
.footer__bottom-left {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-shrink: 0;
}

.footer__iso {
  display: block;
  width: 53px;
  height: 54px;
  flex-shrink: 0;
  object-fit: contain;
}

.footer__copy,
.footer__rights {
  font-size: 14px;
  line-height: 1.4;
  color: #9ca3af;
  letter-spacing: -0.07px;
  margin: 0;
  white-space: nowrap;
}

/* Center: socials */
.footer__social {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #1b1b1d;
  border: 1px solid #28282a;
  border-radius: 110px;
  transition: background var(--transition, 0.2s ease), border-color var(--transition, 0.2s ease);
}

.footer__social-link:hover {
  background: var(--color-primary, #fc0008);
  border-color: var(--color-primary, #fc0008);
}

.footer__social-link img {
  display: block;
  max-width: 24px;
  max-height: 24px;
  width: auto;
  height: auto;
}

/* Right group */
.footer__bottom-right {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-shrink: 0;
}

/* Lang switcher */
.footer__lang {
  position: relative;
}

.footer__lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: #9ca3af;
  transition: color var(--transition, 0.2s ease);
}

.footer__lang-btn:hover {
  color: var(--color-white, #ffffff);
}

.footer__lang-flag {
  display: block;
  width: 21px;
  height: 15px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 2px;
}

.footer__lang-name {
  font-size: 14px;
  line-height: 1.4;
  color: inherit;
}

.footer__lang-caret {
  display: block;
  flex-shrink: 0;
  transition: transform var(--transition, 0.2s ease);
}

.footer__lang[aria-expanded="true"] .footer__lang-caret,
.footer__lang.is-open .footer__lang-caret {
  transform: rotate(180deg);
}

.footer__lang-list {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #1b1b1d;
  border: 1px solid #28282a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 10;
}

.footer__lang.is-open .footer__lang-list {
  display: block;
}

.footer__lang-list li {
  list-style: none;
}

.footer__lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #9ca3af;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition, 0.2s ease), color var(--transition, 0.2s ease);
}

.footer__lang-option:hover {
  background: #28282a;
  color: var(--color-white, #ffffff);
}

.footer__lang-option.is-current {
  color: var(--color-white, #ffffff);
}


/* ============ <=1023px: tablet/mobile ============ */
@media (max-width: 1023px) {
  .footer {
    padding: 40px 0;
  }

  .footer__inner {
    padding: 0 16px;
    gap: 20px;
  }

  .footer__watermark {
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 376px;
    max-width: none;
    height: 70px;
    object-fit: cover;
  }

  /* Top: stack vertically */
  .footer__top {
    flex-direction: column;
    gap: 20px;
  }

  .footer__brand {
    width: 100%;
  }

  /* Mobile divider after about-text */
  .footer__divider--mobile {
    display: block;
    width: 100%;
  }

  /* Cols: 2-column grid with stacked areas */
  .footer__cols {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "product  service"
      "warranty warranty"
      "contacts office";
    column-gap: 24px;
    row-gap: 20px;
  }

  /* Bottom mobile - 4 rows via flex-wrap + order:
     1: [social]  ->  [lang]
     2: - divider (::before) -
     3: [iso]  [copy]  ->  [rights]
     4: [privacy]  ->  [return]
  */
  .footer__bottom {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px 16px;
  }

  /* Unwrap inner wrappers - their children become direct flex items */
  .footer__bottom-left,
  .footer__bottom-right {
    display: contents;
  }

  /* Row 1 */
  .footer__social  { order: 1; flex: 0 0 auto; }
  .footer__lang    { order: 2; flex: 0 0 auto; margin-left: auto; }

  /* Divider between row 1 and row 2 */
  .footer__bottom::before {
    content: "";
    order: 3;
    flex-basis: 100%;
    height: 1px;
    background: #28282a;
    margin: 2px 0;
  }

  /* Row 2: ISO  (c)  ->  rights */
  .footer__iso    { order: 4; flex: 0 0 auto; width: 40px; height: 41px; }
  .footer__copy   { order: 5; flex: 0 0 auto; }
  .footer__rights { order: 6; flex: 0 0 auto; margin-left: auto; }

  /* Spacer - forces privacy/return onto a new row */
  .footer__bottom::after {
    content: "";
    order: 7;
    flex-basis: 100%;
    height: 0;
  }

  /* Row 3: privacy  ->  return */
  .footer__privacy { order: 8; flex: 0 0 auto; }
  .footer__return  { order: 9; flex: 0 0 auto; margin-left: auto; }
}

/* ============ <=767px: phone refinements ============ */
@media (max-width: 767px) {
  .footer__cols {
    column-gap: 16px;
  }

  .footer__bottom {
    gap: 10px 12px;
  }
}
