/* CMS HTML Content component - content switch (toggle/tabs) while keep option to edit texts in wysiwyg */
/* eg.: /samsung-galaxy-s24-fe, .. */
/* <link href="/static/css/components/contentSwitch.css" rel="stylesheet"> */

.contentSwitch {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  margin: 0 auto;
}

@media (min-width: 501px) and (max-width: 850px) {
  .contentSwitch {
    gap: 20px;
  }
}

@media (max-width: 500px) {
  .contentSwitch {
    gap: 14px;
  }
}

.contentSwitch:not([style*="2"]):not([style*="5"]):not([style*="6"]) .contentSwitch__label {
  max-width: 270px;
}

.contentSwitch .contentSwitch__label {
  flex: 1 0 calc(100% / (var(--content-options) + 1));
}

@media (max-width: 500px) {
  .contentSwitch .contentSwitch__label {
    width: 25%;
    flex: 1 0 33.33%;
  }
}

.contentSwitch [class*="contentSwitch__content"] .wrapper {
  display: grid;
  align-items: flex-end;
  gap: 20px;
  margin: 40px auto 60px;
}

@media (min-width: 1211px) {
  .contentSwitch [class*="contentSwitch__content"] .wrapper {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1472px;
  }
}

@media (min-width: 701px) and (max-width: 1210px) {
  .contentSwitch [class*="contentSwitch__content"] .wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 40px 20px;
    max-width: 850px;
  }
}

@media (max-width: 700px) {
  .contentSwitch [class*="contentSwitch__content"] .wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 400px) {
  .contentSwitch [class*="contentSwitch__content"] .wrapper {
    gap: 10px;
  }
}

@media (min-width: 1211px) {
  .contentSwitch [class*="contentSwitch__content"] .wrapper:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 956px;
  }
}

.contentSwitch__input {
  position: absolute;
  height: 0;
  width: 0;
  opacity: 0;
}

*:not([class*="contentSwitch__input--"]) + .contentSwitch__switch + .contentSwitch__content--one {
  display: block;
}

.contentSwitch__input--yes:checked ~ .contentSwitch__content--one {
  display: block;
}

.contentSwitch__input--yes:checked ~ .contentSwitch__switch .contentSwitch__label--yes {
  color: #fff;
  background: #333;
}

.contentSwitch__input--yes:checked ~ .contentSwitch__switch .contentSwitch__label--yes:before {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.contentSwitch__input--yes:checked ~ .contentSwitch__switch .contentSwitch__label--no:before {
  background: #f5f6f7;
  transition-delay: unset;
}

.contentSwitch__input--no:checked ~ .contentSwitch__content--one {
  display: none;
}

.contentSwitch__input--no:checked ~ .contentSwitch__content--two {
  display: block;
}

.contentSwitch__input--no:checked ~ .contentSwitch__switch .contentSwitch__label--no {
  color: #fff;
  background: #333;
}

.contentSwitch__input--no:checked ~ .contentSwitch__switch .contentSwitch__label--no:before {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.contentSwitch__input--no:checked ~ .contentSwitch__switch .contentSwitch__label--yes:before {
  background: #f5f6f7;
  transition-delay: unset;
}

.contentSwitch__input:checked + .contentSwitch__label {
  color: #fff;
  background: #333;
}

.contentSwitch__input:checked + .contentSwitch__label:before {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: #333;
}

.contentSwitch__input:checked + .contentSwitch__label + [class*="contentSwitch__content--"] {
  display: block;
}

[class*="contentSwitch__content--"] {
  display: none;
  width: 100%;
  order: 1;
}

.contentSwitch__switch {
  display: flex;
  justify-content: center;
  gap: 40px;
}

@media (min-width: 501px) and (max-width: 850px) {
  .contentSwitch__switch {
    gap: 20px;
  }
}

@media (max-width: 500px) {
  .contentSwitch__switch {
    gap: 10px;
  }
}

.contentSwitch__label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 430px;
  width: 100%;
  padding: 19px 25px 21px;
  border-radius: 28px;
  font-size: 25px;
  color: #000;
  background: #f5f6f7;
  transition: 0.3s color ease-in-out, 0.3s background ease-in-out;
  cursor: pointer;
}

@media (min-width: 501px) and (max-width: 850px) {
  .contentSwitch__label {
    font-size: 20px;
  }
}

@media (max-width: 500px) {
  .contentSwitch__label {
    padding: 15px 20px 17px;
    border-radius: 15px;
    font-size: 16px;
  }
}

.contentSwitch__label:before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  width: 60px;
  height: 12px;
  background: #333;
  clip-path: polygon(0 0, 100% 0, 50% 0);
  transition: 0.3s clip-path ease-in-out;
  transition-delay: 0.1s;
  z-index: -1;
}

@media (max-width: 500px) {
  .contentSwitch__label:before {
    width: 30px;
  }
}
