/* ============================================================
   БЛОК PRODUCTS («Наші продукти», карусель продуктів)
   Підключення:
   <link rel="stylesheet" type="text/css" href="{{ asset('public/assets\css\frontend\New_website\products.css') }}">
   Потрібен також скрипт:
   <script src="{{ asset('assets\js\website\products.js') }}"></script>

   Брейкпоінти:
   - ПК (за замовчуванням)          > 1440px
   - ноутбук / планшет альбомний    <= 1440px
   - планшет портретний             <= 1024px
   - телефон                        <= 768px
   ============================================================ */

.body-products {
    position: relative;
    width: 100%;
    max-width: 1920px;
    background-color: #FFFFFF;
    overflow: hidden;
    display: flex;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
    padding: 70px 0 90px;

    /* геометрія каруселі */
    --card-w: 390px;        /* ширина картки */
    --gap: 34px;            /* відстань між картками */
    --collapsed-h: 134px;   /* висота згорнутої картки */
    --active-h: 366px;      /* висота активної (розгорнутої) картки */
}

.products-container {
    position: relative;
    width: 100%;
    max-width: 1386px;
    z-index: 1;
}

/* ---------- заголовок ---------- */

.products-title {
    margin: 0 0 40px;
    font-weight: 800;
    font-size: 28px;
    line-height: 34px;
    color: #071F57;
}

.products-title-accent { color: #1D93FF; }

/* ---------- величезний напис-вотермарка ---------- */

.products-watermark {
    position: absolute;
    left: calc(var(--card-w) + var(--gap));
    bottom: -6px;
    font-weight: 800;
    font-size: 86px;
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #E8F4FF;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ---------- карусель ---------- */

.products-carousel {
    position: relative;
    height: var(--active-h);
    z-index: 1;
}

.product-card {
    position: absolute;
    top: 0;
    width: var(--card-w);
    height: var(--collapsed-h);
    box-sizing: border-box;
    padding: 28px 30px;
    border-radius: 16px;
    background: #FFFFFF;
    border: 1px solid #2A90FF;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;

    /* за замовчуванням картка схована праворуч за межами */
    left: calc(100% + 80px);
    opacity: 0;
    pointer-events: none;

    transition:
            left 0.5s ease,
            height 0.45s ease,
            background-color 0.35s ease,
            border-color 0.35s ease,
            opacity 0.35s ease,
            box-shadow 0.25s ease;
}

/* позиції в каруселі (виставляє products.js) */
.product-card[data-pos="-1"] { left: calc(-1 * (var(--card-w) + var(--gap))); opacity: 1; pointer-events: all; }
.product-card[data-pos="0"]  { left: 0;                                       opacity: 1; pointer-events: all; }
.product-card[data-pos="1"]  { left: calc(1 * (var(--card-w) + var(--gap)));  opacity: 1; pointer-events: all; }
.product-card[data-pos="2"]  { left: calc(2 * (var(--card-w) + var(--gap)));  opacity: 1; pointer-events: all; }
.product-card[data-pos="3"]  { left: calc(3 * (var(--card-w) + var(--gap)));  opacity: 1; pointer-events: all; }

/* крайні картки «розчиняються» до краю, як у макеті:
   маска плавно зводить картку в прозорість */
.product-card--edge-left {
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 95%);
    mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 95%);
    pointer-events: none !important;
}

.product-card--edge-right {
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 95%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 95%);
    pointer-events: none !important;
}

/* підсвічування — ТІЛЬКИ при наведенні на звичайну картку */
.product-card:not(.product-card--active):not(.product-card--edge-left):not(.product-card--edge-right):hover {
    border-color: #2A90FF;
    box-shadow:
            0 0 18px rgba(42, 144, 255, 0.35),
            0 0 44px rgba(42, 144, 255, 0.15);
}

/* ---------- шапка картки: іконка + назва ---------- */

.product-card-head {
    display: flex;
    align-items: center;
    gap: 20px;
}

.product-card-icon {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #C9EFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.35s ease;
}

/* PNG-іконки — квадрат на чорному тлі, тому
   обрізаємо їх у коло через border-radius */
.product-card-icon img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: block;
}

.product-card-title {
    margin: 0;
    font-weight: 700;
    font-size: 22px;
    line-height: 28px;
    color: #071F57;
    transition: color 0.35s ease;
}

/* ---------- тіло картки (видно тільки в активної) ---------- */

.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
    pointer-events: none;
}

.product-card-body p {
    margin: 26px 0 0;
    font-weight: 500;
    font-size: 20px;
    line-height: 30px;
    color: #FFFFFF;
}

