@font-face {
    font-family: "Montserrat-Bold";
    src: url("../fonts/Montserrat-Bold.ttf");
}

.product-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    padding: 60px 0;
}

/* ── Галерея / слайдер ───────────────────────────────────── */
.product-gallery {
    min-width: 0;
}

/* внешняя обёртка — overflow:visible чтобы стрелки были кликабельны */
.slider-outer {
    position: relative;
}

/* стрелки живут в slider-outer, поверх slider-wrap */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .92);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    transition: background .15s, color .15s;
    padding: 0;
}

.slider-arrow:hover {
    background: #fff;
    color: #127FB2;
}

.slider-arrow--left  { left: 12px; }
.slider-arrow--right { right: 12px; }

/* сам слайдер — overflow:hidden обрезает кадры */
.slider-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #f9f9f9;
    height: 500px;
    cursor: crosshair;
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.slider-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.zoomable-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .15s ease;
    transform-origin: 50% 50%;
    pointer-events: none;
    display: block;
}

.slider-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 12px;
    color: #888;
    background: rgba(255, 255, 255, .85);
    border-radius: 20px;
    padding: 2px 10px;
    pointer-events: none;
}

/* ── Миниатюры ───────────────────────────────────────────── */
.slider-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-behavior: smooth;

    /* убираем полосу прокрутки визуально, но оставляем функционал */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.slider-thumbs::-webkit-scrollbar {
    height: 4px;
}

.slider-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.slider-thumbs::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.slider-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f9f9f9;
    transition: border-color .2s, opacity .2s, transform .15s;
    opacity: 0.55;
}

.slider-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.slider-thumb.active {
    border-color: #127FB2;
    opacity: 1;
}

.slider-thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* ── Цены ────────────────────────────────────────────────── */
.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #127FB2;
}

.old-price {
    text-decoration: line-through;
    color: #aaa;
    font-size: 16px;
    margin-right: 6px;
}

.discount-badge {
    background: #e63946;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

/* ── Действия ────────────────────────────────────────────── */
.product-actions {
    display: flex;
    gap: 20px;
    margin: 25px 0;
}

.product-actions input {
    width: 60px;
    padding: 8px;
}

/* ── Табы ────────────────────────────────────────────────── */
.tabs-nav {
    display: flex;
    gap: 40px;
    border-bottom: 1px solid #eee;
}

.tab {
    background: none;
    border: none;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 600;
}

.tab.active {
    border-bottom: 3px solid #127FB2;
}

.tab-content {
    display: none;
    padding: 30px 0;
}

.tab-content.active {
    display: block;
}

/* ── Похожие товары ──────────────────────────────────────── */
.related-products {
    padding: 80px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 40px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    background: #fff;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-6px);
}

.product-image {
    height: 220px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.btn-cart, .btn-preorder {
    background: #127FB2;
    color: #fff;
    border: none;
    font-family: "Montserrat-Bold";
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-cart:hover,
.btn-preorder:hover {
    background: rgb(7, 97, 138);
}

/* ── Отзывы ──────────────────────────────────────────────── */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.reviews-avg {
    font-size: 32px;
    font-weight: 700;
    color: #f5a623;
}

.reviews-count {
    font-size: 14px;
    color: #777;
}

.review-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.review-form h3 {
    margin-bottom: 15px;
}

.star-select {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 15px;
}

.star-select input {
    display: none;
}

.star-select label {
    font-size: 30px;
    color: #ccc;
    cursor: pointer;
}

.star-select input:checked ~ label,
.star-select label:hover,
.star-select label:hover ~ label {
    color: #f5a623;
}

.review-form textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.btn-review {
    background: #127FB2;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-review:hover {
    background: #0a6b94;
}

#review-msg {
    margin-top: 10px;
    font-size: 14px;
    color: #127FB2;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px 20px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.review-author { font-weight: 600; }

.review-stars {
    color: #f5a623;
    font-size: 16px;
}

.review-date {
    font-size: 13px;
    color: #999;
    margin-left: auto;
}

.review-text {
    font-size: 14px;
    color: #444;
}

/* ── Избранное ───────────────────────────────────────────── */
.fav-btn--product {
    position: static;
    width: auto;
    height: 42px;
    border-radius: 1px;
    background: #ffffff;
    border: 1.5px solid #e63946;
    padding: 0 16px;
    font-size: 16px;
    color: #e63946;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: none;
}

.fav-btn--product .fav-label {
    font-size: 13px;
    font-family: "Montserrat-Regular";
}

.fav-btn--product.fav-active,
.fav-btn--product.fav-active:hover {
    color: #e63946;
    border-color: #e63946;
    background: #ffffff;
    transform: none;
}

.fav-btn--product:hover {
    transform: none;
    border-color: #b41321;
    color: #b41321;
    box-shadow: none;
}

/* ── Статус товара ───────────────────────────────────────── */
.stock-count {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 4px;
}

.out-stock { color: #e63946; }
.in-stock  { color: #2e7d32; }

/* ── Адаптив ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .product-top { gap: 50px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .product-top { gap: 40px; padding: 50px 0; }
    .current-price { font-size: 24px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 25px; }
    .slider-wrap { height: 400px; }
    .slider-thumb { width: 64px; height: 64px; }
}

@media (max-width: 768px) {
    .product-top { grid-template-columns: 1fr; gap: 40px; padding: 40px 0; }
    .product-actions { flex-wrap: wrap; gap: 15px; }
    .product-actions input { width: 80px; }
    .tabs-nav { gap: 25px; overflow-x: auto; white-space: nowrap; }
    .tab { padding: 12px 0; font-size: 14px; }
    .tab-content { padding: 20px 0; }
    .related-products { padding: 60px 0; }
    .section-title { font-size: 22px; margin-bottom: 30px; }
    .slider-wrap { height: 340px; }
    .slider-thumb { width: 60px; height: 60px; }
}

@media (max-width: 480px) {
    .product-top { padding: 30px 0; gap: 30px; }
    .current-price { font-size: 22px; }
    .product-actions { flex-direction: column; align-items: stretch; }
    .product-actions input { width: 100%; }
    .btn-cart, .btn-preorder { width: 100%; padding: 12px; font-size: 14px; }
    .products-grid { grid-template-columns: 1fr; gap: 20px; }
    .product-info { padding: 15px; }
    .slider-wrap { height: 280px; }
    .slider-arrow { width: 34px; height: 34px; font-size: 22px; }
    .slider-thumb { width: 54px; height: 54px; }
}