/* ============================================
   product.css — СТРАНИЦА ТОВАРА (МИНИМАЛИСТИЧНАЯ)
   ============================================ */

/* ----- ОБЩИЕ КОНТЕЙНЕРЫ ----- */
.product-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    overflow-x: hidden;
}

.product-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 50px;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #ebe5dd;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ----- ГАЛЕРЕЯ ----- */
.product-gallery {
    position: relative;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

.product-gallery .splide {
    border-radius: 8px;
    overflow: hidden;
    background: #f7f4f0;
}

.product-gallery .splide__track {
    min-height: auto;
}

.product-gallery .splide__slide {
    aspect-ratio: 3 / 2;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f4f0;
    overflow: hidden;
}

.product-gallery .splide__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    background: #f7f4f0;
}

.splide__arrows, 
.splide__pagination {
    display: none !important;
}

.image-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 3px 12px;
    border-radius: 40px;
    font-size: 0.7rem;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.zoom-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e8e0d8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s;
    color: #3e2e1f;
}

.zoom-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.zoom-btn:hover {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

/* ============================================================
   СЕРДЕЧКО (ИЗБРАННОЕ) — С КЛИКАБЕЛЬНОСТЬЮ
   ============================================================ */
.product-gallery .wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e8e0d8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    transition: all 0.2s;
    pointer-events: auto;
}

.product-gallery .wishlist-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.product-gallery .wishlist-btn.active svg path {
    fill: #d4788a;
    stroke: #d4788a;
}

.product-gallery .wishlist-btn:hover {
    border-color: #d4788a;
    transform: scale(1.05);
}

/* ----- МИНИАТЮРЫ ----- */
.gallery-thumbnails {
    margin-top: 15px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.thumbnails-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: max-content;
    min-width: 100%;
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f7f4f0;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.thumbnail-item:hover {
    border-color: #d4a574;
}

.thumbnail-item.active {
    border-color: #b8955c;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f0e6d8;
    border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #d4c5b5;
    border-radius: 10px;
}

/* ----- ПРАВАЯ КОЛОНКА ----- */
.product-info-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

.product-info-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-info-page h1 {
    font-size: 1.8rem;
    font-weight: 500;
    color: #4a3727;
    margin: 0;
    word-break: break-word;
    font-family: 'Playfair Display', Georgia, serif;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    cursor: pointer;
}

.product-rating .stars {
    display: flex;
    gap: 3px;
}

.product-rating .star {
    font-size: 1.1rem;
    color: #d5cdc5;
}

.product-rating .star.filled {
    color: #b8955c;
}

.product-rating .reviews-count {
    font-size: 0.8rem;
    color: #a09080;
}

.product-price-page {
    font-size: 1.8rem;
    font-weight: 500;
    color: #4a3727;
    padding: 12px 0;
    border-top: 1px solid #ebe5dd;
    border-bottom: 1px solid #ebe5dd;
}

.product-short-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5a4a3a;
    word-break: break-word;
}

/* ----- КНОПКИ ----- */
.product-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
    width: 100%;
}

.buy-now-btn,
.add-to-cart-btn {
    flex: 1;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 40px;
    transition: all 0.2s;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.buy-now-btn {
    background: #2c3e50;
    color: #fff;
}

.buy-now-btn:hover {
    background: #1e2a36;
}

.add-to-cart-btn {
    background: #d4a574;
    color: #2c1e0e;
}

.add-to-cart-btn:hover {
    background: #c48b56;
}

.add-to-cart-btn.in-cart {
    background: #b8956e;
    color: #fff;
}

.add-to-cart-btn.in-cart:hover {
    background: #a47d53;
}

.purchased-message {
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    background: #e8f5e9;
    border-radius: 40px;
    border: 1px solid #c8e6c9;
}

.purchased-message p {
    margin: 0;
    font-size: 0.85rem;
    color: #2d7a4a;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ----- ВКЛАДКИ ----- */
.product-tabs {
    margin-top: 60px;
    background: #ffffff;
    border-radius: 12px;
    padding: 0 30px 30px 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #ebe5dd;
}

.tabs-header {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #ebe5dd;
    padding-top: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #a09080;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    letter-spacing: 0.3px;
}

.tab-btn.active {
    color: #4a3727;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #b8955c;
    border-radius: 2px;
}

.tab-btn:hover:not(.active) {
    color: #5a3e2b;
}

.tabs-content {
    padding-top: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.description-content {
    color: #5a4a3a;
    line-height: 1.7;
    font-size: 0.9rem;
    word-break: break-word;
}

/* ----- ОТЗЫВЫ ----- */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    padding: 12px 15px;
    background: #faf7f2;
    border-radius: 8px;
    border: 1px solid #ebe5dd;
}

.review-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 12px;
}

.reviewer-avatar {
    flex-shrink: 0;
}

.reviewer-avatar img,
.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: #b8955c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
}

.reviewer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reviewer-name {
    font-weight: 500;
    color: #4a3727;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.2;
}

.review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}

.review-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.review-rating .star {
    font-size: 0.75rem;
    color: #d5cdc5;
}

.review-rating .star.filled {
    color: #b8955c;
}

.review-date {
    font-size: 0.65rem;
    color: #a09080;
}

.review-text-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #5a4a3a;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 80px;
    margin-top: 6px;
}

.review-text-content.expanded {
    max-height: none;
}

.admin-reply {
    background: #fef8f0;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    border-left: 3px solid #d4a574;
}

.admin-reply strong {
    color: #8b5a2b;
    font-size: 0.75rem;
    display: block;
    margin-bottom: 3px;
}

.admin-reply-content {
    font-size: 0.8rem;
    line-height: 1.5;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 60px;
}

