/* === SINGLE PRODUCT PAGE v3.0 === */
.single-product-section{padding:var(--space-xl) 0 var(--space-3xl);overflow:hidden;max-width:100vw}
.product-top{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2xl);margin-bottom:var(--space-3xl)}

/* Gallery Layout */
.product-gallery{display:grid;grid-template-columns:80px 1fr;gap:var(--space-md);align-self:start}
.product-gallery[data-images-count="1"]{grid-template-columns:1fr}
.product-gallery[data-images-count="0"]{grid-template-columns:1fr}

/* Vertical Thumbnails Column */
.gallery-thumbs-col{display:flex;flex-direction:column;gap:var(--space-xs);max-height:500px;position:relative}
.gallery-thumbs-nav{width:100%;height:28px;border:1px solid var(--color-border);border-radius:var(--radius-sm);background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--transition-fast);flex-shrink:0;padding:0}
.gallery-thumbs-nav:hover{border-color:var(--color-primary);color:var(--color-primary)}
.gallery-thumbs-nav.swiper-button-disabled{opacity:0.3;cursor:default}
.gallery-thumbs-nav svg{width:16px;height:16px}

.gallery-thumbs-slider{flex:1;overflow:hidden;min-height:0}
.gallery-thumbs-slider .swiper-slide{height:80px!important;width:80px!important;flex-shrink:0}

.gallery-thumb{width:80px;height:80px;border:2px solid var(--color-border);border-radius:var(--radius-sm);cursor:pointer;overflow:hidden;transition:border-color var(--transition-fast);background:var(--color-bg-alt)}
.gallery-thumb:hover,.gallery-thumb.active{border-color:var(--color-primary)}
.gallery-thumb img{width:100%;height:100%;object-fit:contain;padding:4px}

