/* =========================================
   CONTAINER PRINCIPAL (GRID)
   ========================================= */
.product-detail-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 906px) {
    .product-detail-container {
        /* Proporção 55% Galeria / 45% Info */
        grid-template-columns: 1.2fr 1fr;
        gap: 60px;
        align-items: start; /* Vital para o position sticky funcionar */
    }
}

/* =========================================
   LADO ESQUERDO: GALERIA (CORRIGIDO PARA MOBILE)
   ========================================= */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%; /* Garante que não passe do limite da tela */
}

@media (min-width: 906px) {
    .product-gallery {
        position: sticky;
        top: 95px; 
    }
}

.gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main.zoomed {
    cursor: crosshair;
}

.main-img {
    width: 100%;
    height: 100%;             /* Mudado para 100% para o flexbox alinhar o tamanho correto */
    object-fit: contain;      /* Garante que o tênis apareça inteiro sem cortes */
    display: block;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
    will-change: transform;
    pointer-events: none;     /* evita flickering no mousemove */
}

.gallery-main.zoomed .main-img {
    transform: scale(2.2);
}

/* Scroll nativo invisível para miniaturas */
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.gallery-thumbnails::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.thumb-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0;
    background-color: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.thumb-btn.active, .thumb-btn:hover {
    border-color: #000000;
}

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

/* =========================================
   LADO DIREITO: INFORMAÇÕES
   ========================================= */
.product-info-panel {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.brand-badge {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
}

.product-title {
    font-size: clamp(24px, 4vw, 32px); /* Tipografia fluida */
    font-weight: 700;
    margin: 8px 0 15px;
    line-height: 1.2;
    color: #1d1d1f;
}

.price-block {
    display: flex;
    flex-direction: column;
}

.price-block .price {
    font-size: 28px;
    font-weight: 700;
    color: #000;
}

.price-block .installments {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

/* =========================================
   SELETOR DE TAMANHO (NATIVO & SEM JS)
   ========================================= */
.size-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.size-header h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #1d1d1f;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
}

.size-option {
    position: relative;
    padding-bottom: 5px;
}

/* O label vira o botão visual */
.size-option h3 {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 40px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    background: #ffffff;
}

/* =========================================
   BOTÕES DE AÇÃO (CTA)
   ========================================= */
.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e5ea;
}

.btn-whatsapp-buy {
    width: 100%;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-whatsapp-buy {
    justify-content: center;
    gap: 10px; /* já deve ter */
    position: relative;
    background: #000000;
    color: #ffffff;
}

.btn-whatsapp-buy img {
    position: absolute;
    left: 16px;
    filter: brightness(0) invert(1);
}

.btn-whatsapp-buy:hover {
    background: #353535;
}

/* =========================================
   DESCRIÇÃO DO PRODUTO
   ========================================= */
.product-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1d1d1f;
}

.desc-content {
    font-size: 14px;
    line-height: 1.6;
    color: #4c4c4c;
}

.desc-content p {
    margin-bottom: 12px;
}

/* =========================================
   PRODUTOS RECOMENDADOS
   ========================================= */
.recommended-section {
    max-width: 1300px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.recommended-section h2 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.recommended-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 900px) {
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.markdown-table table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    margin-left: auto;   /* ← */
    margin-right: auto;  /* ← */
    font-size: 14px;
}

.markdown-table th {
    background-color: #f9f9f9;
    color: #111;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #111; /* Linha marcante abaixo do cabeçalho */
    padding: 12px 16px;
}

.markdown-table td {
    color: #555;
    padding: 12px 16px;
    border-bottom: 1px solid #eee; /* Linha sutil entre as linhas */
}

/* Efeito sutil ao passar o mouse */
.markdown-table tr:hover td {
    background-color: #fbfbfb;
    color: #000;
}

/* =========================================
   BOTÃO DISCRETO: GUIA DE MEDIDAS
   ========================================= */
.size-guide-btn {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
    line-height: 1;
}

.size-guide-btn:hover {
    color: #000;
}

/* =========================================
   DIALOG NATIVO: MODAL DE MEDIDAS
   ========================================= */
.size-guide-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: min(900px, 92vw);
    width: 100%;
    max-height: 90dvh;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.size-guide-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
}

.dialog-inner {
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.dialog-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.dialog-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease;
}

.dialog-close:hover {
    color: #000;
    background: #f5f5f5;
}

.dialog-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dialog-img {
    display: block;
    width: 100%;
    max-width: 1900px;
    height: auto;
}

/* =========================================
   TRUST BAR: PRODUTO
   ========================================= */
.product-trust-bar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 10px;
}

.product-trust-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1d1d1f;
}

.product-trust-item {
    border: 1px solid #c1c1c1;
}
.product-trust-item img {
    flex-shrink: 0;
    opacity: 0.75;
}

.product-trust-item p {
    margin: 0;
    flex: 1;
    text-align: center;
}

.product-color-swatches h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1d1d1f;
}
.swatches-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.swatch-item {
    width: 84px;
    height: 84px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
    display: flex; /* Adicionado */
    align-items: center; /* Centraliza verticalmente */
    justify-content: center; /* Centraliza horizontalmente */
}
.swatch-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}
.swatch-item:hover {
    border-color: #000;
}
.swatch-item.active {
    border: 2px solid #000; /* Destaca a cor que o usuário já está visualizando */
    pointer-events: none;  /* Desativa o clique na cor atual */
}
@media (min-width: 1000px) {
    .swatch-item {
        width: 101px;
        height: 101px;
    }
}