/* ================= ITEM PAGE ================= */

.item-page { padding: 24px 0 72px; }

.item-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--c-muted);
    font-size: .85rem;
}

.item-breadcrumbs a:hover { color: var(--c-primary-dark); }
.item-breadcrumbs > span:last-child { color: var(--c-dark); }

.error {
    padding-top: 60px;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    color: var(--c-muted);
}
.error a { color: var(--c-primary-dark); font-weight: 600; }
.error a:hover { text-decoration: underline; }

.btn-back { margin-bottom: 18px; }

.item-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: start;
}

/* ---------- Media ---------- */
.img-full-current {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 620px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-bg-alt);
    cursor: none;
}
.img-full-current.on-cursor { cursor: pointer; }

/* Медиа-блок: картинка и видео занимают бокс целиком через object-fit,
   чтобы лупа точно совпадала с видимой областью изображения */
.img-full-current img,
.img-full-current video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--c-dark);
    display: grid;
    place-items: center;
    transition: transform var(--tr), background-color var(--tr), box-shadow var(--tr);
}
.fullscreen-icon:hover {
    background: #fff;
    transform: scale(1.08);
    box-shadow: var(--c-shadow-md);
}
.fullscreen-icon svg { width: 18px; height: 18px; }

.magnifier-lens {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
    background-repeat: no-repeat;
    z-index: 4;
}

.item-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.video-other-div {
    width: max-content;
    position: relative;
    cursor: pointer;
}
.img-full-other {
    width: 92px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--tr), transform var(--tr);
    background: var(--c-bg-alt);
}
.img-full-other:hover { border-color: rgba(171, 211, 115, .6); transform: translateY(-2px); }

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="white"><path d="M8 5v14l11-7z"/></svg>') no-repeat center center;
    background-size: 14px;
    pointer-events: none;
}

/* ---------- Info ---------- */
.item-title {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
#price { font-size: 1.7rem; font-weight: 800; color: var(--c-primary-deep, #6ea53c); letter-spacing: -0.01em; }
#price span { font-size: .85rem; font-weight: 400; color: var(--c-muted); display: inline-block; margin-top: 6px; }

#other-text { display: none; }
#other-text:not(:empty) { display: block; }

.price-on-request {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--c-ink);
}

.price-request-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    font-weight: 400;
    color: #3f5c39;
    background: var(--c-primary-faint);
    border: 1px dashed rgba(171, 211, 115, .6);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: .88rem;
    line-height: 1.55;
}
.price-request-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary-deep, #6ea53c);
    font-size: 1rem;
}

.item-buy { margin: 26px 0; }
.btn-lg-add {
    min-width: 240px;
    padding: 15px 36px;
    font-size: 1.02rem;
}

.item-buy .btn-primary {
    background: var(--c-primary-dark);
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(75, 112, 45, .65);
}

.item-buy .btn-primary::after {
    display: none;
}

.item-buy .btn-primary:hover {
    background: #3e5e25;
    box-shadow: 0 10px 22px -12px rgba(62, 94, 37, .7);
}

