/* Основные стили контейнера */
#quiz-container {
   /* max-width: 600px;*/
    margin: auto;
    text-align: center;
    font-family: Arial, sans-serif;
    max-width: 100%;
}

/* Стили прогресс-бара */
.custom-progress-bar {
  width: 100%;
  height: 20px;
  background-color: #eee;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.custom-progress-value {
  height: 100%;
  width: 0%;
  background-image: repeating-linear-gradient(
    -80deg, /* Меняем угол на отрицательный (или 90deg) */
    #ff6600 0px,
    #ff6600 10px,
    #ffffff 10px,
    #ffffff 20px
  );
  background-size: 40px 40px;
  background-repeat: repeat;
  animation: progress_bar 1s linear infinite;
  transition: width 0.3s ease-out;
  background-position: 0 0; /* Начинаем с левого края */
}

@keyframes progress_bar {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}




/* Стили шагов */


.quiz-step {
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(20px);
    padding: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-height: 360px;
    max-height: calc(100vh - 230px);
    overflow: hidden;
    display: none;
    flex-direction: column;

    scrollbar-width: thin; /* для Firefox */
    scrollbar-color: #ffaa00 transparent; /* Firefox */
}


.quiz-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 380px);
    overflow-y: auto;
    padding: 4px 4px 8px;
}	
	
	
/* Для WebKit-браузеров (Chrome, Safari, Edge) */
.quiz-list::-webkit-scrollbar {
    width: 8px;
}

.quiz-list::-webkit-scrollbar-track {
    background: transparent;
}

.quiz-list::-webkit-scrollbar-thumb {
    background-color: #ffaa00;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.quiz-list::-webkit-scrollbar-thumb:hover {
    background-color: #e09a00;
}











.quiz-step.active {
  opacity: 1;
    transform: translateY(0);
    display: flex;
}

.quiz-step[style*="block"] {
    display: flex !important;
}

/* Стили вариантов */
.quiz-option {
    display: inline-block;
    margin: 8px;
    padding: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.quiz-option:hover,
.quiz-option.selected {
    border-color: #ff6600;
    background-color: #f0fff0;
}

.quiz-option img {
    width: 92px;
    height: 92px;
    display: block;
    margin: auto;
    border-radius: 10px;
}

.quiz-option p {
    margin-top: 8px;
    margin-bottom: 0;
    font-weight: bold;
    line-height: 1.25;
}

.quiz-color-swatch {
    display: block;
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.quiz-option-color,
.quiz-option:has(.quiz-color-swatch) {
    width: 128px;
    max-width: 128px;
    vertical-align: top;
}

/* Кнопка "Дальше" */
.next-button {
    align-self: flex-end;
    display: none;
    padding: 10px 20px;
    margin-top: 12px;
    background: #ff6600;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.next-button:hover {
    background: #005a87;
}

/* Стили формы */
#quiz-form-container {
    text-align: center;
    display: none;
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#quiz-form-container h3 {
    margin-bottom: 15px;
}

#quiz-form-container button {
    display: inline-block;
     margin: 10px auto;
    padding: 10px 15px;
    background: #ff6600;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

#quiz-form-container button:hover {
    background: #005a87;
}



.quiz-step .active {
 background:#edbcbc;
}


/* Поля ввода */
#contact-form {
    margin-top: 15px;

}

#contact-form input {
    width: 90%;
    max-width: 300px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#contact-form button {
    display: block;
    width: 100%;
    max-width: 320px;
}

.quiz-dimensions-layout {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(220px, 1fr);
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 560px;
    margin: 4px auto 0;
}