/* Main Image Area */
.gallery-main{position:relative;border-radius:var(--radius-lg);overflow:hidden;background:var(--color-bg-alt)}
.gallery-main-slider{width:100%;aspect-ratio:1/1;max-height:70vh}
.gallery-main-slider .swiper-slide{display:block;height:100%}
.gallery-main-slider .swiper-slide img{width:100%;height:100%;object-fit:contain;cursor:zoom-in;display:block}
.gallery-main .badge{position:absolute;top:var(--space-md);left:var(--space-md);z-index:5}
.gallery-zoom-btn{position:absolute;bottom:var(--space-md);right:var(--space-md);width:40px;height:40px;background:rgba(0,0,0,0.5);color:#fff;border:none;border-radius:var(--radius-full);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background var(--transition-fast);z-index:5}
.gallery-zoom-btn:hover{background:var(--color-primary)}

/* Buy Box */
.buy-box{position:sticky;top:90px;align-self:start}
.buy-box-title{font-size:var(--text-2xl);font-weight:700;margin-bottom:var(--space-sm);line-height:1.3}
.buy-box-sku{font-size:var(--text-sm);color:var(--color-text-muted);margin-bottom:var(--space-md);word-break:break-all;overflow-wrap:anywhere}
.buy-box-stock{display:flex;align-items:center;gap:6px;font-size:var(--text-sm);margin-bottom:var(--space-lg)}
.buy-box-stock .dot{width:10px;height:10px;border-radius:var(--radius-full);background:var(--color-green)}
.buy-box-stock span{color:var(--color-green);font-weight:500}
.buy-box-price{margin-bottom:var(--space-lg);padding:var(--space-lg);background:var(--color-bg-alt);border-radius:var(--radius-md)}
.buy-box-price .current{font-size:var(--text-4xl);font-weight:700;color:var(--color-black)}
.buy-box-price .old{font-size:var(--text-lg);color:var(--color-text-muted);text-decoration:line-through;margin-left:var(--space-md)}
.buy-box-price .discount{display:inline-block;margin-left:var(--space-md);padding:4px 10px;background:var(--color-red);color:#fff;border-radius:var(--radius-sm);font-size:var(--text-sm);font-weight:700}
.buy-box-actions{display:flex;flex-direction:column;gap:var(--space-md);margin-bottom:var(--space-lg)}
.buy-box-actions .btn-primary{padding:16px;font-size:var(--text-md)}
.buy-box-secondary{display:flex;gap:var(--space-sm)}
.buy-box-secondary .btn{flex:1;font-size:var(--text-sm)}
.buy-box-features{list-style:none;padding:0}
.buy-box-features li{display:flex;align-items:center;gap:var(--space-md);padding:var(--space-md) 0;border-bottom:1px solid var(--color-border-light);font-size:var(--text-sm)}
.buy-box-features li svg{width:20px;height:20px;color:var(--color-primary);flex-shrink:0}

/* Qty Control */
.qty-control{display:flex;align-items:center;border:1px solid var(--color-border);border-radius:var(--radius-sm);overflow:hidden}
.qty-control .qty-minus,.qty-control .qty-plus{width:40px;height:40px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:var(--color-text);background:#fafafa;cursor:pointer;transition:all 0.2s;border:none}
.qty-control .qty-minus:hover,.qty-control .qty-plus:hover{background:var(--color-primary);color:#fff}
.qty-control .qty-input{width:50px;height:40px;text-align:center;border:none;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);font-size:var(--text-md);font-weight:600;-moz-appearance:textfield}
.qty-control .qty-input::-webkit-outer-spin-button,.qty-control .qty-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* Cart row: qty on left, button fills right */
.buy-box-cart-row{display:flex;gap:var(--space-md);align-items:center}
.buy-box-cart-row .qty-control{flex-shrink:0}
.buy-box-cart-row .btn{flex:1}

/* === PRODUCT TABS === */
.product-tabs{margin-bottom:var(--space-3xl)}
.product-tabs-nav{display:flex;gap:0;border-bottom:2px solid var(--color-border);margin-bottom:var(--space-xl)}
.product-tabs-nav button{padding:var(--space-md) var(--space-xl);font-size:var(--text-md);font-weight:600;color:var(--color-text-light);background:none;border:none;cursor:pointer;position:relative;transition:color var(--transition-fast)}
.product-tabs-nav button:hover{color:var(--color-primary)}
.product-tabs-nav button.active{color:var(--color-primary)}
.product-tabs-nav button.active::after{content:'';position:absolute;bottom:-2px;left:0;right:0;height:2px;background:var(--color-primary)}
.product-tab-content{display:none;animation:fadeIn 0.3s ease}
.product-tab-content.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

/* Description & Specs Grid — specs sidebar + description */
.desc-specs-layout{display:grid;grid-template-columns:minmax(320px, 380px) minmax(0, 1fr);gap:var(--space-2xl)}
.desc-specs-right{min-width:0;overflow-wrap:break-word}

/* Specs sidebar card */
.desc-specs-left{border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-lg);align-self:start}
.desc-specs-left h3{font-size:var(--text-lg);font-weight:700;margin-bottom:var(--space-md)}

/* Product Features Icons */
.product-features-icons{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--space-md);margin:var(--space-xl) 0;padding-bottom:var(--space-xl);border-bottom:1px solid var(--color-border-light)}
.feature-icon-item{display:flex;flex-direction:column;align-items:center;text-align:center;flex:1}
.feature-svg{color:var(--color-primary);margin-bottom:var(--space-sm)}
.feature-svg svg{width:40px;height:40px;stroke-width:1.5}
.feature-title{font-size:var(--text-sm);color:var(--color-text);margin-bottom:4px;line-height:1.2}
.feature-value{font-size:var(--text-xs);color:var(--color-text-muted)}

/* Description Tab — clean rendering of imported content */
.product-description{font-size:14px;line-height:1.7;color:var(--color-text)}
.product-description h1,.product-description h2{font-size:1.3em;font-weight:700;margin:20px 0 10px;color:#2c3e50;background-color:#f8f9fa;padding:10px 15px;border-radius:6px}
.product-description h3{margin:var(--space-lg) 0 var(--space-sm);font-size:var(--text-lg)}
.product-description h4{font-size:1em;font-weight:600;margin:12px 0 8px;color:#34495e}
.product-description p{margin-bottom:var(--space-sm)}
.product-description ul{margin-bottom:var(--space-sm);padding-left:var(--space-xl)}
.product-description ul li{position:relative;padding:3px 0;padding-left:var(--space-md)}
.product-description ul li::before{content:'';position:absolute;left:0;top:11px;width:5px;height:5px;border-radius:var(--radius-full);background:var(--color-primary)}
.product-description table{width:100%;border-collapse:collapse;margin:12px 0;font-size:13px}
.product-description table td,.product-description table th{padding:8px 12px;border:1px solid #e0e0e0;vertical-align:top}
.product-description table tr:nth-child(even) td{background:#fafafa}
.product-description img{max-width:100%;height:auto;border-radius:8px;margin:12px 0}
/* Override any rikasale.ru imported class styles */
[class*="rika-nv-product-sheet"]{font-family:inherit!important;font-size:14px!important;line-height:1.7!important;color:var(--color-text)!important;background:none!important;padding:0!important;margin:0!important;max-width:100%!important}

/* Specifications Table — compact rikasale.ru style */
.specs-table{width:100%;border-collapse:collapse}
.specs-table tr{border-bottom:1px solid var(--color-border-light)}
.specs-table tr:last-child{border-bottom:none}
.specs-table td{padding:7px 8px;font-size:13px;vertical-align:baseline;line-height:1.35}
.specs-table td:first-child{color:var(--color-text-muted);font-weight:400;width:45%}
.specs-table td:last-child{font-weight:600;text-align:right}

/* Reviews Tab */
.reviews-summary{display:flex;align-items:center;gap:var(--space-xl);margin-bottom:var(--space-xl);padding:var(--space-lg);background:var(--color-bg-alt);border-radius:var(--radius-md)}
.reviews-avg{text-align:center}
.reviews-avg .num{font-size:var(--text-5xl);font-weight:700;color:var(--color-black);line-height:1}
.reviews-avg .stars{color:var(--color-star);margin:var(--space-xs) 0}
.reviews-avg .count{font-size:var(--text-sm);color:var(--color-text-muted)}
.review-item{padding:var(--space-lg) 0;border-bottom:1px solid var(--color-border-light)}
.review-header{display:flex;align-items:center;gap:var(--space-md);margin-bottom:var(--space-md)}
.review-author{font-weight:600;font-size:var(--text-md)}
.review-date{font-size:var(--text-xs);color:var(--color-text-muted)}
.review-stars{color:var(--color-star);font-size:var(--text-sm)}
.review-text{font-size:var(--text-base);line-height:1.6;color:var(--color-text)}

/* === WooCommerce Review Form === */
#tab-reviews { max-width: 720px; }
#tab-reviews h2,
#tab-reviews .woocommerce-Reviews-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
#tab-reviews .woocommerce-noreviews { color: var(--color-text-muted); font-style: italic; margin-bottom: 24px; }

/* Star Rating Selector */
#tab-reviews .comment-form-rating { margin-bottom: 20px; }
#tab-reviews .comment-form-rating label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
#tab-reviews p.stars { display: flex; gap: 4px; margin: 0; padding: 0; }
#tab-reviews p.stars a { 
    display: inline-block; width: 32px; height: 32px; text-indent: -9999px; position: relative;
    background: none; border: none; cursor: pointer;
}
#tab-reviews p.stars a::before {
    content: '★'; position: absolute; top: 0; left: 0;
    font-size: 28px; text-indent: 0; color: #ddd;
    transition: color 0.15s;
}
#tab-reviews p.stars a:hover ~ a::before { color: #ddd !important; }
#tab-reviews p.stars:hover a::before { color: #f5a623; }
#tab-reviews p.stars a:hover::before { color: #f5a623; }
#tab-reviews p.stars.selected a.active::before,
#tab-reviews p.stars.selected a.active ~ a::before { color: #ddd; }
#tab-reviews p.stars.selected a::before { color: #f5a623; }

/* Comment form fields */
#tab-reviews .comment-form { background: var(--color-bg-alt); padding: 28px; border-radius: 12px; margin-top: 24px; }
#tab-reviews .comment-form .comment-notes { font-size: 13px; color: var(--color-text-muted); margin-bottom: 16px; }
#tab-reviews .comment-form p { margin-bottom: 16px; }
#tab-reviews .comment-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--color-text); }
#tab-reviews .comment-form input[type="text"],
#tab-reviews .comment-form input[type="email"],
#tab-reviews .comment-form textarea {
    width: 100%; padding: 12px 16px; border: 1px solid var(--color-border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
    background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
#tab-reviews .comment-form input:focus,
#tab-reviews .comment-form textarea:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(61,90,53,0.12);
}
#tab-reviews .comment-form textarea { min-height: 120px; resize: vertical; }
#tab-reviews .comment-form .form-submit { margin-bottom: 0; }
#tab-reviews .comment-form .form-submit input[type="submit"],
#tab-reviews .comment-form .submit {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: var(--color-primary); color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background 0.2s, transform 0.15s;
    font-family: inherit;
}
#tab-reviews .comment-form .form-submit input[type="submit"]:hover,
#tab-reviews .comment-form .submit:hover {
    background: var(--color-primary-dark, #2d5a28); transform: translateY(-1px);
}

/* Existing review list */
#tab-reviews .commentlist,
#tab-reviews ol.commentlist { list-style: none; padding: 0; margin: 0 0 32px; }
#tab-reviews .commentlist li { padding: 20px 0; border-bottom: 1px solid var(--color-border-light); }
#tab-reviews .commentlist .comment_container { display: flex; gap: 16px; }
#tab-reviews .commentlist img.avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
#tab-reviews .commentlist .comment-text { flex: 1; }
#tab-reviews .commentlist .meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
#tab-reviews .commentlist .meta strong { font-size: 15px; }
#tab-reviews .commentlist .meta time { font-size: 12px; color: var(--color-text-muted); }
#tab-reviews .commentlist .star-rating { font-size: 14px; color: #f5a623; }
#tab-reviews .commentlist .description p { font-size: 14px; line-height: 1.6; color: var(--color-text); margin: 0; }

/* WC star rating display */
.star-rating { overflow: hidden; position: relative; height: 1.2em; line-height: 1.2; font-size: 14px; width: 5.4em; font-family: 'star'; }
.star-rating::before { content: '★★★★★'; color: #ddd; float: left; top: 0; left: 0; position: absolute; }
.star-rating span { overflow: hidden; float: left; top: 0; left: 0; position: absolute; padding-top: 1.5em; }
.star-rating span::before { content: '★★★★★'; top: 0; position: absolute; left: 0; color: #f5a623; }

/* Related Products */
.related-products{padding:var(--space-3xl) 0}

/* Shipping Tab Cards */
.shipping-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-lg);margin-bottom:var(--space-xl)}
.shipping-card{background:var(--color-bg-alt);border-radius:var(--radius-md);padding:var(--space-lg);text-align:center}
.shipping-card-icon{width:48px;height:48px;margin:0 auto var(--space-md);color:var(--color-primary)}
.shipping-card-icon svg{width:100%;height:100%}
.shipping-card h4{font-size:15px;font-weight:700;margin-bottom:var(--space-sm)}
.shipping-card p{font-size:13px;color:var(--color-text-muted);line-height:1.5;margin:0}
.shipping-custom-content{font-size:14px;line-height:1.7}

/* Lightbox */
.product-lightbox{position:fixed;inset:0;z-index:var(--z-modal);background:rgba(0,0,0,0.9);display:none;align-items:center;justify-content:center}
.product-lightbox.active{display:flex}
.product-lightbox img{max-width:80%;max-height:85vh;object-fit:contain}
.product-lightbox-close{position:absolute;top:var(--space-lg);right:var(--space-lg);width:44px;height:44px;background:rgba(255,255,255,0.1);color:#fff;border:none;border-radius:var(--radius-full);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:24px;transition:background var(--transition-fast)}
.product-lightbox-close:hover{background:rgba(255,255,255,0.3)}
.product-lightbox-prev,.product-lightbox-next{position:absolute;top:50%;transform:translateY(-50%);width:50px;height:50px;background:rgba(255,255,255,0.1);color:#fff;border:none;border-radius:var(--radius-full);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background var(--transition-fast)}
.product-lightbox-prev:hover,.product-lightbox-next:hover{background:rgba(255,255,255,0.3)}
.product-lightbox-prev{left:var(--space-lg)}
.product-lightbox-next{right:var(--space-lg)}
.product-lightbox-prev svg,.product-lightbox-next svg{width:24px;height:24px}

@media(max-width:1024px){
    .product-top{grid-template-columns:1fr;gap:var(--space-xl)}
    .buy-box{position:static}
    .desc-specs-layout{grid-template-columns:1fr}
}
@media(max-width:768px){
    .product-gallery{grid-template-columns:1fr;gap:var(--space-sm);overflow:hidden}
    /* Main gallery on mobile — simple fixed height, let Swiper handle layout */
    .gallery-main{position:relative;overflow:hidden;border-radius:var(--radius-md);max-width:100%;max-height:60vh}
    .gallery-main-slider{width:100%;height:auto;max-height:60vh;aspect-ratio:1/1}
    .gallery-main-slider .swiper-slide img{width:100%;height:100%;object-fit:contain;max-height:60vh}
    /* Horizontal thumbnails on mobile — swipeable CSS scroll */
    .gallery-thumbs-col{
        display:flex;
        flex-direction:row;
        order:2;
        max-height:none;
        overflow-x:auto;
        overflow-y:hidden;
        gap:6px;
        padding:10px 0;
        -webkit-overflow-scrolling:touch;
        scroll-behavior:smooth;
    }
    /* Hide nav buttons on mobile */
    .gallery-thumbs-nav{display:none!important}
    /* Thumbs slider — allow scroll, no clipping */
    .gallery-thumbs-slider{
        overflow:visible;
        min-height:auto;
        width:auto;
        max-width:none;
        flex-shrink:0;
    }
    .gallery-thumbs-slider .swiper-wrapper{
        display:flex!important;
        flex-direction:row!important;
        flex-wrap:nowrap!important;
        gap:6px;
        transform:none!important;
    }
    .gallery-thumbs-slider .swiper-slide{
        height:64px!important;
        width:64px!important;
        flex-shrink:0;
        margin:0!important;
    }
    .gallery-thumb{width:64px;height:64px;padding:2px}
    /* Product top: single column on mobile */
    .product-top{grid-template-columns:1fr;gap:var(--space-lg)}
    /* Buy box mobile */
    .buy-box-title{font-size:var(--text-xl);word-break:break-word}
    .buy-box-price .current{font-size:var(--text-2xl)}
    .buy-box-price .old{font-size:var(--text-base)}
    .buy-box-secondary{flex-wrap:wrap}
    /* Specs table — responsive on mobile */
    .specs-table{table-layout:auto}
    .specs-table td{padding:6px 0;font-size:var(--text-xs)}
    .specs-table td:first-child{white-space:normal;min-width:auto;background-image:none}
    .specs-table td:last-child{white-space:normal}
    .desc-specs-left{border:none;padding:0;margin-bottom:var(--space-md)}
    /* Description adapts */
    .product-description{overflow-wrap:break-word;word-break:break-word}
    .product-description ul{padding-left:var(--space-md)}
    /* Tabs */
    .product-tabs-nav{overflow-x:auto;-webkit-overflow-scrolling:touch}
    .product-tabs-nav button{white-space:nowrap;padding:var(--space-md);font-size:var(--text-sm)}
    /* Features icons */
    .product-features-icons{flex-wrap:wrap;gap:var(--space-sm)}
    .feature-icon-item{flex:0 0 calc(33.333% - 8px)}
    .feature-svg svg{width:28px;height:28px}
    .feature-title{font-size:var(--text-xs)}
    .feature-value{font-size:10px}
    /* Lightbox */
    .product-lightbox img{max-width:95%;max-height:80vh}
    .product-lightbox-prev,.product-lightbox-next{width:36px;height:36px}
    /* Shipping cards mobile */
    .shipping-cards{grid-template-columns:1fr;gap:var(--space-md)}
}