.product-card-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 30px;
    border-radius: 22px;
    background: #FFA014;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    line-height: 18px;
    text-decoration: none;
    transition: background 0.2s;
}

.product-card-btn:hover { background: #FF9100; }

/* крапки-пагінація (Group_781.png — світлі крапки на сірому тлі,
   тому screen: тло зникає, лишаються крапки) */
.product-card-dots {
    width: 44px;
    height: auto;
    mix-blend-mode: screen;
    opacity: 0.9;
}

/* ---------- активна (розгорнута) картка ---------- */

.product-card--active {
    height: var(--active-h);
    background: #2A90FF;
    border-color: #2A90FF;
    cursor: default;
}

.product-card--active .product-card-title { color: #FFFFFF; }

.product-card--active .product-card-icon { background: rgb(255 255 255); }

.product-card--active .product-card-body {
    opacity: 1;
    pointer-events: all;
}

/* ---------- навігація Назад / Далі ---------- */

.products-nav {
    position: absolute;
    top: calc(var(--collapsed-h) + 32px);
    left: calc(var(--card-w) + var(--gap));
    display: flex;
    align-items: center;
    gap: 36px;
    z-index: 3;
}

.products-nav-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(18, 22, 51, 0.45);
    padding: 4px 0;
    width: 100px;
    height: 40px;
    border-bottom: 1.5px solid rgba(18, 22, 51, 0.2);
    transition: color 0.2s, border-color 0.2s;
    letter-spacing: 0.3px;
}

.products-nav-btn:hover { color: rgba(18, 22, 51, 1);
    border-bottom: 1.5px solid #E8A824;
    font-weight: 600;
}



/* ============================================================
   НОУТБУК / ПЛАНШЕТ АЛЬБОМНИЙ  (<= 1440px)
   ============================================================ */
@media (max-width: 1440px) {

    .body-products {
        padding: 56px 32px 72px;
        --card-w: 340px;
        --gap: 24px;
        --collapsed-h: 120px;
        --active-h: 340px;
    }

    .products-title { font-size: 26px; margin-bottom: 32px; }

    .products-watermark { font-size: 64px; }

    .product-card { padding: 24px 26px; }
    .product-card-icon { width: 52px; height: 52px; }
    .product-card-icon img { width: 40px; height: 40px; }
    .product-card-title { font-size: 19px; line-height: 25px; }
    .product-card-body p { font-size: 17px; line-height: 26px; margin-top: 20px; }
}

/* ============================================================
   ПЛАНШЕТ ПОРТРЕТНИЙ  (<= 1024px)
   ============================================================ */
@media (max-width: 1024px) {

    .body-products {
        padding: 44px 24px 60px;
        --card-w: 300px;
        --gap: 18px;
        --collapsed-h: 104px;
        --active-h: 320px;
    }

    .products-title { font-size: 24px; line-height: 30px; margin-bottom: 24px; }

    .products-watermark { font-size: 44px; bottom: -4px; }

    .product-card { padding: 20px 22px; border-radius: 14px; }
    .product-card-icon { width: 46px; height: 46px; gap: 14px; }
    .product-card-icon img { width: 36px; height: 36px; }
    .product-card-title { font-size: 17px; line-height: 22px; }
    .product-card-body p { font-size: 15px; line-height: 23px; margin-top: 16px; }
    .product-card-btn { padding: 10px 24px; font-size: 13px; }
}

/* ============================================================
   ТЕЛЕФОН  (<= 768px)
   Видно одну активну картку, сусідні визирають з країв,
   навігація — по центру під каруселлю
   ============================================================ */
@media (max-width: 768px) {

    .body-products {
        padding: 36px 16px 48px;
        --card-w: calc(100vw - 90px);
        --gap: 14px;
        --collapsed-h: 92px;
        --active-h: 330px;
    }

    .products-title { font-size: 20px; line-height: 26px; margin-bottom: 20px; }

    .products-watermark {
        left: 0;
        font-size: 30px;
        bottom: 54px; /* над навігацією */
    }

    /* згорнуті картки на телефоні теж показують лише шапку */
    .product-card { padding: 18px; }
    .product-card-title { font-size: 15px; line-height: 20px; }
    .product-card-body p { font-size: 14px; line-height: 21px; }

    /* навігація по центру під каруселлю */
    .products-nav {
        top: auto;
        bottom: -64px;
        left: 50%;
        transform: translateX(-50%);
        gap: 24px;
    }

    .products-carousel { margin-bottom: 76px; }

    .products-nav-btn { width: 84px; }
}