/* Блок «Действующие акции» — слайдер (block-top-gifts).
   Карточки в стиле популярных услуг: формат сториз (9:16), фото, нестандартные
   блики (сияние, блик-полоса, искры), плашка скидки/подарка и затемнённая
   подложка снизу с фиксированными слотами — тексты выровнены между карточками. */

.gifts-block {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.gifts-slider-wrapper {
    position: relative;
    padding: 20px 0;
    margin: 0 -20px; /* Компенсируем padding контейнера */
}

.gifts-swiper {
    padding: 20px 20px 30px;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
    z-index: 2;
    width: 100%;
}

.gifts-swiper::-webkit-scrollbar {
    display: none;
}

.gifts-swiper .swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    height: auto;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* --- Карточка: пропорции сториз 9:16, как у карточек услуг --- */
.gift-card {
    position: relative;
    width: 320px;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
    background: #fff;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.gift-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gift-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.gift-card:hover .gift-image > img {
    transform: scale(1.05);
}

/* --- Нестандартный блик: диагональная полоса-отсвет, гуляющая по карточке --- */
.gift-card::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    z-index: 6;
    width: 45%;
    height: 220%;
    pointer-events: none;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(18deg);
    animation: giftSheen 6.5s ease-in-out infinite;
}

/* --- Нестандартный блик: мягкое сияние по карточке --- */
.gift-card__glow {
    position: absolute;
    inset: -30%;
    z-index: 1;
    pointer-events: none;
    opacity: .5;
    filter: blur(12px);
    background:
        radial-gradient(circle at 74% 16%, rgba(126, 200, 255, .55), transparent 52%),
        radial-gradient(circle at 16% 84%, rgba(255, 214, 128, .45), transparent 55%);
    animation: giftGlow 8s ease-in-out infinite;
}

/* --- Нестандартный блик: мерцающие искры --- */
.gift-card__sparkles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.gift-card__sparkles i {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, .85);
    animation: giftTwinkle 3.4s ease-in-out infinite, giftFloat 6s ease-in-out infinite;
}

.gift-card__sparkles i::before,
.gift-card__sparkles i::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1px;
    margin: -0.5px 0 0 -5px;
    border-radius: 1px;
    background: rgba(255, 255, 255, .85);
}

.gift-card__sparkles i::after {
    transform: rotate(90deg);
}

.gift-card__sparkles i:nth-child(1) { top: 9%; right: 18%; animation-delay: 0s, 0s; }
.gift-card__sparkles i:nth-child(2) { top: 30%; right: 46%; animation-delay: .9s, 1.2s; }
.gift-card__sparkles i:nth-child(3) { top: 52%; right: 12%; animation-delay: 1.7s, .6s; }
.gift-card__sparkles i:nth-child(4) { top: 68%; right: 60%; animation-delay: 2.4s, 1.8s; }

@keyframes giftSheen {
    0% { left: -80%; }
    55%, 100% { left: 140%; }
}

@keyframes giftGlow {
    0%, 100% { opacity: .4; transform: scale(1) rotate(0deg); }
    50% { opacity: .75; transform: scale(1.12) rotate(8deg); }
}

@keyframes giftTwinkle {
    0%, 100% { opacity: 0; transform: scale(.5); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes giftFloat {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -6px; }
}

/* --- Плашка со скидкой или подарком --- */
.gift-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    max-width: 80%;
    padding: 6px 12px;
    border-radius: 4px;
    background: #FF7F00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

/* --- Затемнённая подложка: фиксированные слоты, отступы между текстами убраны --- */
.gift-content-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0;
    height: 236px;
    padding: 18px;
    color: #fff;
    text-align: right;
    background: linear-gradient(to top, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .6) 58%, transparent 100%);
}

.gift-title {
    display: -webkit-box;
    min-height: 45px;
    margin: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.32;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .5);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gift-title a {
    color: #fff;
    text-decoration: none;
}

.gift-title a:hover {
    color: #fff;
    text-decoration: underline;
}

.gift-description {
    display: -webkit-box;
    min-height: 39px;
    margin: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .85);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gift-description p {
    margin: 0;
    padding: 0;
}

.gift-description br {
    display: none;
}

/* --- Срок и условие --- */
.gift-meta {
    display: flex;
    min-height: 34px;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.gift-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .9);
}

.gift-meta__item i {
    color: #7EC8FF;
}

/* --- Цены: старая (зачёркнутая) и новая --- */
.gift-prices {
    display: flex;
    min-height: 28px;
    align-items: baseline;
    justify-content: flex-end;
    gap: 10px;
}

.gift-price--old {
    font-size: 14px;
    color: rgba(255, 255, 255, .6);
}

.gift-price--new {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

/* --- Кнопка карточки: две трети ширины, прижата к правому краю --- */
.gift-button {
    position: relative;
    display: block;
    width: 66.6667%;
    margin: 0 0 0 auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 2px;
    background: #1BA3D5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .3s ease;
}

.gift-button:hover {
    background: #1589b4;
    color: #fff;
    text-decoration: none;
}

/* --- Голубая кнопка «Все акции» под слайдером --- */
.gift-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 32px;
    border-radius: 10px;
    background: #1BA3D5;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.gift-all-btn:hover {
    background: #1289b6;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(27, 163, 213, .26);
    text-decoration: none !important;
}

/* Частичный показ следующего слайда */
.gifts-swiper .swiper-slide {
    width: 320px !important;
    opacity: .7;
    transition: opacity .3s ease;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.gifts-swiper .swiper-slide-active {
    opacity: 1;
}

.gifts-swiper .swiper-slide-next {
    opacity: .9;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gifts-slider-wrapper {
        margin: 0 -15px;
    }

    .gifts-swiper {
        padding: 15px 15px 25px;
    }

    .gift-card {
        width: 280px;
    }

    .gifts-swiper .swiper-slide {
        width: 280px !important;
    }

    .gift-content-overlay {
        height: 220px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .gifts-slider-wrapper {
        margin: 0 -10px;
    }

    .gifts-swiper {
        padding: 10px 10px 20px;
    }

    .gift-card {
        width: 260px;
    }

    .gifts-swiper .swiper-slide {
        width: 260px !important;
    }

    .gift-content-overlay {
        height: 210px;
        padding: 14px;
    }

    .gift-title {
        min-height: 42px;
        font-size: 15px;
    }

    .gift-price--new {
        font-size: 19px;
    }

    .gift-button {
        font-size: 13px;
    }
}

/* Исправления для мобильных устройств */
@media (hover: none) and (pointer: coarse) {
    .gift-card:hover .gift-image > img {
        transform: none;
    }

    .gifts-swiper {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}

/* Исправление для Samsung Internet Browser */
@media (-webkit-touch-callout: none) {
    .gifts-swiper {
        -webkit-overflow-scrolling: auto !important;
    }

    .gift-card {
        -webkit-transform: none;
        transform: none;
    }
}

/* Бережём пользователей, отключивших анимацию */
@media (prefers-reduced-motion: reduce) {
    .gift-image > img {
        transition: none;
    }

    .gift-card::after,
    .gift-card__glow,
    .gift-card__sparkles i {
        animation: none;
    }
}
