/* ============================================================
   product.css — стилі ТІЛЬКИ для сторінки товару
   bodyClass: page-product
   ============================================================ */

.page-product h1,
.page-product h2,
.page-product h3,
.page-product .viewed-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;
}

.page-product .pnp-item-photo::after,
.page-product .new-arrivals-page .product-image-wrap::after {
    content: "";
    position: absolute;
    width: 14px; height: 14px;
    border-radius: 50%;
    right: 12px; bottom: 12px;
    background: var(--bronze);
    border: 2px solid var(--paper);
    box-shadow: 0 2px 6px rgba(36,23,20,0.25);
    pointer-events: none;
}


.product-main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.breadcrumb {
    margin: 10px 0 20px;
    font-size: 14px;
    color: var(--ink-faint);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.breadcrumb a { color: var(--rose); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.product-layout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.gallery {
    flex: 1 1 280px;
    max-width: 460px;
    min-width: 0;
}
.gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 460px;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    position: relative;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gallery-main .no-photo { color: var(--ink-faint); font-size: 14px; }
.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.gallery-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--sand);
    transition: border-color 0.15s;
}
.gallery-thumbs img:hover { border-color: var(--rose); }
.gallery-thumbs img.active { border-color: var(--rose); }

.product-info {
    flex: 1 1 280px;
    min-width: 0;
}
.product-info h1 {
    margin: 0 0 6px;
    font-size: clamp(20px, 4vw, 30px);
    font-weight: 500;
    line-height: 1.25;
    word-break: break-word;
}
.product-brand {
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.product-price__old {
    font-family: var(--font-mono);
    font-size: clamp(13px, 2vw, 17px);
    color: var(--ink-faint);
    text-decoration: line-through;
}
.product-price__current {
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 500;
    color: var(--rose);
}
.product-sales-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.product-sale-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--paper);
    background: var(--rose);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    white-space: nowrap;
}

.product-attrs {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}
.product-attrs li {
    padding: 6px 0;
    border-bottom: 1px solid var(--sand);
    font-size: 14px;
}
.product-attrs li span {
    color: var(--ink-faint);
    display: inline-block;
    min-width: 130px;
}
.product-qty {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 18px;
}
.product-qty.in  { color: var(--sage); }
.product-qty.out { color: var(--danger); }

.buy-btn {
    padding: 14px 30px;
    background: var(--ink);
    color: var(--porcelain);
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 340px;
    transition: background var(--fast) var(--ease), transform 0.05s;
}
.buy-btn:hover   { background: var(--rose); }
.buy-btn:active  { transform: scale(0.98); }
.buy-btn:disabled { background: var(--line); color: var(--ink-faint); cursor: not-allowed; }

.product-sections {
    margin: 40px 0 40px;
    border-top: 1px solid var(--line);
    padding-top: 30px;
}
.product-sections h2 {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 500;
    font-style: italic;
    margin: 0 0 10px;
    border-left: none;
    padding-left: 0;
}
.product-sections .block {
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
}

.viewed-section {
    margin: 40px 0 30px;
}

.viewed-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.viewed-section__title {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--ink);
    margin: 0;
    font-weight: 500;
    font-style: italic;
}

.viewed-nav { display: none; gap: 6px; flex-shrink: 0; }
.viewed-nav__btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--paper); color: var(--ink);
    font-size: 16px; line-height: 34px;
    text-align: center; cursor: pointer; padding: 0;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.viewed-nav__btn:hover  { background: var(--ink); border-color: var(--ink); color: var(--porcelain); }
.viewed-nav__btn:disabled { color: var(--ink-faint); border-color: var(--line); background: var(--porcelain); cursor: default; }

.viewed-track-outer {
    width: 100%;
}

.viewed-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.viewed-card-wrap {
    width: auto;
}
.viewed-card-wrap:nth-child(n+5) { display: none; }

@media (min-width: 901px) {
    .viewed-nav { display: flex; }

    .viewed-track-outer { overflow: visible; }

    .viewed-track {
        display: grid;
        grid-template-columns: repeat(5, 1fr); 
        grid-auto-rows: auto;
        overflow: visible;
        padding-bottom: 0;
        scroll-snap-type: none;
        gap: 14px;
    }

    .viewed-card-wrap {
        flex: none;
        width: auto;
        scroll-snap-align: none;
    }

    .viewed-card-wrap:nth-child(n+11) { display: none; }
}

