/* Модальное окно */
:root {
  /* Contrast Ratio к белому CRW и к черному CRB */
  --elab--background--color: #ffffff; /* #ebebeb; */ 
  --bg--primary--rgb: rgba(255, 255, 255, 1);
  --bg--secondary: #e9e9e9;
  
  --primary--color: #0baaa9; /* #1876da;*/
  --elab--primary--color: #0baaa9; /* #1876da;*/
  --primary--color--cr: #066362; /* Контраст >7 white */
  --elab--primary--color--cr: #066362; /* Контраст >7 white */
  --secondary--color: #059392; /* #05cddf; /* #00d1e2; */
  --elab--secondary--color: #059392; /* #05cddf; /* #00d1e2; */
  --elab--color--fc: #059392; /* #05cddf; /* CRW=1.87:1 CRB=11.21:1 */
  
  --elab--color--b: #059392; /* #0baaa9; /* #1876da; */ /* CRW=2.86:1 CRB=7.33:1 */

  --elab--color--b--cr: #088382; /* Контраст >4.5 */
  --elab--color--c: #0dc8c7; /* #00d1e2; */
  --elab--color--d: #059392; /* #00d1e2; */ /* CRW=2.07:1 CRB=10.1:1 */
  --elab--color--f: #068484; /* #00d1e2; */ /* CRW=4.52:1 CRB=4.64:1 */
  --elab--color--hover: #059392;

  --elab--color--content--p: #555; /* CRW=2.81:1 CRB=7.45:1 */
  --elab--color--warning: #dfefff; /* CRW=1.17:1 CRB=17.92:1 */
  --elab--color--boxshadow: #ccc; /* CRW=1.6:1 CRB=13.7:1 */
  --elab--color--red: #d63d1f; /* Ratio Cintrast 4.61:1 с белым #fff */
  --elab--color--yellow: #ffd700; /* CRW=1.4:1 CRB=14.97:1 */
  --elab--color--tab: #e8eff0;
  --elab--color--black: #000000;
  --elab--color--white: #ffffff;
  --elab--color--blockquote: #444;
  --elab--color--pre: #f0f0f0;
  --elab--color--border: #eee;
  --elab--background--menu: #ebebeb;
  --accent--color: #0baaa9; /* #1876da; */
  --text--color: #262626;
  --text--color--black: #000;
  --text--color--white: #ffffff;
  --light--text: #777; /* CRW=4.47:1 CRB=4.68:1 */
  --primary--light: #666;
  --background--light: #f9f9f9;
  --border--color: #e0e0e0;
  /* Переменные для футера */
  --footer--text: #000;
  --footer--border: rgba(255, 255, 255, 0.1); /* белый */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* черный */
  --shadow--color: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --border--radius: 12px;
  --elab--cart--button--bg: #1876da;
  --elab--cart--button--color: white;
}

.similar-modal {
    display: none;
    position: fixed;
    top: 2vh;
    left: 10vw;
    width: 80vw;
    height: 90vh;
    background: var(--bg--primary--rgb);
    z-index: 1000;
    box-shadow: 0 0 20px var(--shadow--color);
    overflow: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border: 5px solid var(--elab--primary--color);
    border-radius: 20px;
}

.similar-modal-content {
    position: relative;
    padding: 20px;
}

.similar-close {
    position: sticky;
    float: right;
    right: 1.25rem;
    top: 1.25rem;
    cursor: pointer;
    background-color: var(--elab--primary--color);
    color: var(--text--color--white);
    border-radius: 50%;
    z-index: 1000;
    width: 3.125rem;
    height: 3.125rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.125rem; 
}
.similar-products-list {
    margin-top: 60px;
    overflow-y: auto;
/*    height: calc(100vh - 60px);*/
    text-align: center;
}

.similar-products-btn {
    padding: 4px 10px 4px 0;
    background-color: var(--bg--secondary);
    color: var(--text--color-black);
    border: none;
    cursor: pointer;
    width: fit-content;
}

/* Адаптация карточек товаров */
.similar-modal .products {
/*    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    */
    gap: 20px;
    margin-top: 40px;
}

.similar-modal .product {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px;
}
h2#similar-h2{
    text-align: center;
}
/* Стили лоадера */
.similar-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid var(--bg--secondary);
    border-top: 4px solid var(--bg--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: var(--light--text);
    font-size: 0.875rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Показываем лоадер при загрузке */
.similar-products-list.loading .similar-loader {
    display: block;
}

/* Затемнение контента при загрузке */
.similar-products-list.loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 99;
}
/* Альтернативный лоадер */
/* Прогресс-бар */
.similar-loader .progress-loader {
    width: 200px;
    height: 4px;
    background: var(--bg--secondary);
    margin: 0 auto 15px;
    overflow: hidden;
    border-radius: 2px;
}

.similar-loader .progress-bar {
    width: 0;
    height: 100%;
    background: var(--elab--primary--color);
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* Анимация прогресса */
@keyframes progress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.loading .progress-bar {
    animation: progress 2s infinite;
}

p.search-words {
    font-size: 1.125rem;
    text-align: center;
}
p.search-words span{
    color: var(--elab--color--red);
}
.similar-products-icon button{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap:5px;
    border-radius: 8px;
    font-weight: 600;
}
/* Решение для tooltip кнопки Похожие */
.similar-products-icon {
    position: relative;
    display: inline-block;
}


/* Заголовок стиля */
.tooltip-simular h3 {
    margin: 0;
    font-size: 1.75rem;
    margin-bottom: 8px; 
}

/* Параграф стиля */
.tooltip-simular p {
    margin: 0;
    font-size: 0.875rem; 
    line-height: 1.5;
}

.tooltip-simular {
    background-color: var(--elab--background--color);
    color: var(--text--color-black); 
    border-radius: 8px; 
    box-shadow: 0 4px 15px var(--shadow--color);
    z-index: 1000;
    transition: opacity 0.3s ease;
    max-width: 320px;
    width: fit-content;
    top: calc(100% + 8px);
    left: 0;
    padding: 6px 12px;
    font-size: 0.75rem;
    border: 1px solid var(--bg--secondary);
    position: absolute;
}
.tooltip-simular h3{
    white-space: nowrap;
}
@media (max-width: 768px){
    .similar-modal{
        top: 0;
        left: 0;
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
    }
}
/* Стили для inline-отображения */
.similar-products-inline .similar-products-list{
    margin-top: 0;
}

.similar-products-inline .products {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 -15px;
}

.similar-products-inline .products li {
    padding: 0 15px;
    margin-bottom: 30px;
    width: 25%;
    box-sizing: border-box;
}

/* Адаптивность */
@media (max-width: 768px) {
    .similar-products-inline .products li {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .similar-products-inline .products li {
        width: 100%;
    }
}