/*
 * BuyTuga — CSS personalizado complementar
 * Os carrosséis e imagens de produtos são controlados pelo
 * BuyTuga Home Manager 1.4.0.
 */

/* =====================================================
   HOME — ALINHAMENTO DOS CARTÕES
   ===================================================== */

main section[data-block-id^="ecommerce-product"] .row > .col,
main section[data-block-id^="ecommerce-product"] .swiper-slide {
    height: auto;
}

main section[data-block-id^="ecommerce-product"] .row > .col {
    display: flex;
}

main section[data-block-id^="ecommerce-product"] .tp-product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 14px 16px 18px;
}

main section[data-block-id^="ecommerce-product"] .tp-product-title {
    min-height: 44px;
    margin-bottom: 8px;
    line-height: 1.45;
}

main section[data-block-id^="ecommerce-product"] .tp-product-price-wrapper {
    margin-top: auto;
}

main section[data-block-id^="ecommerce-product"] .tp-section-title {
    letter-spacing: -0.025em;
}

main section[data-block-id="site-features"] {
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
}

@media (max-width: 767px) {
    main section[data-block-id^="ecommerce-product"] .tp-product-content {
        padding: 10px 10px 14px;
    }

    main section[data-block-id^="ecommerce-product"] .tp-product-title {
        min-height: 38px;
        font-size: 13px;
        line-height: 1.4;
    }

    main section[data-block-id^="ecommerce-product"] .tp-product-price {
        font-size: 15px;
    }
}

/* =====================================================
   PÁGINAS INSTITUCIONAIS
   ===================================================== */

body[id^="page-"] main > div > .ck-content {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 960px;
    margin: 0 auto 70px;
    padding: 8px 32px 45px;
    color: #334155;
    font-size: 16px;
    line-height: 1.8;
}

/* Evita um segundo H1 quando o título já aparece no cabeçalho. */
body[id^="page-"] main > div > .ck-content > h1:first-child,
body[id^="page-"] main > div > .ck-content > article > h1:first-child {
    display: none;
}

body[id^="page-"] main > div > .ck-content section {
    margin-bottom: 34px;
}

body[id^="page-"] main > div > .ck-content h2 {
    margin: 38px 0 16px;
    padding: 0 0 10px 15px;
    border-bottom: 1px solid #dce6f0;
    border-left: 4px solid #1769aa;
    color: #123f73;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.4;
}

body[id^="page-"] main > div > .ck-content h3 {
    margin: 28px 0 12px;
    color: #123f73;
    font-size: 19px;
    font-weight: 700;
}

body[id^="page-"] main > div > .ck-content p {
    margin: 0 0 17px;
}

body[id^="page-"] main > div > .ck-content ul,
body[id^="page-"] main > div > .ck-content ol {
    margin: 10px 0 22px;
    padding-left: 25px;
}

body[id^="page-"] main > div > .ck-content li {
    margin-bottom: 10px;
    padding-left: 4px;
}

body[id^="page-"] main > div > .ck-content li::marker {
    color: #1769aa;
}

body[id^="page-"] main > div > .ck-content a {
    color: #1769aa;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

body[id^="page-"] main > div > .ck-content a:hover {
    color: #0d4778;
}

body[id^="page-"] main > div > .ck-content strong {
    color: #1e293b;
}

body[id^="page-"] main > div > .ck-content .bt-updated {
    display: inline-block;
    margin: 0 0 25px;
    padding: 7px 15px;
    border-radius: 30px;
    background: #eef5fc;
    color: #123f73;
    font-size: 14px;
}

/* Cartões da Política de Cookies. */
body[id^="page-"] main > div > .ck-content .bt-cookie-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0 28px;
    padding: 0;
    list-style: none;
}

body[id^="page-"] main > div > .ck-content .bt-cookie-list li {
    margin: 0;
    padding: 19px;
    border: 1px solid #dce6f0;
    border-radius: 10px;
    background: #f8fafc;
}

body[id^="page-"] main > div > .ck-content .bt-cookie-list strong {
    display: block;
    margin-bottom: 6px;
    color: #123f73;
    font-size: 17px;
}

/* Caixa de contacto ou informação. */
body[id^="page-"] main > div > .ck-content .bt-contact-box {
    margin-top: 14px;
    padding: 20px 22px;
    border-left: 4px solid #1769aa;
    border-radius: 8px;
    background: #eef5fc;
}