/* Степпер «В корзине» */
.cart-stepper {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid var(--c-primary);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: 0 6px 16px -6px rgba(140, 190, 85, .5);
    background: #fff;
    max-width: 100%;
}
.stepper-btn {
    width: 52px;
    border: none;
    background: var(--c-primary-faint);
    color: var(--c-primary-deep, #6ea53c);
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--tr), color var(--tr);
}
.stepper-btn:hover { background: var(--c-primary); color: #fff; }
.stepper-btn:active { transform: scale(.94); }
.stepper-mid {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
}
.stepper-input {
    width: 52px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-ink);
    background: var(--c-primary-faint);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 7px 4px;
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr), background-color var(--tr);
    -moz-appearance: textfield;
    appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input:focus {
    border-color: var(--c-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(171, 211, 115, .2);
}
.stepper-goto {
    border: none;
    background: none;
    color: var(--c-muted);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: color var(--tr), background-color var(--tr);
    white-space: nowrap;
}
.stepper-goto:hover { color: var(--c-primary-deep, #6ea53c); background: var(--c-primary-faint); }

.service-item-wrap {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.service-item {
    flex: 1 1 130px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-primary-faint);
    border: 1px solid rgba(171, 211, 115, .35);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    font-size: .82rem;
    color: var(--c-dark);
    transition: transform var(--tr-spring), box-shadow var(--tr);
}
.service-item:hover { transform: translateY(-3px); box-shadow: var(--c-shadow-sm); }
.service-icon { font-size: 1.45rem; }

.product-category {
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    transition: border-color var(--tr), box-shadow var(--tr);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 560px;
    margin-bottom: 10px;
}
/* Наличие — первый и акцентный блок */
.product-category.availability-first {
    background: #f9fff5;
    border: 1.5px solid rgba(171, 211, 115, .55);
    margin-bottom: 18px;
}
.product-category.availability-first .title {
    color: var(--c-primary-deep, #6ea53c);
    font-weight: 700;
}
#isHave { font-weight: 600; }
.product-category:hover {
    border-color: #c0e0c3;
    box-shadow: var(--c-shadow-sm);
}
.product-category .title {
    flex: 1.2;
    font-size: .85rem;
    font-weight: 600;
    color: #2c5e3a;
}
.product-category ul {
    list-style: none;
    flex: 2;
    text-align: left;
    font-size: .92rem;
}
.product-category li {
    display: inline-block;
    background: var(--c-primary-faint);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    color: #1d4b2c;
    border: 1px solid #d0ebd0;
}
.product-category a { color: var(--c-primary-dark); font-weight: 600; }
.product-category a:hover { text-decoration: underline; }

.attribute-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 38px 10px 14px;
    font-size: .92rem;
    color: #1d4b2c;
    background-color: #f8fff8;
    border: 2px solid #d8eeda;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233a7b4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.attribute-select:hover { border-color: #a8d5ba; background-color: #fff; }
.attribute-select:focus { border-color: #7bc97f; box-shadow: 0 0 0 3px rgba(123, 201, 127, .15); }

/* ---------- Description ---------- */
.item-description { margin-top: 64px; }
.product-description-body {
    display: flex;
    justify-content: center;
}
#description {
    width: 100%;
    max-width: 900px;
    color: var(--c-dark);
    white-space: pre-line; /* сохраняем переносы строк из описания */
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--c-shadow-sm);
    padding: 28px 32px;
    font-size: 1rem;
    line-height: 1.75;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Длинное тире/тире в начале строки — визуально как пункт списка */
#description p { margin-bottom: .6em; }
#description p:last-child { margin-bottom: 0; }

/* Списки внутри описания */
#description ul.desc-list {
    list-style: none;
    margin: .4em 0 .8em;
    display: grid;
    gap: .45em;
}
#description ul.desc-list li {
    position: relative;
    padding-left: 26px;
    line-height: 1.6;
}
#description ul.desc-list li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(171, 211, 115, .22);
}
#description .desc-empty {
    color: var(--c-muted);
    font-style: italic;
    text-align: center;
    padding: 12px 0;
}

/* ---------- Media modal ---------- */
.media-modal {
    pointer-events: auto;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 1400;
    display: none;
    justify-content: center;
}
.media-modal.on { display: flex; }

.media-stage {
    position: relative;
    width: min(94vw, 1100px);
    height: min(84vh, 900px);
    margin-top: max(2vh, 12px);
    display: grid;
    place-items: center;
    min-height: 0;
}
.media-stage img,
.media-stage video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #000;
    border-radius: var(--radius-sm);
    margin-inline: auto;
}

.media-close {
    z-index: 2;
    pointer-events: auto;
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}
.media-close:hover { background: rgba(255, 255, 255, .25); }

.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 34px;
    cursor: pointer;
    display: grid;
    place-items: center;
    user-select: none;
    z-index: 2;
}
.media-nav:hover { background: rgba(255, 255, 255, .25); }
.media-nav.prev { left: 14px; }
.media-nav.next { right: 14px; }

.media-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    justify-content: center;
}
.media-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .08);
    display: grid;
    place-items: center;
}
.media-thumb.active { border-color: var(--c-primary); }
.media-thumb img,
.media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .play-badge {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
}

@media (max-width: 768px) {
    .media-nav { width: 44px; height: 44px; font-size: 28px; }
    .media-thumb { width: 60px; height: 60px; }
    .media-stage { width: 96vw; height: 78vh; margin-top: 8px; }
}

.cart-bump { animation: bump .45s ease; }
@keyframes bump {
    0% { transform: scale(1); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (min-width: 992px) {
    .item-layout { grid-template-columns: 1fr 1fr; }
    .item-thumbs { justify-content: flex-start; }
}
