/**
 * MATOO Single Product Page Styles
 *
 * @package Matoo_Marketplace
 * @since 4.3.0
 */

/* ============================================
   HIDE MAIN MENU ON SINGLE PRODUCT
   ============================================ */

.matoo-single-product .main-menu,
.matoo-single-product .header-bottom,
.matoo-single-product .main-nav,
.matoo-single-product nav.main-nav,
.matoo-single-product .menu-container,
.matoo-single-product .header .main-menu-container,
.matoo-single-product .riode-main-menu,
.matoo-single-product .primary-menu,
.matoo-single-product .site-navigation,
.matoo-single-product .header-middle .main-menu,
.matoo-single-product .header-bottom .main-menu {
    display: none !important;
}

/* Hide Elementor custom header on single product (uses body class directly) */
body.matoo-single-product .custom-menu,
body.single-product .custom-menu {
    display: none !important;
}

/* Keep header minimal */
.matoo-single-product .site-header,
.matoo-single-product .header {
    border-bottom: 1px solid #eee;
}

/* ============================================
   PAGE CONTAINER
   ============================================ */

.matoo-single-product-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    background: #fff;
}

/* ============================================
   BACK HEADER
   ============================================ */

.matoo-back-header {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.matoo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #414141;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.matoo-back-link:hover {
    color: #5E6A60;
    text-decoration: none;
}

.matoo-back-link svg {
    flex-shrink: 0;
}

/* ============================================
   MAIN CONTAINER - TWO COLUMNS
   ============================================ */

.matoo-single-product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

/* ============================================
   LEFT COLUMN - GALLERY WITH VERTICAL THUMBS
   ============================================ */

.matoo-product-gallery {
    position: sticky;
    top: 24px;
    align-self: start;
    display: flex;
    gap: 16px;
}

/* Thumbnails on LEFT (vertical) */
.matoo-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    max-height: 500px;
    overflow-y: auto;
}

.matoo-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.matoo-thumb:hover {
    border-color: #ccc;
}

.matoo-thumb.active {
    border-color: #5E6A60;
}

.matoo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Image */
.matoo-gallery-main {
    position: relative;
    background: #f8f8f8;
    border-radius: 16px;
    overflow: hidden;
    flex: 1;
    aspect-ratio: 1 / 1;
    max-width: 500px;
}

.matoo-main-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matoo-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Wishlist on gallery - Using same system as cards */
.matoo-gallery-wishlist {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}

.matoo-gallery-wishlist .matoo-card-wishlist-wrap {
    position: relative;
}

.matoo-gallery-wishlist .matoo-yith-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.matoo-gallery-heart {
    width: 44px !important;
    height: 44px !important;
    background: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.matoo-gallery-heart:hover {
    background: #f5f5f5 !important;
    transform: scale(1.05);
}

.matoo-gallery-heart .heart-empty {
    color: #bdbdbd;
    display: block;
}

.matoo-gallery-heart .heart-filled {
    color: #5E6A60;
    display: none;
}

.matoo-gallery-heart:hover .heart-empty {
    color: #5E6A60;
}

.matoo-gallery-heart.in-wishlist .heart-empty {
    display: none;
}

.matoo-gallery-heart.in-wishlist .heart-filled {
    display: block;
}

/* ============================================
   RIGHT COLUMN - PRODUCT INFO
   ============================================ */

.matoo-product-info {
    padding-top: 8px;
}

/* Condition badge on gallery */
.matoo-gallery-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.matoo-condition-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Price */
.matoo-product-price {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.matoo-product-price del {
    color: #9e9e9e;
    font-size: 24px;
    font-weight: 400;
    margin-right: 12px;
}

.matoo-product-price ins {
    text-decoration: none;
    color: #007B20;
}

/* Title */
.matoo-product-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.3;
}

/* Tags */
.matoo-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.matoo-tag-pill {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #414141;
}

.matoo-tag-link {
    text-decoration: none;
    transition: all 0.2s ease;
}

.matoo-tag-link:hover {
    background: #5E6A60;
    border-color: #5E6A60;
    color: #fff;
    text-decoration: none;
}

/* ============================================
   VENDOR BOX
   ============================================ */

.matoo-vendor-box {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.matoo-vendor-box-header {
    margin-bottom: 12px;
}

.matoo-vendor-label {
    font-size: 12px;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matoo-vendor-box-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.matoo-vendor-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.matoo-vendor-link:hover {
    text-decoration: none;
}

.matoo-vendor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #E1DBCB;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.matoo-vendor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.matoo-vendor-initials {
    font-size: 16px;
    font-weight: 600;
    color: #5E6A60;
}

.matoo-vendor-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.matoo-vendor-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.matoo-vendor-city {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #757575;
}

.matoo-vendor-city svg {
    width: 14px;
    height: 14px;
}

.matoo-vendor-profile-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #414141;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.matoo-vendor-profile-btn:hover {
    border-color: #5E6A60;
    color: #5E6A60;
    text-decoration: none;
}

.matoo-vendor-stats {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
}

.matoo-vendor-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #757575;
}

.matoo-vendor-stat strong {
    color: #1a1a1a;
    font-weight: 600;
}

.matoo-vendor-stat svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   PRODUCT SECTIONS (Description, Details)
   ============================================ */