body[id^="page-"] main > div > .ck-content .bt-contact-box p:last-child {
    margin-bottom: 0;
}

/* Tabelas responsivas. */
body[id^="page-"] main > div > .ck-content table {
    display: block;
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
    overflow-x: auto;
}

body[id^="page-"] main > div > .ck-content th,
body[id^="page-"] main > div > .ck-content td {
    padding: 12px 14px;
    border: 1px solid #dce6f0;
    text-align: left;
}

body[id^="page-"] main > div > .ck-content th {
    background: #123f73;
    color: #fff;
}

body[id^="page-"] main > div > .ck-content hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #dce6f0;
}

@media (max-width: 700px) {
    body[id^="page-"] main > div > .ck-content {
        width: calc(100% - 20px);
        margin-bottom: 45px;
        padding: 4px 14px 30px;
        font-size: 15px;
        line-height: 1.7;
    }

    body[id^="page-"] main > div > .ck-content h2 {
        margin-top: 30px;
        padding-left: 11px;
        font-size: 20px;
    }

    body[id^="page-"] main > div > .ck-content .bt-cookie-list {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   PRODUTOS — IMAGENS COMPLETAS SEM RECORTE (2026-09-05)
   ===================================================== */
:is(
    .tp-product-thumb,
    .tp-product-item-thumb,
    .product-thumbnail,
    .product-image,
    [class*="product-thumb"],
    [class*="product-image"]
) {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
}

:is(
    .tp-product-thumb,
    .tp-product-item-thumb,
    .product-thumbnail,
    .product-image,
    [class*="product-thumb"],
    [class*="product-image"]
) img:not(.avatar):not([class*="icon"]) {
    display: block;
    width: 100% !important;
    height: 100% !important;
    padding: 12px;
    object-fit: contain !important;
    object-position: center !important;
}

.bb-product-gallery-images .slick-list,
.bb-product-gallery-images .slick-track,
.bb-product-gallery-images .slick-slide {
    min-height: 440px;
    max-height: 520px;
}

.bb-product-gallery-images .slick-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.bb-product-gallery-images .slick-slide img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: 520px;
    padding: 12px;
    object-fit: contain !important;
    object-position: center !important;
}

.bb-product-gallery-thumbnails .slick-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.bb-product-gallery-thumbnails .slick-slide img,
.sticky-actions-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

@media (max-width: 767px) {
    .bb-product-gallery-images .slick-list,
    .bb-product-gallery-images .slick-track,
    .bb-product-gallery-images .slick-slide {
        min-height: 320px;
        max-height: 420px;
    }

    .bb-product-gallery-images .slick-slide img {
        max-height: 420px;
    }
}

/* Galeria: miniaturas compactas e proporcionais */
.bb-product-gallery-thumbnails .slick-slide {
    width: 78px !important;
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    aspect-ratio: 1 / 1;
}

.bb-product-gallery-thumbnails .slick-slide img {
    width: 100% !important;
    height: 100% !important;
    padding: 4px;
    object-fit: contain !important;
}

/* =====================================================
   HOME — PRODUTOS INTEIROS NOS CARTOES (2026-09-05)
   ===================================================== */
.tp-product-thumb > a {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
}

.tp-product-thumb > a > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
}

.buytuga-smart-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
}

.buytuga-smart-image > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* Home: cartões inteligentes com imagem contida */
.buytuga-smart-card > a.buytuga-smart-image {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
}

.buytuga-smart-card > a.buytuga-smart-image > img {
    position: absolute !important;
    inset: 12px !important;
    width: calc(100% - 24px) !important;
    height: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    max-height: calc(100% - 24px) !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* BUY TUGA — LOGÓTIPOS DE PAGAMENTO NO CHECKOUT */
.checkout-section--payment .payment-method-logo:has(img[src*="buytuga-pagamentos-online"]) {
    width: 300px !important;
    max-width: calc(100% - 170px) !important;
    height: auto !important;
    top: 9px !important;
    right: 12px !important;
}

.checkout-section--payment .payment-method-logo img[src*="buytuga-pagamentos-online"] {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: 38px !important;
    object-fit: contain !important;
    object-position: center right !important;
}

@media (max-width: 575.98px) {
    .checkout-section--payment .payment-method-logo:has(img[src*="buytuga-pagamentos-online"]) {
        right: 8px !important;
        max-width: calc(100% - 165px) !important;
    }
}