.vcard {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-card-sm);
    overflow: hidden;
    background: var(--paper);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
    height: 100%;
}
.vcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.vcard__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-decoration: none;

}

.vcard__img-wrap {
    position: relative;
    z-index: 0;
    pointer-events: none;
    aspect-ratio: 1 / 1;
    background: var(--porcelain);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.vcard__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vcard__no-photo { color: var(--ink-faint); font-size: .75rem; }

.vcard__body {
    padding: 7px 8px 9px;
    position: relative;
    z-index: 0;
    pointer-events: none; 
}

.vcard .wishlist-heart,
.vcard [class*="wishlist"],
.vcard [data-wishlist],
.vcard button {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}
.vcard__name {
    font-size: .62rem;
    color: var(--ink-soft);
    margin-bottom: 5px;
    min-height: 2.4em;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}
.vcard__prices {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}
.vcard__old-price { font-family: var(--font-mono); font-size: .54rem; color: var(--ink-faint); text-decoration: line-through; }
.vcard__price     { font-family: var(--font-mono); font-size: .68rem; font-weight: 500; color: var(--rose); }

@media (max-width: 480px) {
    .product-main { padding: 0 12px; margin-top: 16px; }

    .product-layout { gap: 16px; flex-direction: column; }

    .gallery { max-width: 100%; flex-basis: auto; }
    .gallery-main { max-height: 260px; }
    .gallery-thumbs img { width: 50px; height: 50px; }

    .product-info { flex-basis: auto; }

    .product-price-row { flex-direction: column; align-items: flex-start; }
    .product-sales-badges { align-items: flex-start; }

    .buy-btn { max-width: 100%; }

    .product-sections { margin-top: 24px; padding-top: 20px; }

}

@media (min-width: 481px) and (max-width: 600px) {
    .product-main { padding: 0 16px; }
    .product-layout { gap: 20px; flex-direction: column; }
    .gallery { max-width: 100%; flex-basis: auto; }
    .gallery-main { max-height: 320px; }
    .product-info { flex-basis: auto; }
    .buy-btn { max-width: 100%; }

}

@media (min-width: 601px) and (max-width: 900px) {
    .product-layout { gap: 24px; }
    .gallery { flex-basis: 100%; max-width: 100%; }
    .product-info { flex-basis: 100%; }
    .gallery-main { max-height: 400px; }

}

@media (min-width: 901px) and (max-width: 1280px) {
    .gallery { max-width: 440px; }
}

@media (min-width: 1281px) and (max-width: 1920px) {
    .product-main { max-width: 1360px; }
    .gallery { max-width: 520px; }
}

@media (min-width: 1921px) and (max-width: 2560px) {
    .product-main { max-width: 1800px; padding: 0 40px; }
    .gallery { max-width: 640px; }
    .viewed-card-wrap { flex: 0 0 200px; width: 200px; }
    .vcard__name  { font-size: .72rem; }
    .vcard__price { font-size: .78rem; }
}

@media (min-width: 2561px) and (max-width: 3840px) {
    .product-main { max-width: 2400px; padding: 0 60px; }
    .gallery { max-width: 860px; }
    .product-info h1 { font-size: 38px; }
    .viewed-card-wrap { flex: 0 0 260px; width: 260px; }
    .vcard__name  { font-size: .85rem; }
    .vcard__price { font-size: .92rem; }
    .viewed-nav__btn { width: 46px; height: 46px; font-size: 22px; }
}

@media (min-width: 3841px) {
    .product-main { max-width: 3600px; padding: 0 80px; }
    .gallery { max-width: 1200px; }
    .product-info h1 { font-size: 52px; }
    .buy-btn { max-width: 520px; font-size: 20px; padding: 18px 40px; }
    .viewed-card-wrap { flex: 0 0 340px; width: 340px; }
    .vcard__name  { font-size: 1rem; }
    .vcard__price { font-size: 1.1rem; }
    .viewed-nav__btn { width: 58px; height: 58px; font-size: 28px; }
}