/* ============================================================
   main_page.css — стилі ТІЛЬКИ для головної сторінки
   bodyClass: page-main
   ============================================================ */

.page-main h1,
.page-main h2,
.page-main h3,
.page-main .set-card-title,
.page-main .new-arrivals-header h2,
.page-main .pnp-col-title,
.page-main .brand-slider-title,
.page-main .section-title {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    padding-top: 0.15em;
}


/* ============================================================
   home.css — стилі головної сторінки (main_pages.php)
   Підключати після menu.css і main.css
   ============================================================ */

/* ── Базовий відступ між секціями ── */
.carousel_m,
.new-arrivals-wrapper,
.sets-wrapper,
.pnp-wrapper,
.brand-slider-wrapper {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto clamp(28px, 3vw, 52px);
    padding: 0 clamp(12px, 3vw, 40px);
    box-sizing: border-box;
}
.carousel_m { padding: 0; max-width: 100%; }

/* ──────────────────────────────────────────
   БАНЕР-КАРУСЕЛЬ
────────────────────────────────────────── */
.banner-img {
    width: 100%;
    max-height: clamp(200px, 38vw, 540px);
    object-fit: cover;
    display: block;
}

/* ──────────────────────────────────────────
   ЩО НОВОГО — двоколонний layout: фото + каруселі карток
────────────────────────────────────────── */
.new-arrivals-layout {
    display: grid;
    grid-template-columns: clamp(180px, 30%, 360px) 1fr;
    gap: clamp(12px, 2vw, 28px);
    align-items: start;
}

/* Ліва колонка — фото на всю висоту блока */
.new-arrivals-layout {
    align-items: stretch;
}
.new-arrivals-hero {
    border-radius: var(--radius-card);
    overflow: hidden;
    height: 100%;
    min-height: 200px;
    box-shadow: var(--shadow-card);
}
.new-arrivals-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Права частина */
.new-arrivals-main { min-width: 0; }

/* Заголовок + стрілки */
.new-arrivals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(10px, 1.2vw, 18px);
}
.new-arrivals-header h2 {
    font-size: clamp(20px, 2vw, 30px);
    font-weight: 500;
    font-style: italic;
    margin: 0;
}
.new-arrivals-nav {
    display: flex;
    gap: 8px;
}
.new-arrivals-nav button {
    width: clamp(28px, 2.5vw, 38px);
    height: clamp(28px, 2.5vw, 38px);

    border-radius: 50%;
    border: 1.5px solid var(--ink);
    background: var(--paper);
    color: var(--ink);

    cursor: pointer;
    padding: 0;
    margin: 0;

    /* ідеальний центр */
    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 0;
    text-align: center;
    box-sizing: border-box;

    transition:
        background var(--fast) var(--ease),
        color var(--fast) var(--ease),
        border-color var(--fast) var(--ease);
}
.new-arrivals-nav button span {
    display: block;

    /* прибираємо зміщення символу по висоті */
    line-height: 1;
    height: 1em;

    font-size: clamp(16px, 1.5vw, 22px);
    font-family: Arial, sans-serif;
    font-weight: 400;

    /* маленька корекція саме для символів ‹ › */
    transform: translateY(-1px);
}
.new-arrivals-nav button:hover:not(:disabled) {
    background: var(--rose);
    border-color: var(--rose);
    color: var(--paper);
}
.new-arrivals-nav button:disabled { opacity: 0.35; cursor: default; }

/* Карусельний контейнер */
.new-arrivals-carousel {
    overflow: hidden;
    border-radius: 12px;
    padding: 10px 2px 16px;
    margin: -10px -2px -16px;
}
.new-arrivals-track {
    display: flex;
    gap: clamp(8px, 1vw, 14px);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* Одна «сторінка» — 6 карток у 3×2 сітку */
.new-arrivals-page {
    /* Одна колонка слайдера = 2 товари один під одним */
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto);
    gap: clamp(8px, 1vw, 14px);

    /* На ПК одночасно видно 3 колонки: 1-2-3 */
    flex: 0 0 calc((100% - (2 * clamp(8px, 1vw, 14px))) / 3);
    width: calc((100% - (2 * clamp(8px, 1vw, 14px))) / 3);
    align-items: start;
}

/* ── Картка товару (новинки) ── */
.product-card-item {
    position: relative;
    background: var(--paper);
    border-radius: var(--radius-card-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
}
.product-card-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

/* Прозоре посилання на всю картку */
.product-card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* Зображення */
.product-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--rose-tint);
}
.product-image-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.product-card-item:hover .product-image-wrap img { transform: scale(1.04); }
.product-image-wrap > div { /* "Немає фото" */
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-faint); font-size: 11px;
}

/* Бейджі на фото */
.product-badges {
    position: absolute;
    top: 6px; left: 6px;
    display: flex; flex-direction: column; gap: 3px;
    z-index: 2;
}
.badge-discount {
    background: var(--rose);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: clamp(10px, 0.72vw, 12px);
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--radius-pill);
    padding: 3px 9px;
}
.badge-sold {
    background: var(--ink);
    color: var(--porcelain);
    font-family: var(--font-mono);
    font-size: clamp(9px, 0.66vw, 11px);
    font-weight: 500;
    border-radius: var(--radius-pill);
    padding: 3px 8px;
}

