.c-tunnel {
  /* .form-group {
    margin-bottom: 1rem;
  } */

  label,
  .fieldset-legend {
    font-size: 16px;
    line-height: 2;
    color: rgba(0, 0, 0, 0.6);
  }

  .fieldset-wrapper:has(.form-radio) {
    &:not(:has(.option-label)) {
      >div {
        display: flex;
        align-items: start;
        flex-wrap: wrap;
        gap: 10px;
      }
    }
  }

  .form-date,
  .form-select {
    margin-top: 0.25rem;
  }

  .custom-checkbox {
    padding-left: 20px;
    margin-bottom: 1rem;

    .form-item {
      margin-bottom: 0;
    }

    label {
      display: inline-block;
      vertical-align: middle;
      position: relative;
      padding-left: 5px;
      width: 99%;
      cursor: pointer;
      word-wrap: break-word;
      line-height: 1.44;

      &::before {
        content: "";
        display: inline-block;
        position: absolute;
        width: 17px;
        height: 17px;
        left: 1px;
        margin-left: -20px;
        border: 2px solid #808080;
        border-radius: 0;
        opacity: 1;
        transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
      }
    }

    input {
      position: absolute;
      z-index: -1;
      opacity: 0;

      &:checked+label {
        &::after {
          font-family: 'Font Awesome 5 Free';
          font-weight: 900;
          content: "\F00C";
          color: #f94230;
          position: absolute;
          left: -17px;
          top: 1px;
          font-size: 12px;
        }

        &::before {
          border-color: #f94230;
        }
      }
    }
  }

  .js-form-type-radio {
    position: relative;
    padding: 5px 0 0 21px;

    input {
      position: absolute;
      opacity: 0;

      &:checked+label:after {
        transform: translate3d(0, 0, 0);
        opacity: 1;
      }
    }

    label {
      display: block;
      cursor: pointer;

      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        display: block;
        width: 16px;
        height: 16px;
        margin: -9px 0 0;
        background: #ffffff;
        box-shadow: 0 0 1px #f94230;
        border: 2px solid #f94230;
        border-radius: 50%;
      }

      &::after {
        content: '';
        position: absolute;
        left: 4px;
        top: 50%;
        display: block;
        width: 8px;
        height: 8px;
        margin: -5px 0 0;
        opacity: 0;
        background: #f94230;
        transform: translate3d(-40px, 0, 0) scale(0.5);
        transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out, -webkit-transform 0.25s ease-in-out;
        border-radius: 50%;
      }
    }

  }

  /* Style pour checkbox avec classe field-checkbox-radio (même style que les radios) */
  .field-checkbox-radio {
    .js-form-type-checkbox {
      position: relative;
      padding: 5px 0 5px 21px;

      input {
        position: absolute;
        opacity: 0;

        &:checked+label:after {
          transform: translate3d(0, 0, 0);
          opacity: 1;
        }
      }

      label {
        display: block;
        cursor: pointer;

        &::before {
          content: '';
          position: absolute;
          left: 0;
          top: 50%;
          display: block;
          width: 16px;
          height: 16px;
          margin: -9px 0 0;
          background: #ffffff;
          box-shadow: 0 0 1px #f94230;
          border: 2px solid #f94230;
          border-radius: 50%;
        }

        &::after {
          content: '';
          position: absolute;
          left: 4px;
          top: 50%;
          display: block;
          width: 8px;
          height: 8px;
          margin: -5px 0 0;
          opacity: 0;
          background: #f94230;
          transform: translate3d(-40px, 0, 0) scale(0.5);
          transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out, -webkit-transform 0.25s ease-in-out;
          border-radius: 50%;
        }
      }
    }
  }

  .form-actions {
    text-align: right;

    input {
      border-radius: 4px;
      border: 1px solid transparent;
      padding: 0.375rem 0.75rem;
      font-size: 1rem;
      line-height: 1.5;
      font-weight: 500;
      text-transform: uppercase;
    }
  }
}