.matoo-product-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.matoo-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
}

.matoo-product-description {
    font-size: 15px;
    line-height: 1.6;
    color: #414141;
}

.matoo-product-description p {
    margin: 0 0 12px;
}

.matoo-product-description p:last-child {
    margin-bottom: 0;
}

/* Details table */
.matoo-product-details {
    display: flex;
    flex-direction: column;
}

.matoo-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #e8e8e8;
}

.matoo-detail-row:last-child {
    border-bottom: none;
}

.matoo-detail-label {
    font-size: 14px;
    color: #757575;
}

.matoo-detail-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: right;
}

/* ============================================
   SOCIAL ACTIONS
   ============================================ */

.matoo-social-actions {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    margin-bottom: 24px;
}

.matoo-social-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #757575;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.matoo-social-item:hover {
    color: #5E6A60;
}

.matoo-social-item svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.matoo-product-actions {
    display: flex;
    gap: 12px;
}

.matoo-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.matoo-btn-secondary {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #414141;
}

.matoo-btn-secondary:hover {
    border-color: #5E6A60;
    color: #5E6A60;
}

.matoo-btn-primary {
    background: #5E6A60;
    color: #fff;
}

.matoo-btn-primary:hover {
    background: #4d574d;
}

.matoo-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   RELATED SECTIONS - HORIZONTAL SLIDERS
   ============================================ */

.matoo-related-sections {
    border-top: 1px solid #f0f0f0;
    padding-top: 48px;
    margin-top: 48px;
}

.matoo-related-section {
    margin-bottom: 48px;
}

.matoo-related-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 24px;
}

/* Slider Container */
.matoo-related-slider {
    position: relative;
    overflow: hidden;
}

.matoo-slider-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
    /* Touch improvements */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.matoo-slider-track::-webkit-scrollbar {
    display: none;
}

.matoo-slider-track > li,
.matoo-slider-track > .product-wrap,
.matoo-slider-track > .matoo-card-wrap {
    flex: 0 0 calc(25% - 15px);
    min-width: 220px;
    max-width: 280px;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    scroll-snap-align: start;
}

/* Slider Navigation */
.matoo-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.matoo-slider-nav:hover {
    background: #5E6A60;
    border-color: #5E6A60;
    color: #fff;
}

.matoo-slider-nav:hover svg {
    stroke: #fff;
}

.matoo-slider-prev {
    left: 0;
}

.matoo-slider-next {
    right: 0;
}

.matoo-slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Legacy grid - fallback */
.matoo-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.matoo-related-grid > li {
    list-style: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .matoo-single-product-container {
        gap: 32px;
    }
    
    .matoo-slider-track > li,
    .matoo-slider-track > .product-wrap,
    .matoo-slider-track > .matoo-card-wrap {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 991px) {
    .matoo-single-product-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .matoo-product-gallery {
        position: relative;
        top: 0;
        flex-direction: column-reverse;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .matoo-gallery-thumbs {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        justify-content: flex-start;
    }
    
    .matoo-gallery-main {
        max-width: 100%;
    }
    
    .matoo-slider-track > li,
    .matoo-slider-track > .product-wrap,
    .matoo-slider-track > .matoo-card-wrap {
        flex: 0 0 calc(33.333% - 14px);
        min-width: 200px;
    }
}

@media (max-width: 767px) {
    .matoo-single-product-page {
        padding: 0 16px;
    }
    
    .matoo-back-header {
        padding: 12px 0;
        margin-bottom: 16px;
    }
    
    .matoo-product-price {
        font-size: 28px;
    }
    
    .matoo-product-title {
        font-size: 20px;
    }
    
    .matoo-vendor-box-content {
        flex-wrap: wrap;
    }
    
    .matoo-vendor-profile-btn {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
    
    .matoo-vendor-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .matoo-social-actions {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .matoo-product-actions {
        flex-direction: column;
    }
    
    .matoo-btn {
        padding: 14px 20px;
    }
    
    .matoo-slider-track > li,
    .matoo-slider-track > .product-wrap,
    .matoo-slider-track > .matoo-card-wrap {
        flex: 0 0 calc(50% - 10px);
        min-width: 160px;
    }
    
    .matoo-slider-nav {
        display: none;
    }
    
    .matoo-thumb {
        width: 60px;
        height: 60px;
    }
    
    .matoo-gallery-heart {
        width: 40px !important;
        height: 40px !important;
    }
}

@media (max-width: 480px) {
    .matoo-product-price {
        font-size: 24px;
    }
    
    .matoo-product-title {
        font-size: 18px;
    }
    
    .matoo-section-title {
        font-size: 16px;
    }
    
    .matoo-related-title {
        font-size: 18px;
    }
}

/* ============================================
   FIX: Remove WooCommerce default styles
   ============================================ */

.matoo-single-product-page .woocommerce-breadcrumb,
.matoo-single-product-page .product_meta,
.matoo-single-product-page .woocommerce-tabs,
.matoo-single-product-page .related.products,
.matoo-single-product-page .upsells.products {
    display: none !important;
}

/* Ensure our styles take priority */
.matoo-single-product .site-main,
.matoo-single-product .content-area {
    padding: 0 !important;
}