/* ============================================================
   MINI ADS: AUTHOR + SIMILAR
   Файл: /css/ad-mini.css
   ============================================================ */

.adNewLayout > .adMiniSections{
    grid-column: 1 / -1;
}

.adMiniSections{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 34px 0 0;
    overflow: hidden;
}

.adMiniSection{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 30px;
    overflow: hidden;
}

.adMiniHead{
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 18px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.adMiniHead h2{
    margin: 0;
    color: #002f34;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 750;
    line-height: 1.2;
}

.adMiniHead a{
    color: #002f34;
    font-size: 14px;
    font-weight: 800;
    text-decoration: underline;
    white-space: nowrap;
}

.adMiniGrid{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.adMiniCard{
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 47, 52, .10);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 300px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.adMiniCard:hover{
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    transform: translateY(-1px);
}

.adMiniLink{
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.adMiniImageBox{
    position: relative;
    width: 100%;
    height: 210px;
    background: linear-gradient(180deg, #f4f8f9 0%, #edf3f5 100%);
    border-bottom: 1px solid #e3eaed;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adMiniImageBox img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    background: #f2f4f5;
}

.adMiniImageBox::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,.65) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: translateX(-100%);
    animation: adMiniSkeletonMove 1.2s infinite;
    pointer-events: none;
}

.adMiniImageBox.is-loaded::before,
.adMiniImageBox.is-empty::before{
    display: none;
}

@keyframes adMiniSkeletonMove{
    100%{
        transform: translateX(100%);
    }
}

.adMiniNoImage{
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: #6b8a90;
    font-size: 17px;
    font-weight: 650;
}

.adMiniNoImage svg{
    width: 44px;
    height: 44px;
    fill: #89a5ab;
    opacity: .9;
}

.adMiniBody{
    padding: 12px 12px 8px;
    min-width: 0;
    flex: 1;
}

.adMiniTitle{
    color: #002f34;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adMiniMeta{
    margin-top: 10px;
    display: grid;
    gap: 7px;
    min-width: 0;
}

.adMiniMetaLine{
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(0, 47, 52, .74);
    font-size: 13px;
    line-height: 1.25;
    min-width: 0;
}

.adMiniMetaLine svg{
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.adMiniMetaLine span{
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adMiniBottom{
    padding: 8px 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.adMiniPrice{
    color: #002f34;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adMiniFav{
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: #2d5f64;
    flex: 0 0 auto;
}

.adMiniFav svg{
    width: 24px;
    height: 24px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.adMiniFav.is-active svg{
    fill: currentColor;
}

.adMiniFav.is-loading{
    opacity: .45;
    pointer-events: none;
}

/* Большие экраны / TV */
@media (min-width: 1600px){
    .adMiniImageBox{
        height: 235px;
    }
}

/* Ноутбуки */
@media (max-width: 1200px){
    .adMiniGrid{
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .adMiniImageBox{
        height: 190px;
    }
}

/* Планшеты */
@media (max-width: 980px){
    .adMiniGrid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .adMiniImageBox{
        height: 210px;
    }
}

/* Телефоны: горизонтальный свайп по 2 карточки */
@media (max-width: 767px){
    .adMiniSections{
        margin-top: 26px;
    }

    .adMiniHead h2{
        font-size: 22px;
    }

    .adMiniGrid{
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: calc((100% - 12px) / 2);
        grid-template-columns: unset;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 2px 8px 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .adMiniGrid::-webkit-scrollbar{
        display: none;
    }

    .adMiniCard{
        min-height: 260px;
        scroll-snap-align: start;
    }

    .adMiniImageBox{
        height: 130px;
    }

    .adMiniTitle{
        font-size: 14px;
    }

    .adMiniPrice{
        font-size: 16px;
    }
}

/* Маленькие телефоны */
@media (max-width: 520px){
    .adMiniHead{
        gap: 12px;
    }

    .adMiniHead a{
        font-size: 13px;
    }

    .adMiniGrid{
        grid-auto-columns: calc((100% - 10px) / 2);
        gap: 10px;
    }

    .adMiniImageBox{
        height: 118px;
    }

    .adMiniBody{
        padding: 10px 10px 6px;
    }

    .adMiniBottom{
        padding: 7px 10px 10px;
    }

    .adMiniTitle{
        font-size: 13px;
    }

    .adMiniMetaLine{
        font-size: 12px;
    }

    .adMiniPrice{
        font-size: 15px;
    }
}

/* Очень узкие телефоны: лучше одна карточка */
@media (max-width: 360px){
    .adMiniGrid{
        grid-auto-columns: 76%;
    }

    .adMiniImageBox{
        height: 150px;
    }
}