.options-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  color: #454545;
}

.options-intro {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.67;
  color: rgba(0, 0, 0, 0.5);
}

.js-form-type-radio:has(.option-label) {
  padding: 15px 15px 15px 60px !important;
  border: 2px solid #e8e8e8;

  label {
    &::before {
      left: 30px;
      top: 32px;
    }

    &::after {
      left: 34px;
      top: 32px;
    }
  }

  .option-label {
    margin-bottom: 2px;
    font-size: 18px;
    font-weight: bold;
    line-height: 2;
    color: #454545;
  }

  .option-desc {
    font-size: 13px;
    line-height: 1.23;
    color: #454545;
  }
}

.form-item:has(.option-label) {
  .form-item:not(:last-child) {
    margin-bottom: 0;
    border-bottom: 0;
  }
}

#tunnel-welcome-modal {
  h5 {
    color: #002699;

    &:not(:first-child) {
      margin-top: 24px;
    }
  }
}

/**
 * Tunnel layout
 */
@media (min-width: 992px) {
  .c-tunnel__content {
    flex: 1 0 auto !important;
    /* max-width: calc(100% - 375px) !important; */
    width: 70% !important;
  }

  .c-tunnel__sidebar {
    max-width: 375px !important;
    width: 30% !important;
  }
}

.c-tunnel__sidebar {
  font-size: 16px;
  font-weight: 100;
}

.c-tunnel__sidebar .modal {
  font-size: 18px;
}

/**
 * Tunnel options product (step 1)
 */
.c-tunnel__product-header {
  font-size: 20px;
  line-height: 1.44;
  color: #454545;
  margin-bottom: 20px;

  a:hover {
    text-decoration: none;
  }
}

.c-tunnel__product-image {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: solid 3px #307fe2;
  text-align: center;
}

/**
 * Tunnel Cart Summary
 */
.cart-summary,
.cart-summary a {
  color: #fff;
}

.cart-summary__header,
.cart-summary__items {
  padding: 15px;
  background-color: #307fe2;
}

.cart-summary__title {
  margin-bottom: 30px;
  text-align: center;
  font-size: 18px;
}

.cart-summary__title i {
  margin-right: 5px;
  font-size: 26px;
  vertical-align: middle;
}

.cart-summary__header {
  padding-bottom: 24px;
}

.cart-summary__header .cart-summary__item-label {
  font-size: 22px;
}

.cart-summary__total-price {
  font-size: 35px;
  font-weight: 700;
}

.cart-summary__item {
  padding-bottom: 24px;
}

.cart-summary__item:last-child {
  padding-bottom: 10px;
}

.cart-summary__item-label {
  font-size: 18px;
}

.cart-summary__item-price {
  font-size: 20px;
  font-weight: 400;
}

.cart-summary__item-promo,
.cart-summary__item-codeagent {
  padding-top: 15px;
  font-size: 18px;
  font-weight: 700;
}

.cart-summary__item-codeagent {
  padding-top: 10px;
  color: #ffc107;
}

.cart-summary__item sub {
  font-size: 12px;
  font-weight: 400;
}


.cart-summary__footer {
  padding: 15px;
  background-color: #009ca6;
  border-top: 2px solid #fff;
  font-size: 22px;
  font-weight: 400;
}

.cart-summary__footer .cart-summary__total-price {
  font-size: 27px;
}

.cart-summary__price-info {
  font-size: 18px;
}

.cart-summary__cta-update {
  margin-top: 0.675rem;
  text-align: end;
  font-weight: 400;
}

.cart-summary--install {
  margin-top: 20px;
}

.cart-summary--install .cart-summary__header {
  padding: 15px;
}

.cart-summary--install .cart-summary__title {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: start;
}

.cart-summary--install .cart-summary__footer {
  font-size: 16px;
  font-weight: 100;
}


/**
 * Tunnel Form
 */
.c-tunnel__title-step {
  font-size: 24px;
  font-weight: 700;
  color: #454545;
}

