/* ====== CONTAINER PRINCIPAL ====== */
#product-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 1200px;
    margin: 40px auto;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   GALERIA DE IMAGENS - ESTILO MERCADO LIVRE
===================================================== */
#product-gallery {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex: 1;
    min-width: 340px;
}

/* Miniaturas laterais (desktop) */
#thumbnail-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 80px;
}

/* Miniaturas */
.thumbnail-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.2s ease, transform 0.2s ease;
    background-color: #f8f8f8;
}

.thumbnail-image.active,
.thumbnail-image:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

/* Imagem principal */
.main-image-container {
    flex: 1;
    background: #f7f7f7;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 450px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    cursor: pointer;
}

#main-image:hover {
    transform: scale(1.03);
}

/* =====================================================
   MODAL DA GALERIA
===================================================== */
.modal-gallery {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 10px;
}

.modal-gallery.active {
    display: flex;
}

.modal-gallery img {
    max-width: 95%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.modal-gallery .close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
}

.modal-gallery .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 50%;
    transition: 0.2s;
}

.modal-gallery .nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-gallery .prev-btn { left: 30px; }
.modal-gallery .next-btn { right: 30px; }

/* =====================================================
   DETALHES DO PRODUTO
===================================================== */
#product-info {
    flex: 1;
    min-width: 300px;
    padding: 10px;
}

#product-title {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin-bottom: 5px;
}

/* Preços */
#product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.current-price {
    color: #e53935;
    font-size: 26px;
    font-weight: 700;
}

.old-price {
    text-decoration: line-through;
    color: #888;
    font-size: 16px;
}

.discount {
    background: #27ae60;
    color: #fff;
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 4px;
}

/* Info adicional */
#additional-info {
    color: #555;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Lista de pagamento */
#payment-methods ul {
    list-style: none;
    padding: 0;
}

#payment-methods li {
    display: flex;
    align-items: center;
    color: #444;
    font-size: 14px;
    margin-bottom: 4px;
}

#payment-methods i {
    color: #27ae60;
    margin-right: 6px;
}

/* Descrição */
#return-policy h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

#short-description,
#full-description {
    font-size: 14px;
    color: #555;
    white-space: pre-wrap;
}

#toggle-description {
    display: inline-block;
    margin-top: 5px;
    color: #007bff;
    cursor: pointer;
}

/* =====================================================
   AVALIAÇÕES
===================================================== */
#product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.rating-stars {
    color: #f9a825;
    font-size: 16px;
}

.rating-score {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.rating-count {
    color: #777;
    font-size: 13px;
}

/* =====================================================
   VENDEDOR
===================================================== */
#seller-summary {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

#seller-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #007bff;
}

#seller-details p {
    margin: 0;
    font-size: 14px;
    color: #444;
}

#seller-name {
    font-weight: bold;
    color: #222;
}

/* =====================================================
   BOTÕES DE COMPRA
===================================================== */
#buy-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d5d5d5;
}

/* =====================================================
   RESPONSIVIDADE (MOBILE)
===================================================== */
@media (max-width: 768px) {
    #product-details-container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }

    #product-gallery {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* miniaturas embaixo da imagem principal */
    #thumbnail-gallery {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 10px;
        margin-top: 10px;
    }

    .thumbnail-image {
        width: 60px;
        height: 60px;
    }

    .main-image-container {
        width: 100%;
        height: 370px;
        order: -1; /* força a imagem principal vir antes das miniaturas */
    }

    #main-image {
        max-height: 100%;
    }

    .modal-gallery img {
        max-height: 80vh;
        width: 100%;
    }

    #product-title {
        text-align: center;
        font-size: 20px;
    }

    #product-price {
        justify-content: center;
    }

    #buy-buttons {
        flex-direction: column;
    }

    #product-rating {
        justify-content: center;
        flex-wrap: wrap;
    }
}