.quiz-dimensions-image img {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.quiz-dimensions-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-dimensions-fields input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.quiz-dimensions-fields .next-button {
    align-self: stretch;
    width: 100%;
    margin-top: 2px;
}

@media (max-width: 767px) {
    #quiz {
        scroll-margin-top: 92px;
    }

    #quiz-container {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        font-size: 14px;
    }

    .custom-progress-bar {
        height: 12px;
    }

    #progress-text {
        margin: 8px 0 10px;
        font-size: 13px;
        line-height: 1.2;
    }

    .quiz-step {
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding: 12px;
        border-radius: 8px;
    }

    .quiz-step h3,
    #quiz-form-container h3 {
        font-size: 18px;
        line-height: 1.25;
        margin: 0 0 10px;
    }

    .quiz-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .quiz-option {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 8px;
    }

    .quiz-option img {
        width: 86px;
        height: 72px;
        object-fit: contain;
    }

    .quiz-option p {
        font-size: 12px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .quiz-option div[style*="width: 100px"] {
        width: 100% !important;
        height: 44px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
        font-size: 12px;
        line-height: 1.15;
    }

    .quiz-color-swatch {
        width: 44px;
        height: 44px;
    }

    .next-button {
        align-self: stretch;
        width: 100%;
        margin-top: 12px;
        padding: 11px 16px;
        font-size: 15px;
    }

    .quiz-dimensions-layout {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    .quiz-dimensions-image img {
        max-width: 110px;
    }

    .quiz-step[data-step="length-width"] input {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px;
    }

    #quiz-form-container {
        max-height: none;
        overflow: visible;
        padding: 12px;
        border-radius: 8px;
    }

    #contact-form {
        margin-top: 8px;
    }

    #contact-form input {
        width: 100%;
        max-width: none;
        margin: 8px 0;
    }

    #contact-form button,
    #quiz-form-container button {
        max-width: none;
        width: 100%;
    }

    .quiz-consent {
        max-width: none !important;
        margin: 10px auto 8px !important;
        font-size: 12px;
        text-align: left;
    }
}

.quiz-consent .form-check {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start !important;
    gap: 10px !important;
}

.quiz-consent .form-check-input {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex: 0 0 18px !important;
    padding: 0 !important;
    margin: 2px 0 0 !important;
}

.quiz-consent .form-check-label {
    text-align: left;
    line-height: 1.35 !important;
}

@media (min-width: 1201px) and (max-width: 1512px) {
    #quiz .heading,
    .heading#quiz {
        margin-bottom: 18px;
    }

    #quiz-container {
        font-size: 14px;
    }

    .custom-progress-bar {
        height: 14px;
    }

    #progress-text {
        margin: 8px 0 10px;
        font-size: 14px;
        line-height: 1.2;
    }

    .quiz-step {
        min-height: 300px;
        max-height: calc(100vh - 190px);
        padding: 14px;
    }

    .quiz-step h3,
    #quiz-form-container h3 {
        font-size: 20px;
        line-height: 1.25;
        margin-bottom: 10px;
    }

    .quiz-list {
        max-height: calc(100vh - 335px);
    }

    .quiz-option {
        margin: 6px;
        padding: 8px;
        width: 132px;
        max-width: 132px;
        vertical-align: top;
    }

    .quiz-option img {
        width: 78px;
        height: 78px;
    }

    .quiz-option p {
        font-size: 13px;
    }

    .quiz-color-swatch {
        width: 46px;
        height: 46px;
    }

    .quiz-step-colors .quiz-list,
    .quiz-step:has(.quiz-color-swatch) .quiz-list {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        max-height: none;
        overflow: visible;
    }

    .quiz-step-colors .quiz-option,
    .quiz-step:has(.quiz-color-swatch) .quiz-option,
    .quiz-option-color {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 8px 6px;
    }

    .next-button,
    #quiz-form-container button {
        padding: 9px 18px;
        margin-top: 10px;
    }

    .quiz-step[data-step="length-width"] img {
        max-height: 170px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }

    #quiz-form-container {
        max-height: calc(100vh - 190px);
        padding: 14px;
    }

    #contact-form {
        margin-top: 8px;
    }

    #contact-form input {
        margin: 6px 0;
        padding: 8px 10px;
    }

    .quiz-consent {
        margin-top: 10px !important;
        margin-bottom: 8px !important;
        font-size: 13px;
    }
}

@media (max-height: 760px) and (min-width: 992px) {
    .quiz-step,
    #quiz-form-container {
        max-height: calc(100vh - 150px);
    }

    .quiz-list {
        max-height: calc(100vh - 285px);
    }

    .quiz-option img {
        width: 68px;
        height: 68px;
    }

    .quiz-step h3,
    #quiz-form-container h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
}