/* Серце вподобань */
.wishlist-heart {
    position: static !important;
    top: unset !important;
    right: unset !important;
    z-index: 3 !important;
    flex-shrink: 0;
    width: clamp(26px, 2.2vw, 34px) !important;
    height: clamp(26px, 2.2vw, 34px) !important;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-heart-svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--rose-deep);
    stroke-width: 1.8;
    transition: fill 0.18s, stroke 0.18s;
}
.wishlist-heart.active .wishlist-heart-svg,
.wishlist-heart:hover .wishlist-heart-svg {
    fill: var(--rose-deep);
    stroke: var(--rose-deep);
}

/* Рядок назва + серце збоку */
.product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    padding: clamp(6px, 0.8vw, 10px) clamp(8px, 0.9vw, 12px) 0;
    position: relative;
    z-index: 3;
}

/* Назва + ціна + кнопка */
.product-title {
    padding: 0 0 2px;
    font-size: clamp(11px, 0.85vw, 14px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    display: -webkit-box;

    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-block {
    padding: 2px clamp(8px, 0.9vw, 12px) 4px;
    font-size: clamp(12px, 0.95vw, 15px);
    font-weight: 700;
    color: var(--rose-deep);
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}
.product-price-block .price-old {
    color: var(--ink-faint);
    text-decoration: line-through;
    font-weight: 400;
    font-size: clamp(10px, 0.8vw, 13px);
}

/* Кнопка "Купити" / "Немає в наявності" у картці */
.product-card-item .btn-buy {
    margin: 4px clamp(8px, 0.9vw, 12px) clamp(8px, 0.9vw, 12px);
    padding: clamp(5px, 0.5vw, 8px) clamp(10px, 1.1vw, 16px);
    font-size: clamp(11px, 0.8vw, 13px);
    font-weight: 600;
    background: var(--ink);
    color: var(--porcelain);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    position: relative;
    z-index: 3;
    transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
    align-self: flex-start;
    white-space: nowrap;
}
.product-card-item .btn-buy:hover:not(:disabled) { background: var(--rose); transform: translateY(-1px); }
.product-card-item .btn-buy:disabled {
    background: var(--line);
    color: var(--ink-faint);
    cursor: default;
}

/* ──────────────────────────────────────────
   SETS — два банери поруч
────────────────────────────────────────── */
.sets-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(10px, 1.5vw, 20px);
}
.set-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    display: block;
    aspect-ratio: 16 / 7;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.set-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.set-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.set-card-text {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: clamp(12px, 1.8vw, 24px);
    background: linear-gradient(to top, rgba(36,23,20,.72), rgba(36,23,20,.15) 65%, transparent);
}
.set-card-subtitle {
    font-family: var(--font-mono);
    color: var(--bronze-tint);
    font-size: clamp(10px, 0.75vw, 12px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.set-card-title {
    color: var(--porcelain);
    font-size: clamp(16px, 1.5vw, 24px);
    font-weight: 500;
    font-style: italic;
}

/* ──────────────────────────────────────────
   PNP — три колонки
────────────────────────────────────────── */
.pnp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2vw, 28px);
}
.pnp-col-title {
    font-family: var(--font-display);
    font-size: clamp(16px, 1.4vw, 21px);
    font-weight: 600;
    font-style: italic;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: clamp(8px, 1vw, 14px);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

/* Рядок товару в PNP */
.pnp-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 14px);
    padding: clamp(6px, 0.7vw, 10px) 0;
    border-bottom: 1px solid var(--sand-deep);
}
.pnp-item:last-child { border-bottom: none; }

/* Серце в PNP — праворуч від інфо-блоку */
.pnp-item > .wishlist-heart {
    margin-left: auto;
    flex-shrink: 0;
}

.pnp-item-photo {
    flex-shrink: 0;
    width: clamp(48px, 5vw, 68px);
    height: clamp(48px, 5vw, 68px);
    border-radius: 10px;
    overflow: hidden;
    background: var(--rose-tint);
    position: relative;
}
.pnp-item-photo img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.pnp-item-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 3px;
}
.pnp-item-name {
    font-size: clamp(11px, 0.85vw, 14px);
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.pnp-item-name a { color: var(--ink); text-decoration: none; }
.pnp-item-name a:hover { color: var(--rose-deep); }

.pnp-item-price {
    font-family: var(--font-mono);
    font-size: clamp(12px, 0.9vw, 15px);
    font-weight: 500;
    color: var(--rose);
}
.pnp-item-price .old {
    color: var(--ink-faint);
    text-decoration: line-through;
    font-weight: 400;
    font-size: clamp(10px, 0.8vw, 12px);
    margin-right: 4px;
}

.pnp-item-info .btn-buy {
    padding: clamp(4px, 0.4vw, 7px) clamp(10px, 1vw, 16px);
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 600;
    background: var(--ink);
    color: var(--porcelain);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    align-self: flex-start;
    transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
    white-space: nowrap;
}
.pnp-item-info .btn-buy:hover:not(:disabled) { background: var(--rose); transform: translateY(-1px); }
.pnp-item-info .btn-buy:disabled {
    background: var(--line); color: var(--ink-faint); cursor: default;
}

/* ──────────────────────────────────────────
   БРЕНД-СЛАЙДЕР
────────────────────────────────────────── */
.brand-slider-wrapper {
    margin-bottom: clamp(20px, 3vw, 48px);
    background: var(--sand);
    border-radius: var(--radius-card);
    padding: clamp(16px, 2.5vw, 36px) clamp(12px, 3vw, 40px);
}

.brand-slider-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(20px, 2vw, 30px);
    font-weight: 500;
    font-style: italic;
    color: var(--ink);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: clamp(12px, 1.5vw, 22px);
    padding-bottom: 10px;
}

