@import url('interactions.css');
@import url('../../css/nav-button.css');

/* =========================================
   SYNTHOIL MARKETPLACE STYLES
   Specific styles for the e-commerce section
   ========================================= */

:root {
    --market-bg: #f8fbff;
    /* Fundo levemente azulado para limpeza clinica industrial */
    --market-white: #ffffff;
    --market-border: #e8ecf1;
    --market-text: #2c3e50;
    --market-green: #00a650;
    /* Mercado Livre Green-ish */
    --market-blue: #3483fa;
    /* Mercado Livre Blue-ish */
}

body {
    background-color: var(--market-bg);
}

.market-wrapper {
    padding-top: 120px;
    /* Header space */
    padding-bottom: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Specific Marketplace Header */
.market-topbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    /* Clean glassmorphism effect */
    border-top: 4px solid #fff159;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 1050;
    /* Garante que fique acima da buy-box sticky */
}

.market-topbar .nav-link {
    color: #333 !important;
    /* Force dark text */
}

.market-topbar .mobile-toggle {
    color: #333 !important;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #333;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 5px;
    color: #999;
}

/* Product Detail Grid */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Precise width for buy-box on desktop */
    gap: 40px;
    background: var(--market-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 1100px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.product-detail-grid:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

/* Gallery Section */
.gallery-section {
    display: flex;
    gap: 20px;
}

.gallery-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumbnail-item {
    width: 65px;
    height: 65px;
    border: 1px solid var(--market-border);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    padding: 2px;
    background: #fff;
    position: relative;
    transition: all 0.25s ease;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    border-color: var(--market-blue);
    border-width: 2px;
    box-shadow: 0 0 10px rgba(52, 131, 250, 0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail-item .video-play-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

@media (max-width: 900px) {
    .gallery-section {
        flex-direction: column;
    }

    .gallery-thumbnails {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }

    .thumbnail-item {
        flex: 0 0 70px;
    }
}

.gallery-main {
    flex-grow: 1;
    width: 100%;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--market-border);
}

.gallery-main img,
.gallery-main video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-main video {
    outline: none;
    width: 100%;
    height: 100%;
}

.gallery-main:not(.is-video) {
    cursor: zoom-in;
}

.gallery-main:not(.is-video).is-zoomed img {
    transform: scale(2.5);
    /* Lupa ratio */
    cursor: move;
    /* Fallback */
    cursor: grab;
}

.gallery-main:not(.is-video).is-zoomed:active img {
    cursor: grabbing;
}

.gallery-main.is-video {
    cursor: default;
}

.gallery-main.is-video:hover img {
    transform: none;
}

/* Zoom Hint Icon */
.zoom-hint-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: var(--market-text);
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}

.gallery-main.is-zoomed .zoom-hint-icon {
    opacity: 0;
}

/* Info Section (Left Column below Gallery usually, but here we stack) */
.product-main-info {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--market-border);
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--market-text);
}

