/**
 * MyP Produto Card Styles
 */

.product-card {
    position: relative;
    overflow: visible; /* Permite que elementos posicionados transbordem */
    z-index: 1; /* Base z-index para o card */
}
.product-card:hover {
    z-index: 1000; /* Aumenta o z-index quando hover */
}
/* Estilo do material exibido no canto superior esquerdo */
.product-material {
    position: absolute;
    top: 2px;
    left: 5px;
    z-index: 1100;
    font-size: 0.9em;
}

/* Estilo mais específico para as imagens de cores para evitar conflitos */
.woocommerce ul.products li.product .top-color-options img.color-image,
.woocommerce-page ul.products li.product .top-color-options img.color-image {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    object-fit: cover !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.top-color-options .more-colors {
    font-size: 14px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    width: 25px !important;
    height: 25px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.astra-shop-thumbnail-wrap {
    position: relative;
}
.product-details-inline {
    margin-top: 75px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 6px 6px;
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1001; /* Maior que o z-index do hover */
}

/* Quando o preço não estiver presente no HTML, aproximar os detalhes do topo */
.product-card:not(:has(.woocommerce-Price-amount)) .product-details-inline,
.product-card:has(.price-container:empty) .product-details-inline {
    margin-top: 45px!important;
}
/* Fallback amplo: usa classe adicionada via JS quando o preço não existe/está oculto */
.product-card.no-price .product-details-inline {
    margin-top: 45px !important;
}
.product-card:hover .product-details-inline {
    display: block;
}
.product-details p.detail-text {
    margin: 5px 0;
}
.diameter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.diameter-value {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
}
.stone-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}
.stone-image {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 2px;
}
/* Título com altura fixa */
.fixed-height-title {
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    margin-bottom: 8px !important;
    min-height: 2.8em;
}
.diameter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 5px;
    justify-content: center;
}
.diameter-item {
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.6em;
    text-align: center;
}
.attribute-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
}
.inline-options {
    display: inline-flex;
    gap: 4px;
    flex-wrap: nowrap;
    flex: 1;
    justify-content: center;
}
.divider {
    height: 1px;
    background: #ddd;
    margin: 4px 0;
    width: 100%;
}

.expand-trigger {
    cursor: pointer;
    color: #666;
    padding: 5px;
    font-weight: bold;
}
.expanded-content {
    transition: all 0.3s ease;
}
.detail-text {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
    min-width: fit-content;
}
.product-details {
    display: none;
}
.zoom-icon {
    display: inline-block;
    margin-top: 8px;
    color: #666;
    text-decoration: none;
}
.woocommerce-js ul.products li.product .price,
.woocommerce-page ul.products li.product .price,
.product-carousel li.product-card .price,
li.product.product-card .price {
    font-family: "Manrope", Sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
}
.woocommerce-loop-product__title {
    font-size: 1em !important;
    line-height: 1.4;
}
.stone-options-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stone-options-row {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
}

.stone-image {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 2px;
}

/* Estilos específicos para o carrossel de produtos */
.product-carousel .product-card {
    position: relative;
    overflow: visible;
    z-index: 1;
}

.product-carousel .product-card:hover {
    z-index: 1000;
}






.product-carousel .product-card:hover .product-details-inline {
    display: block;
}

.astra-shop-thumbnail-wrap img {
margin-top: 0;
}

/* Remover os estilos da thumbnail-colors antiga para evitar conflitos */
.thumbnail-colors {
    display: none !important;
}

/* Ajuste para compatibilidade com o carrossel */
.product-carousel .woocommerce-loop-product__title.formatted-title.fixed-height-title {
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    margin-bottom: 8px !important;
    min-height: 2.8em;
}

/* Ajustes para o botão add to cart e quickview no carrossel */
.product-carousel .ast-on-card-button {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.product-carousel .product-card:hover .ast-on-card-button {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Garantir compatibilidade também com botões fora do carrossel */
.ast-on-card-button.ast-quick-view-trigger {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.product-card:hover .ast-on-card-button {
    opacity: 1;
    visibility: visible;
}

/* Título com altura fixa - Estilo padrão para todos os cards */
.woocommerce-loop-product__title.formatted-title,
.fixed-height-title {
    color: #464646;
    font-family: "Manrope", Sans-serif !important;
    letter-spacing: 0.8px;
    font-size: 1em !important;
    line-height: 1.4;
    margin-bottom: 8px !important;
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
}

/* Corrigir conflito de margin-top nas imagens dos produtos */
.astra-shop-thumbnail-wrap .attachment-woocommerce_thumbnail,
.astra-shop-thumbnail-wrap .wp-post-image {
    margin-top: 20px;
}

/* Garantir que imagens de cor não tenham margin-top */
.top-color-options img.color-image,
.thumbnail-colors img.color-image {
    margin-top: 0 !important;
}

/* Estilos para fitas de material */
.product-material-ribbon {
    position: absolute;
    top: 0px;
    left: -10px;
    background: #3e3e3e;
    color: #fff;
    font-weight: 500;
    font-size: 12px;
    padding: 2px 16px;
    border-top-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 5;
    overflow: visible;
    display: inline-block;
}

.product-material-ribbon::before {
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    width: 0;
    height: 0;
    border-top: 10px solid #1a1a1a;
    border-left: 10px solid transparent;
    z-index: 4;
    display: block;
    overflow: visible;
}

/* Ouro 18k */
.ribbon-gold {
    background: linear-gradient(to right, #e7c577, #f5dc94, #e7c577) !important;
    color: #593e00;
}

.ribbon-gold::before {
    border-top-color: #b1904f;
}

/* ASTM F136 (Titânio) */
.ribbon-silver {
    background: linear-gradient(to right, #0e419e, #66a3ff, #0e419e) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    letter-spacing: 2px;
}

.ribbon-silver::before {
    border-top-color: #919191;
}

/* Aço Cirúrgico */
.ribbon-surgical-steel {
    background: linear-gradient(135deg, #f2f2f2, #e6e6e6, #d9d9d9);
    color: #333;
}

.ribbon-surgical-steel::before {
    border-top-color: #a6a6a6;
}

/* Cobalto Cromo */
.ribbon-cobalt {
    background: linear-gradient(135deg, #b8c6db, #9fb1cf, #8da0c8);
    color: #333;
}

.ribbon-cobalt::before {
    border-top-color: #6a7a9e;
}

/* Bioplex */
.ribbon-bioplex {
    background: linear-gradient(135deg, #c9ffbf, #b0f2c2, #95e8c8);
    color: #333;
}

.ribbon-bioplex::before {
    border-top-color: #6ac99c;
}

/* Cor de preço para produtos de ouro */
li.product-card:has(.ribbon-gold) .price-container .price {
    color: #724f00 !important;
}

/* Cor de preço para produtos que não são de ouro */
li.product-card:not(:has(.ribbon-gold)) .price-container .price {
    color: #1d8aab !important;
}

/* Label "Push Pin" positioned right below the ribbon */
.product-pushpin-label {
    position: absolute;
    top: 36px; /* Slightly below the material ribbon */
    left: -10px;
    color: #000;
    font-weight: 600;
    font-size: 12px;
    padding: 0 16px; /* Align with ribbon text inset */
    z-index: 10;
    pointer-events: none;
}
