/* ===== TOOLTIPS ===== */
.custom-tooltip+.tooltip>.tooltip-inner {
    background-color: #fcf8e3;
    color: black;
}

/* ===== PRODUCT INFO ===== */
.product-info {
    color: #000000;
}

.produto-titulo {
    font-size: 24px;
    color: var(--julio-primary-alternative);
}

.produto-vendido-por {
    color: var(--julio-primary-dark) !important;
    margin-bottom: 0 !important;
    line-height: 14px;
}

.produto-marca-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.produto-codigo,
.page-title h3 {
    color: var(--julio-primary-dark) !important;
}

.produto-marca-imagem {
    width: 100px;
    height: auto;
}

.pro-ext-attributes * {
    color: var(--julio-primary-dark);
}

.pro-ext-attributes {
    margin-bottom: 0 !important;
    position: relative;
    overflow-x: auto;
}

.pro-ext-attributes p {
    font-weight: normal !important;
}

/* ===== ADD TO CART BUTTON ===== */
.add-to-cart-btn {
    margin: unset !important;
}

.add-to-cart-btn i {
    margin-right: 12px;
}

/* ===== MAIN IMAGE ===== */
.main-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease;
    margin: auto;
    margin-bottom: 16px;
}

.main-image.with-expand {
    cursor: zoom-in;
}

.main-image:hover {
    transform: scale(1.01);
}

.main-image-container {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* ===== GALLERY ===== */
#gallery_01 img {
    border: 2px solid white;
    margin: auto;
}

#gallery_01 button {
    width: 100%;
    height: 120px;
    border: unset;
}

#gallery_01 button#video i.icofont {
    font-size: 72px;
    color: var(--julio-primary-alternative);
}

#gallery_01 .col-md-2 .area,
#gallery_01 .col-xs-6 .area {
    border: 1px solid lightgray;
    border-radius: 5px;
    box-shadow: 0 0 10px lightgray;
    transition: all 0.3s;
    scale: 0.98;
    cursor: pointer;
}

#gallery_01 .col-md-2 .area:hover,
#gallery_01 .col-xs-6 .area:hover {
    scale: 1;
}

#gallery_01 .col-md-2 .active.area,
#gallery_01 .col-xs-6 .active.area {
    box-shadow: 0 0 10px var(--julio-primary);
    scale: 1.02;
}

#gallery_01 img .active {
    border: unset !important;
}

/* ===== NEW SINGLE PRODUCT ===== */
.new-single-product .pro-badge {
    color: #fff;
    text-transform: uppercase;
    position: absolute;
    top: 0;
    right: 0;
    line-height: 14px;
    padding: 6px 18px;
    background: var(--julio-primary);
    z-index: 2;
}

.new-single-product {
    min-height: 340px !important;
    box-shadow: 0 0 10px lightgrey;
    padding: 8px;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.new-single-product:hover {
    box-shadow: 0 0 10px var(--julio-primary-alternative);
    scale: 1.05;
}

.new-single-product .produto-body {
    min-height: unset !important;
    margin-top: 16px;
}

.new-single-product .precos .sem-cupom,
.new-single-product .precos .com-cupom {
    text-align: center;
    padding: 8px 6px;
    border-radius: 1px;
    margin-bottom: 2px;
    letter-spacing: 0;
}

.new-single-product .precos .sem-cupom *,
.new-single-product .precos .com-cupom * {
    font-size: 10px;
}

.new-single-product .precos .sem-cupom {
    background: #f8f9fa;
}

.new-single-product .precos .com-cupom {
    background: var(--julio-secondary-lighter);
}

.new-single-product .precos .sem-cupom strong {
    color: #858585;
}

.new-single-product .precos .com-cupom * {
    color: var(--julio-primary-med);
}

.new-single-product .precos .com-cupom strong,
.new-single-product .precos .sem-cupom strong {
    font-size: 2rem;
}

.new-single-product .auth-btn {
    font-size: 12px;
    white-space: pre-wrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
}

.new-single-product h4 {
    --max-lines: 3;
    --line-height: 20px;
    max-height: calc(var(--line-height) * var(--max-lines));
    min-height: calc(var(--line-height) * var(--max-lines));
    font-size: 14px;
    text-align: left;
    line-height: var(--line-height);
    color: var(--julio-primary-alternative) !important;
    font-weight: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: var(--max-lines);
    line-clamp: var(--max-lines);
    -webkit-box-orient: vertical;
    box-orient: vertical;
    -moz-box-orient: vertical;
}

.new-single-product h4 * {
    color: var(--julio-primary-alternative);
}

/* ===== PRODUCT DETAILS ===== */
#product-details .preco-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 18px;
}