.admin-reply-content.expanded {
    max-height: none;
}

.read-more-btn {
    background: none;
    border: none;
    color: #b8955c;
    font-size: 0.7rem;
    cursor: pointer;
    margin-top: 4px;
    padding: 0;
    font-weight: 500;
}

.read-more-btn:hover {
    color: #8b5a2b;
}

.reply-date {
    font-size: 0.6rem;
    color: #a09080;
    margin-top: 4px;
}

.reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #a09080;
}

.reviews-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 992px) {
    .product-container {
        gap: 30px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .product-page {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .product-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 16px !important;
        border-radius: 8px;
    }
    
    .product-gallery {
        max-width: 100% !important;
    }
    
    .product-gallery .splide__slide {
        aspect-ratio: 3 / 2;
    }
    
    .gallery-thumbnails {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-top: 10px;
    }
    
    .thumbnails-list {
        gap: 8px;
        width: max-content !important;
    }
    
    .thumbnail-item {
        width: 55px !important;
        height: 55px !important;
    }
    
    /* ----- ФИКС КЛИКАБЕЛЬНОСТИ СЕРДЕЧКА В МОБИЛКЕ ----- */
    .product-gallery .wishlist-btn {
        z-index: 30 !important;
        pointer-events: auto !important;
        width: 40px !important;
        height: 40px !important;
        top: 12px !important;
        right: 12px !important;
    }
    
    .product-gallery .wishlist-btn svg {
        pointer-events: none !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    /* ----- УВЕЛИЧЕННЫЕ ШРИФТЫ В МОБИЛКЕ ----- */
    .product-info-page h1 {
        font-size: 1.5rem !important;
    }
    
    .product-price-page {
        font-size: 1.5rem !important;
        padding: 12px 0 !important;
    }
    
    .product-short-description {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    .description-content {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }
    
    .product-rating .star {
        font-size: 1.3rem !important;
    }
    
    .product-rating .reviews-count {
        font-size: 0.9rem !important;
    }
    
    .product-actions {
        flex-direction: row !important;
        gap: 10px;
    }
    
    .buy-now-btn,
    .add-to-cart-btn {
        padding: 10px 14px;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
    
    .product-tabs {
        margin-top: 30px;
        padding: 0 15px 20px 15px !important;
        border-radius: 8px;
    }
    
    .tabs-header {
        gap: 15px;
    }
    
    .tab-btn {
        font-size: 0.85rem;
        padding: 10px 0;
    }
    
    .reviewer-name {
        font-size: 0.85rem !important;
    }
    
    .review-rating .star {
        font-size: 0.75rem !important;
    }
    
    .review-date {
        font-size: 0.65rem !important;
    }
    
    .review-text-content {
        font-size: 0.8rem !important;
        max-height: 60px !important;
    }
    
    .admin-reply-content {
        font-size: 0.75rem !important;
        max-height: 50px !important;
    }
    
    .read-more-btn {
        font-size: 0.7rem !important;
    }
    
    .zoom-btn, 
    .product-gallery .wishlist-btn {
        width: 34px;
        height: 34px;
    }
    
    .zoom-btn svg,
    .product-gallery .wishlist-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .image-counter {
        font-size: 0.65rem;
        padding: 2px 10px;
    }
    
    .purchased-message p {
        font-size: 0.8rem;
    }
    
    .reviews-empty p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .product-container {
        padding: 12px !important;
        gap: 16px !important;
    }
    
    .product-gallery .splide__slide {
        aspect-ratio: 15 / 10;
    }
    
    .thumbnail-item {
        width: 45px !important;
        height: 45px !important;
    }
    
    .thumbnails-list {
        gap: 6px;
    }
    
    /* ----- ФИКС КЛИКАБЕЛЬНОСТИ СЕРДЕЧКА (маленькие экраны) ----- */
    .product-gallery .wishlist-btn {
        width: 38px !important;
        height: 38px !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 30 !important;
        pointer-events: auto !important;
    }
    
    .product-gallery .wishlist-btn svg {
        width: 18px !important;
        height: 18px !important;
        pointer-events: none !important;
    }
    
    /* ----- УВЕЛИЧЕННЫЕ ШРИФТЫ ДЛЯ ТЕЛЕФОНОВ ----- */
    .product-info-page h1 {
        font-size: 1.3rem !important;
    }
    
    .product-price-page {
        font-size: 1.3rem !important;
    }
    
    .product-short-description {
        font-size: 0.8rem !important;
    }
    
    .description-content {
        font-size: 0.8rem !important;
    }
    
    .product-rating .star {
        font-size: 1.2rem !important;
    }
    
    .product-rating .reviews-count {
        font-size: 0.85rem !important;
    }
    
    .buy-now-btn,
    .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.7rem !important;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 8px 0;
    }
    
    .reviewer-name {
        font-size: 0.8rem !important;
    }
    
    .review-rating .star {
        font-size: 0.7rem !important;
    }
    
    .review-date {
        font-size: 0.6rem !important;
    }
    
    .review-text-content {
        font-size: 0.75rem !important;
        max-height: 55px !important;
    }
    
    .admin-reply-content {
        font-size: 0.7rem !important;
        max-height: 45px !important;
    }
    
    .read-more-btn {
        font-size: 0.65rem !important;
    }
    
    .zoom-btn,
    .product-gallery .wishlist-btn {
        width: 30px;
        height: 30px;
    }
    
    .zoom-btn svg,
    .product-gallery .wishlist-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .image-counter {
        font-size: 0.55rem;
        padding: 2px 8px;
    }
    
    .purchased-message p {
        font-size: 0.7rem;
    }
    
    .reviews-empty p {
        font-size: 0.8rem;
    }
}

.splide__slide:hover {
    transform: none !important;
}