.c-tunnel__infos {
  padding-top: 10px;
  color: #000;
  opacity: .7;
}

.c-tunnel__form-wrap {
  padding: 15px;
  margin-top: 30px;
  margin-bottom: 24px;
  border: solid 2px rgba(128, 128, 128, 0.17);
}


/**
 * Tunnel Reviews
 */
.c-tunnel__reviews {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.c-tunnel__reviews-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 17px 26px;
  background-color: #005eb8;
  font-size: 19px;
  line-height: 1.5;
  font-weight: bold;
  color: #fff;

  p {
    margin-bottom: 0;
  }
}

.c-tunnel__reviews-item:first-child {
  font-size: 24px;
}

.c-tunnel__reviews-item__cta {
  margin-left: 15px;
  font-size: 16px;
  font-weight: 700;
  line-height: 2.28;
  color: #fff;
  text-decoration: none;
}


/**/
.c-intro-form {
  margin-bottom: 30px;

  .c-intro-form__desc {
    line-height: 1.67;
    color: rgba(0, 0, 0, 0.5);
  }
}


/* Panier widget */
.panier-widget {
  position: sticky;
  top: 20px;
}

.panier-widget h3 {
  margin-top: 0;
  font-size: 20px;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 10px;
}

.panier-product {
  margin: 20px 0;
}

.product-label {
  margin-bottom: 15px;
}

.product-pricing {
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.price-row.fiscal {
  color: #28a745;
  font-size: 14px;
}

.price-row .price {
  font-weight: bold;
  font-size: 18px;
}

.panier-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.panier-info .small {
  font-size: 12px;
  color: #666;
}

/* Complete page */
.tunnel-complete {
  max-width: 600px;
  margin: 50px auto;
  text-align: center;
  padding: 40px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-icon {
  font-size: 80px;
  color: #28a745;
  margin: 20px 0;
}

.ven-reference {
  background: #f0f0f0;
  padding: 20px;
  border-radius: 4px;
  margin: 30px 0;
}

.reference-number {
  font-size: 24px;
  font-weight: bold;
  color: #0066cc;
}

.next-steps {
  text-align: left;
  margin: 30px 0;
}

.next-steps ol {
  padding-left: 20px;
}

.next-steps li {
  margin-bottom: 10px;
}

/**
 * Additive Accessories & Services Styles (production site style)
 */
.c-tunnel__services,
.c-tunnel__packs,
.c-tunnel__accessories,
.c-tunnel__additive-accessories {
  .fieldset-legend {
    display: block;
    margin-bottom: 20px;
    font-size: 28px;
    line-height: 1.5;
    color: #000;
  }
}

.c-tunnel__packs,
.c-tunnel__accessories {
  .fieldset-legend {
    color: #307fe2 !important;
  }
}

.c-tunnel__packs {

  /* Style des radios pour qu'ils ressemblent à des checkboxes carrées */
  .form-radios {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 1rem;
  }

  .form-item {
    position: relative;
  }

  .js-form-type-radio {
    width: 100%;
    padding-left: 0;
  }

  input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;

    /* Style custom pour le radio comme checkbox carrée */
    +label {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0;
    width: 100%;
      padding: 0;
      border: 0;
      cursor: pointer;
      transition: all 0.3s ease;
      min-height: auto;
      background: transparent;

      &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 5px;
        width: 28px;
        height: 28px;
        border: 2px solid #307fe2;
        border-radius: 0;
        background-color: #fff;
        transition: all 0.3s ease;
        z-index: 1;
      }

      &::after {
        content: "";
        position: absolute;
        left: 0;
        top: 5px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background-color: transparent;
        transition: all 0.3s ease;
        z-index: 2;
      }
    }

    &:checked+label {
      &::before {
        background-color: #307fe2;
        border-color: #307fe2;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 24px;
      }

      &::after {
        display: none;
      }

      .pack-radio-content {
        background-color: #fff;
      }
    }
  }

  .pack-radio-option {
    flex: 1;
    border: 0 !important;
    background: transparent !important;
    padding: 0;
    margin: 0 0 10px;

    .pack-radio-header {
      display: flex;
      align-items: center;
      padding-left: 40px;
      /* margin-bottom: 10px; */

      .pack-title {
        font-size: 22px;
        font-weight: bold;
        color: #000;
        line-height: 1;
      }
    }

    .pack-radio-content {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 20px 50px;
    width: 100%;
      padding: 15px 0;
      cursor: pointer;
      transition: background-color 0.3s ease;
      border-radius: 0;

      @media (min-width: 576px) and (max-width: 767.98px) {
        gap: 20px;
      }


      @media (max-width: 575.98px),
      (min-width: 768px) and (max-width: 991.98px) {
        flex-wrap: wrap;
      }

      /*
      &:hover {
        background-color: #f0f7ff;
      } */

      .pack-images {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-shrink: 0;
        min-width: 50%;

        .pack-image {
          /* max-width: 120px; */
          max-height: 150px;
          object-fit: contain;
        }
      }

      .pack-details {
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex: 1;

        @media (max-width: 575.98px),
        (min-width: 768px) and (max-width: 991.98px) {
          flex: 0 0 100%;
        }

        .pack-device-label {
          font-size: 22px;
          font-weight: bold;
          color: #000;
          line-height: 1;
          display: block;
        }

        .pack-price {
          font-size: 20px;
          color: #000;

          .pack-price-value {
            font-size: 20px;
          }
        }

        .pack-price-after-credit {
          font-size: 17px;
          color: #000;
        }
      }
    }
  }
}