#product-details .preco-container .preco {
    --tooltip-size: 10px;
    --tooltip-padding: 8px;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    background-color: #f8f9fa;
    min-width: 120px;
    max-width: 40vw;
    width: fit-content;
    text-wrap: nowrap;
}

#product-details .preco-container .preco[data-stvalue] {
    cursor: help;
}

#product-details .preco-container .preco[data-stvalue]::after {
    content: "ST de: R$ " attr(data-stvalue);
    position: absolute;
    font-size: var(--tooltip-size);
    line-height: var(--tooltip-size);
    padding: var(--tooltip-padding);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    min-width: 100%;
    text-align: center;
    background-color: lightgray;
    border: 1px solid grey;
    top: 0;
    left: 0;
    border-radius: 10px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: bold;
    text-wrap: nowrap;
}

#product-details .preco-container .preco[data-stvalue]:hover::after {
    opacity: 1;
    top: calc(((var(--tooltip-size) + var(--tooltip-padding)) / -1) - 16px);
}

#product-details .preco-container .preco * {
    color: grey;
}

#product-details .preco-container .preco.highlight,
#product-details .preco-container .preco[data-stvalue].highlight::after {
    background-color: var(--julio-secondary-lighter);
    color: var(--julio-primary-med);
}

#product-details .preco-container .preco.highlight * {
    color: var(--julio-primary-med);
}

#product-details .preco-container .preco div {
    font-size: 2rem;
}

/* ===== BUTTONS ===== */
button.btn.add-to-card {
    height: 45px;
    background-color: var(--julio-primary-dark);
    transition: all 0.3s ease-in-out;
    display: inline-flex;
    padding: 8px 24px;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

button.btn.add-to-card:hover {
    background-color: var(--julio-primary-alternative);
}

button.btn.add-to-card,
button.btn.add-to-card * {
    color: white;
    font-size: 16px;
    line-height: 16px;
}

/* ===== MODAL ===== */
#expanded-modal .modal-content {
    --border: 1px solid lightgray;
    padding: 8px;
    position: relative;
}

#expanded-modal .modal-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
}

#expanded-modal .modal-main:active {
    cursor: grabbing;
}

#expanded-modal .modal-main.zoomed {
    cursor: move;
}

#expanded-modal .modal-main img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    margin: auto;
    border: unset;
    object-fit: contain;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

#expanded-modal .modal-main img.zoomed {
    cursor: zoom-out;
}

#expanded-modal .modal-main.with-border {
    border-right: var(--border);
}

#expanded-modal .modal-gallery {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    max-height: 90vh;
    height: 100%;
    overflow: auto;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--julio-primary-alternative) lightgray;
}

#expanded-modal .modal-gallery::-webkit-scrollbar {
    width: 4px;
}

#expanded-modal .modal-gallery::-webkit-scrollbar-track {
    background: lightgray;
}

#expanded-modal .modal-gallery::-webkit-scrollbar-thumb {
    background: var(--julio-primary-alternative);
    border-radius: 10px;
}

#expanded-modal .modal-gallery.with-border {
    border-left: var(--border);
}

