/**
 * SMD Trims WooCommerce Single Product Styles
 * 
 * Custom styles for WooCommerce single product pages
 * Enhances the default WooCommerce product page design
 */

/* ==========================================================================
   Single Product Page Layout
   ========================================================================== */

.single-product-wrapper {
    padding: 100px 0;
    background-color: #f8f9fa;
}

.single-product-area {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ==========================================================================
   Product Gallery
   ========================================================================== */

.product-gallery-wrapper {
    position: sticky;
    top: 30px;
    margin-bottom: 30px;
}

.main-product-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
    margin-bottom: 20px;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.main-product-image:hover img {
    transform: scale(1.05);
}

.product-badges-single {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.product-badges-single .badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-image-zoom {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-image-zoom:hover {
    background: #ffffff;
    color: #667eea;
    transform: scale(1.1);
}

/* Product Thumbnails */
.product-thumbnails {
    display: flex;
    gap: 10px;
    padding: 0 5px;
}

.product-thumbnails .thumbnail-item {
    flex: 1;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.product-thumbnails .thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-thumbnails .thumbnail-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.product-thumbnails .thumbnail-item:hover img {
    transform: scale(1.1);
}

.product-thumbnails .thumbnail-item.active {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Thumbnail Navigation */
.thumbnail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.thumbnail-nav:hover {
    background: #ffffff;
    color: #667eea;
}

.thumbnail-nav.prev {
    left: -15px;
}

.thumbnail-nav.next {
    right: -15px;
}

/* ==========================================================================
   Product Summary
   ========================================================================== */

.product-summary {
    padding: 40px;
}

.product-title-single {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.3;
}

.product-sku {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.product-sku span {
    font-weight: 500;
}

/* Product Rating */
.product-rating-single {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.rating-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-text {
    color: #6c757d;
    font-size: 0.9rem;
}

.rating-text strong {
    color: #495057;
}

.review-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.review-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Product Price */
.product-price-single {
    margin-bottom: 25px;
}

.product-price-single .price {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
}

.product-price-single .price del {
    color: #6c757d;
    font-weight: 400;
    font-size: 1.5rem;
    margin-right: 10px;
}

.product-price-single .price ins {
    background: none;
    text-decoration: none;
}

.price-savings {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

/* Stock Status */
.stock-status-single {
    margin-bottom: 25px;
}

.stock-status-single span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stock-status-single .in-stock {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stock-status-single .out-of-stock {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stock-status-single .backorder {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Product Short Description */
.product-short-description-single {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Product Form */
.product-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #ffffff;
    color: #495057;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #f8f9fa;
    color: #667eea;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
    background: #ffffff;
}

.quantity-input input:focus {
    outline: none;
    background: #f8f9fa;
}

/* Add to Cart Button */
.single_add_to_cart_button {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.single_add_to_cart_button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.single_add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Buy Now Button */
.buy-now-button {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.buy-now-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

/* Product Actions */
.product-actions-single {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.product-action-btn {
    flex: 1;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.product-action-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
}

.product-action-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Product Meta */
.product-meta-single {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.product-meta-single .meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.product-meta-single .meta-item:last-child {
    border-bottom: none;
}

.product-meta-single .meta-label {
    font-weight: 500;
    color: #495057;
}

.product-meta-single .meta-value {
    color: #667eea;
    text-align: right;
}

.product-meta-single .meta-value a {
    color: #667eea;
    text-decoration: none;
}

.product-meta-single .meta-value a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Product Tabs
   ========================================================================== */

.product-tabs-wrapper {
    margin-top: 60px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.product-tabs-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.product-tab-nav {
    flex: 1;
    padding: 20px 30px;
    background: none;
    border: none;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    text-align: center;
}

.product-tab-nav:hover {
    color: #495057;
    background: rgba(102, 126, 234, 0.05);
}

.product-tab-nav.active {
    color: #667eea;
    background: #ffffff;
    border-bottom-color: #667eea;
}

.product-tab-content {
    padding: 40px;
    display: none;
}

.product-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Description Tab */
.product-description {
    line-height: 1.8;
    color: #495057;
}

.product-description h2,
.product-description h3,
.product-description h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.product-description p {
    margin-bottom: 20px;
}

.product-description ul,
.product-description ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.product-description li {
    margin-bottom: 8px;
}

/* Additional Information Tab */
.product-attributes {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.product-attributes th,
.product-attributes td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.product-attributes th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 30%;
}

.product-attributes td {
    color: #667eea;
}

/* Reviews Tab */
.product-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.overall-rating {
    text-align: center;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.rating-stars {
    margin-bottom: 5px;
}

.rating-count {
    font-size: 0.9rem;
    color: #6c757d;
}

.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.rating-bar .stars {
    min-width: 60px;
}

.rating-bar .bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar .bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    transition: width 0.3s ease;
}

.rating-bar .percentage {
    min-width: 35px;
    text-align: right;
    color: #6c757d;
}

.review-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.2rem;
}

.reviewer-details h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.review-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.review-content {
    color: #495057;
    line-height: 1.6;
}

/* ==========================================================================
   Related Products
   ========================================================================== */

.related-products-wrapper {
    margin-top: 60px;
}

.related-products-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    position: relative;
}

.related-products-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 991px) {
    .product-gallery-wrapper {
        position: static;
        margin-bottom: 40px;
    }
    
    .product-summary {
        padding: 30px 20px;
    }
    
    .product-tabs-nav {
        flex-wrap: wrap;
    }
    
    .product-tab-nav {
        flex: 1 1 50%;
        min-width: 200px;
    }
    
    .product-tab-content {
        padding: 30px 20px;
    }
    
    .reviews-summary {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 767px) {
    .single-product-wrapper {
        padding: 60px 0;
    }
    
    .product-title-single {
        font-size: 1.5rem;
    }
    
    .product-price-single .price {
        font-size: 1.5rem;
    }
    
    .product-form {
        padding: 20px;
    }
    
    .quantity-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .product-actions-single {
        flex-direction: column;
    }
    
    .product-tab-nav {
        flex: 1 1 100%;
        min-width: auto;
    }
    
    .review-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .related-products-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .product-summary {
        padding: 20px 15px;
    }
    
    .product-tabs-wrapper {
        margin-top: 40px;
    }
    
    .product-tab-content {
        padding: 20px 15px;
    }
    
    .related-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .review-item {
        padding: 20px;
    }
}

/* ==========================================================================
   WooCommerce Compatibility
   ========================================================================== */

.woocommerce .single-product {
    margin-bottom: 0;
}

.woocommerce div.product div.images {
    margin-bottom: 0;
}

.woocommerce div.product div.summary {
    margin-bottom: 0;
}

.woocommerce div.product .product_title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-size: 2rem;
    color: #e74c3c;
    font-weight: 700;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: #6c757d;
    font-weight: 400;
    font-size: 1.5rem;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    background: none;
    color: #e74c3c;
    text-decoration: none;
}

.woocommerce div.product .stock {
    font-size: 0.9rem;
}

.woocommerce div.product .stock.in-stock {
    color: #28a745;
}

.woocommerce div.product .stock.out-of-stock {
    color: #dc3545;
}

.woocommerce div.product form.cart {
    margin-bottom: 25px;
}

.woocommerce div.product form.cart div.quantity {
    margin: 0 15px 0 0;
}

.woocommerce div.product form.cart .button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.woocommerce div.product form.cart .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.woocommerce div.product .woocommerce-tabs {
    margin-top: 60px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 20px 30px;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: #495057;
    background: rgba(102, 126, 234, 0.05);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #667eea;
    background: #ffffff;
    border-bottom-color: #667eea;
}

.woocommerce div.product .woocommerce-tabs .panel {
    padding: 40px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    margin: 0;
}

.woocommerce div.product .related {
    margin-top: 60px;
}

.woocommerce div.product .related h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    position: relative;
}

.woocommerce div.product .related h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}