.c-tunnel__sub-options {
  margin-bottom: 24px;

  @media (min-width: 992px) {
    padding-left: 177px;
  }

  .fieldset-legend {
    display: block;
    margin-bottom: 25px;
    font-size: 22px;
    color: #000;
  }

  .description {
    color: red;
  }
}

.c-tunnel__accessories {
  padding-top: 20px;
  margin-bottom: 20px;
  border-top: 1px #000 dashed;
  border-bottom: 1px #000 dashed;
}

/* Style pour les options de mode de port (detect_wearing_mode) - checkbox plus petit */
#detect-wearing-mode-wrapper {
  .form-radios {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }

  .form-item {
    position: relative;
    border: 0;
    padding: 0;
    margin: 0;
  }

  #edit-detect-wearing-mode {
    gap: 30px;

    .card-img-bottom {
      width: calc(100% + 30px);
      margin-left: -30px;
      padding: 10px 0 20px;
      display: flex;
      justify-content: center;
    }
  }

  input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;

    /* Style custom pour le radio comme checkbox carrée (plus petit) */
    +label {
      position: relative;
      display: flex;
      flex-direction: row;
      gap: 10px;
      padding: 0;
      border: 0;
      cursor: pointer;
      transition: all 0.3s ease;
      min-height: auto;
      background: transparent;
      font-size: 20px;
      line-height: 1;
      color: #000;

      &::before {
        content: "";
        position: relative;
        top: 7px;
        width: 20px;
        height: 20px;
        min-width: 20px;
        flex-shrink: 0;
        border: 2px solid #307fe2;
        border-radius: 0;
        background-color: #fff;
        transition: all 0.3s ease;
        z-index: 1;
      }

      &::after {
        display: none;
      }
    }

    &:checked+label {
      &::before {
        background-color: #307fe2;
        border-color: #307fe2;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 14px 14px;
      }

      &::after {
        display: none;
      }
    }
  }
}