#expanded-modal .modal-gallery img {
    cursor: zoom-in;
    margin: unset;
    box-shadow: 0 0 10px lightgrey;
    transition: all 0.3s ease-in-out;
    max-width: 80px;
    max-height: 80px;
    border: none;
    border-radius: 4px;
}

#expanded-modal .modal-gallery img:hover {
    box-shadow: 0 0 10px var(--julio-primary-alternative);
    scale: 1.1;
    opacity: 0.7;
}

#expanded-modal .close-btn {
    --size: 36px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--julio-primary-dark);
    box-shadow: 0 0 10px white;
    position: absolute;
    top: calc(var(--size) / -2);
    right: calc(var(--size) / -2);
    transition: all 0.3s ease-in-out;
}

#expanded-modal .close-btn * {
    color: white;
}

#expanded-modal .close-btn:hover {
    background-color: var(--julio-primary-alternative);
    scale: 1.1;
}



.zoom-info {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.zoom-help {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

/* ===== THUMBNAIL CONTAINERS ===== */
.thumbnail-container {
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    position: relative;
}

.thumbnail-container:hover {
    opacity: 0.8;
}

.thumbnail-container.active {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ===== VIDEO THUMBNAILS ===== */
.video-thumbnail-container {
    position: relative;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.video-thumbnail-container:hover {
    opacity: 0.8;
}

.video-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* ===== GALLERY LAYOUT ===== */
.gallery-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.gallery-item {
    flex: 0 0 auto;
}

/* ===== OBJECT-FIT FALLBACK ===== */
.no-object-fit .thumbnail-container {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.no-object-fit .thumbnail-container img {
    opacity: 0;
}

/* ===== DESKTOP GALLERY LAYOUT ===== */
@media (min-width: 768px) {
    .desktop-gallery {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: flex-start;
        margin-top: 20px;
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media screen and (max-width: 767px) {
    .add-to-cart-btn {
        width: 100%;
    }

    .produto-codigo {
        margin-top: 12px;
    }

    #gallery_01 .col-md-2 .area,
    #gallery_01 .col-xs-6 .area {
        margin-bottom: 12px;
    }

    .produto-titulo {
        margin-bottom: 16px !important;
    }

    #expanded-modal .modal-main img {
        max-height: 60vh;
        object-fit: contain;
        touch-action: pinch-zoom;
    }
    
    .zoom-info {
        bottom: 10px;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .zoom-help {
        bottom: 35px;
        font-size: 10px;
        padding: 4px 8px;
    }

    #expanded-modal .modal-main {
        border-bottom: var(--border);
        border-right: unset !important;
        overflow: hidden;
        touch-action: pinch-zoom;
    }

    #expanded-modal .modal-content {
        margin-top: 32px;
    }

    #expanded-modal .modal-gallery {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow: auto;
        justify-content: unset;
        max-height: 30vh;
        max-width: 100%;
        padding: 16px;
        border-left: unset !important;
    }

    #expanded-modal .close-btn {
        right: calc(var(--size) / -3);
    }

    #product-details .preco-container:has(.preco[data-stvalue]) {
        margin-top: 48px;
    }

    #product-details .preco-container {
        justify-content: center;
    }

    #product-details .preco-container .preco[data-stvalue]::after {
        opacity: 1 !important;
        top: calc(((var(--tooltip-size) + var(--tooltip-padding)) / -1) - 16px);
    }

    button.btn.add-to-card {
        width: 100%;
    }

    .new-single-product .precos .sem-cupom *,
    .new-single-product .precos .com-cupom * {
        font-size: 14px;
    }

    .new-single-product h4 {
        max-height: unset;
        min-height: unset;
        overflow: visible;
        height: fit-content;
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        -webkit-box-orient: unset;
        box-orient: unset;
        -moz-box-orient: unset;
    }
    
    .thumbnail-container {
        width: 100px;
        height: 100px;
    }
    
    .video-thumbnail-container {
        width: 100px;
        height: 100px;
    }
}