.description-content {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 40px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.specs-table tr:nth-child(odd) {
    background-color: #f9f9f9;
}

.specs-table th,
.specs-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.specs-table th {
    width: 200px;
    color: #333;
    font-weight: 600;
}

/* Questions Section */
.questions-section {
    margin-top: 40px;
}

.search-bar-questions {
    display: flex;
    margin-bottom: 20px;
}

.search-bar-questions input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--market-border);
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-bar-questions button {
    padding: 0 20px;
    background: var(--market-blue);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.question-item {
    margin-bottom: 20px;
}

.q-user {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.q-text {
    margin-bottom: 5px;
    color: #555;
    position: relative;
    padding-left: 20px;
}

.q-text::before {
    content: 'P:';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #999;
}

.a-text {
    color: #666;
    /* Muted text */
    padding-left: 20px;
    position: relative;
}

.a-text::before {
    content: 'R:';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #999;
}

/* Buy Box (Right Column) */
.buy-box {
    border: 1px solid var(--market-border);
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    height: fit-content;
    box-sizing: border-box;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    position: static;
}

.product-condition {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.product-title-main {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
}

.price-tag {
    font-size: 36px;
    font-weight: 300;
    color: var(--market-text);
    margin-bottom: 5px;
}

.price-installments {
    font-size: 16px;
    color: var(--market-green);
    margin-bottom: 20px;
}

.price-installments span {
    font-weight: 600;
}

.shipping-info {
    color: var(--market-green);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-info {
    font-weight: 600;
    margin-bottom: 20px;
}

.btn-buy-now {
    width: 100%;
    padding: 16px;
    background: var(--market-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.btn-buy-now:hover {
    background: #2968c8;
}

.btn-add-cart {
    width: 100%;
    padding: 16px;
    background: rgba(65, 137, 230, 0.15);
    color: var(--market-blue);
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-cart:hover {
    background: rgba(65, 137, 230, 0.25);
}

.seller-info {
    margin-top: 30px;
    border-top: 1px solid #f0f0f0;
    padding-top: 24px;
}

.seller-title {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
}

.reputation-bar {
    display: flex !important;
    gap: 0 !important;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    background: linear-gradient(to right,
            #ffcccc 0%, #ffcccc 16.66%,
            #ffdb99 16.66%, #ffdb99 33.33%,
            #fdfd96 33.33%, #fdfd96 50%,
            #c9f784 50%, #c9f784 66.66%,
            #39b54a 66.66%, #39b54a 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    border: none !important;
}

.rep-segment {
    flex: 1;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    height: 100%;
}

.rep-5 {
    flex: 2;
}

.rep-1,
.rep-2,
.rep-3,
.rep-4,
.rep-5 {
    background: transparent !important;
}

.seller-badges {
    font-size: 13px;
    color: #666;
}

.badge-platinum {
    color: #00a650;
    font-weight: 600;
}

/* Current lvl */

/* Buy Box Additions */
.contact-box-info {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(145deg, #f9fcff, #f0f6fc);
    border-radius: 8px;
    border-left: 4px solid var(--market-blue);
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.2s ease;
}

.contact-box-info:hover {
    transform: translateX(5px);
    /* Micro animação */
}

.contact-box-title {
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
}

.contact-box-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0;
}

.guarantee-info {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .product-detail-grid {
        display: flex;
        flex-direction: column;
    }

    .left-column {
        display: contents;
    }

    .gallery-section {
        order: 1;
        flex-direction: column-reverse;
    }

    .gallery-thumbnails {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        /* Pro-Max Fix: Prevent horizontal overflow */
        width: 100%;
        margin-top: 15px;
    }

    .buy-box {
        position: static;
        order: 2;
        margin-top: 20px;
        padding: 16px;
        /* Reduced padding on mobile */
    }

    .product-main-info {
        order: 3;
    }

    #faq-system-root,
    .questions-section {
        order: 4;
        width: 100%;
    }

    .contact-box-info {
        padding: 12px !important;
        /* Force smaller padding overrides from inline HTML */
        margin: 15px 0 !important;
    }

    .btn-contact-whatsapp {
        padding: 12px;
        /* Smaller button height */
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        /* Global overflow safety */
    }

    .market-wrapper {
        padding: 90px 10px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .product-detail-grid {
        padding: 15px;
        /* Reduce padding on mobile */
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .market-grid {
        grid-template-columns: 1fr !important;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .gallery-main img,
    .gallery-main video {
        max-height: 300px;
    }

    .gallery-thumbnails {
        gap: 6px;
    }

    .thumbnail-item {
        width: 50px;
        height: 50px;
    }
}

/* Sticky Mobile Buy Bar */
.mobile-sticky-buy {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    box-sizing: border-box;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #eee;
}

@media (max-width: 992px) {
    .mobile-sticky-buy {
        display: flex;
    }

    .market-wrapper {
        padding-bottom: 90px;
    }
}

/* Marketplace Layout (Categories) */
.market-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

@media (max-width: 1024px) {
    .market-layout {
        grid-template-columns: 1fr;
    }

    .market-sidebar {
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .market-wrapper {
        padding-top: 100px;
    }
}