.display-format-details .c-tunnel__additive-accessories {
  .btn-additive-toggle {
    display: none !important;
  }

  .fieldset-legend {
    display: block;
    margin-bottom: 20px;
    font-size: 28px;
    line-height: 1.5;
    color: #000;
  }

  .form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 1rem;
  }

  .form-check.additive-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 4px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    min-height: auto;
    height: auto;
    text-align: left;

    &:hover {
      border-color: #307fe2;
      background-color: #f0f7ff;
    }

    &.checkedinput {
      border-color: #307fe2;
      background-color: #f0f7ff;
    }

    input[type="checkbox"] {
      position: relative;
      opacity: 1;
      width: 28px;
      height: 28px;
      min-width: 28px;
      flex-shrink: 0;
      cursor: pointer;
      margin: 0;
      margin-top: 5px;
      accent-color: #307fe2;
    }

    .popchek {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      gap: 15px;
      flex: 1;
      padding: 0;
      border: 0;
      cursor: pointer;

      .img-addon {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;

        .theImg {
          max-width: 100%;
          max-height: 100%;
          object-fit: contain;
        }
      }

      .popchek-content {
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex: 1;
      }

      .titre-addon {
        font-size: 18px;
        font-weight: 600;
        color: #002699;
        line-height: 1.4;
      }

      .coleur-addon {
        font-size: 14px;
        color: #666;
      }

      .prix-addon {
        font-size: 18px;
        font-weight: 700;
        color: #454545;
        line-height: 1.4;

        b {
          font-size: 20px;
        }

        sub {
    font-size: 12px;
          font-weight: 400;
        }
      }

      /* TODO: static element - Prix après crédit d'impôt (à récupérer depuis le backend) */
      .prix-apres-credit {
        font-size: 14px;
        color: #666;
        line-height: 1.4;
      }
    }
  }
}

.display-format-card .c-tunnel__additive-accessories,
.c-tunnel__services,
.c-tunnel__accessories {
  .fieldset-legend {
    display: block;
    margin-bottom: 20px;
    font-size: 28px;
    line-height: 1.5;
    color: #000;
  }

  /* .fieldset-wrapper, */
  .form-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 1rem;

    .form-item {
      position: relative;
      flex-basis: calc(33.33% - 15px);

      label {
        width: 100%;
        height: 100%;
      }

      input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
      }
    }
  }

  .form-check.additive-item {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 235px;
    padding: 0;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    text-align: center;
    cursor: pointer;

    &.checkedinput {
      background-color: #f0f7ff;

      .popchek {
        border-color: #307fe2;
      }

      .btn-additive-toggle {
        background-color: #307fe2;
        color: #ffffff;
      }
    }

    &:hover {
      .btn-additive-toggle {
        background-color: #002699 !important;
        color: #ffffff;
      }
    }

    .popchek {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      flex: 1;
      padding: 15px 10px;
      border: 3px solid #d5d5d5;

      .popchek-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1;
      }

      .img-addon {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 10px;

        .theImg {
          max-width: 100px;
          max-height: 100px;
          object-fit: contain;
        }
      }

      .titre-addon {
        font-size: 16px;
        font-weight: 600;
        color: #002699;
        line-height: 1.4;
        text-align: center;
      }

      .coleur-addon {
        font-size: 14px;
        color: #666;
      }

      .prix-addon {
        font-size: 18px;
        font-weight: 700;
        color: #454545;
        padding-top: 5px;
        margin-top: auto;

        b {
          font-size: 20px;
        }

        sub {
          font-size: 12px;
          font-weight: 400;
        }
      }
    }

    .btn-additive-toggle {
      width: 100%;
      background-color: #d5d5d5;
      color: #545454;
      padding: 7px 15px;
      border: 0;
      /* border-radius: 4px; */
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      margin-top: auto;

      /* &.btn-ajouter {
        background-color: #fff;
        color: #307fe2;

        &:hover {
          background-color: #307fe2;
          color: #fff;
        }
      } */

      &.btn-retirer {
        background-color: #307fe2;
        color: #fff;

        &:hover {
          background-color: #0056b3;
          border-color: #0056b3;
        }
      }
    }

    label.option {
    display: none;
      /* Masquer le label par défaut */
    }
  }
}

.c-tunnel__footer {
  .form-actions {
    input {
      min-width: 278px;
      border-radius: 0;
      padding: 0.813rem 0.75rem;
      font-size: 20px;
    }
  }
}