.brand-slider-track {
    display: flex;
    gap: clamp(10px, 1.5vw, 20px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    justify-content: center;
    flex-wrap: wrap;
}
.brand-slider-track::-webkit-scrollbar { display: none; }

.brand-slider-card {
    scroll-snap-align: start;
    flex: 0 0 clamp(100px, 14vw, 170px);
    border-radius: var(--radius-card-sm);
    overflow: hidden;
    display: block;
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease), border-color var(--med) var(--ease);
}
.brand-slider-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--rose);
}

.brand-slider-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--paper);
}
.brand-slider-img-wrap img {
    position: absolute;
    inset: 10px; /* відступ з усіх боків прямо на картинці — гарантує, що вона ніколи не вилізе за межі квадратної рамки */
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    object-fit: contain; display: block; /* contain — щоб фото товару вміщалось повністю, без обрізання */
}
.brand-slider-img-wrap .no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-faint); font-size: 11px;
    background: var(--rose-tint);
}

/* ──────────────────────────────────────────
   АДАПТИВ — ≤ 900px: планшети
────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Новинки — фото прибираємо, картки у повну ширину */
    .new-arrivals-layout {
        grid-template-columns: 1fr;
    }
    .new-arrivals-hero { display: none; }
    .new-arrivals-page { grid-template-columns: 1fr; }

    /* PNP — 1 колонка з горизонтальним скролом */
    .pnp-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .pnp-col {
        border-bottom: 1px solid var(--sand-deep);
        padding-bottom: clamp(12px, 2vw, 20px);
        margin-bottom: clamp(12px, 2vw, 20px);
    }
    .pnp-col:last-child { border-bottom: none; margin-bottom: 0; }

    /* Sets — стаки вертикально */
    .sets-layout { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────
   АДАПТИВ — ≤ 640px: телефони
────────────────────────────────────────── */
@media (max-width: 640px) {
    .new-arrivals-track { gap: 7px; }

    .new-arrivals-page {
        /* На телефоні видно 2 колонки = рівно 4 товари (2×2) */
        flex-basis: calc((100% - 7px) / 2);
        width: calc((100% - 7px) / 2);
        grid-template-columns: 1fr;
        gap: 7px;
    }
    .pnp-item-photo { width: 44px; height: 44px; }
    .brand-slider-card { flex: 0 0 clamp(80px, 26vw, 120px); }
}

/* ──────────────────────────────────────────
   АДАПТИВ — ≤ 420px: дуже маленькі
────────────────────────────────────────── */
@media (max-width: 420px) {
    .new-arrivals-track { gap: 5px; }

    .new-arrivals-page {
        flex-basis: calc((100% - 5px) / 2);
        width: calc((100% - 5px) / 2);
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .product-title { font-size: 11px; }
    .product-price-block { font-size: 12px; }
    .product-card-item .btn-buy { font-size: 10px; padding: 4px 8px; }
}

/* ──────────────────────────────────────────
   АДАПТИВ — ≥ 1441px: великі монітори
────────────────────────────────────────── */
@media (min-width: 1441px) {
    .new-arrivals-page { grid-template-columns: 1fr; }
    .pnp-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 2561px) {
    .new-arrivals-layout { grid-template-columns: clamp(240px, 28%, 520px) 1fr; }
    .new-arrivals-page { grid-template-columns: 1fr; gap: 24px; }
    .pnp-item-photo { width: 100px; height: 100px; }
    .brand-slider-card { flex: 0 0 clamp(180px, 12vw, 280px); }
}

@media (min-width: 3841px) {
    .new-arrivals-page { grid-template-columns: 1fr; gap: 40px; }
    .product-title { font-size: 24px; }
    .product-price-block { font-size: 26px; }
    .product-card-item .btn-buy { font-size: 22px; padding: 14px 24px; border-radius: 12px; }
    .pnp-item-photo { width: 150px; height: 150px; }
    .pnp-item-name { font-size: 22px; }
    .pnp-item-price { font-size: 26px; }
    .pnp-item-info .btn-buy { font-size: 20px; padding: 10px 22px; }
    .brand-slider-card { flex: 0 0 clamp(300px, 10vw, 460px); }
    .set-card-title { font-size: 36px; }
    .set-card-subtitle { font-size: 24px; }
}