/* Product Detail Page */
.product-page {
    padding: var(--spacing-lg) 0;
    min-height: 60vh;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Gallery */
.product-gallery {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.gallery-main {
    position: relative;
    margin-bottom: var(--spacing-md);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    aspect-ratio: 2/3; /* Altura maior para mostrar imagem completa */
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-zoom {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostra imagem completa sem cortes */
    object-position: center;
    padding: 1rem; /* Espaçamento interno */
    transition: transform 0.3s ease;
}

.zoom-lens {
    position: absolute;
    border: 2px solid var(--primary);
    background: rgba(255, 0, 0, 0.1);
    pointer-events: none;
    display: none;
    z-index: 10;
}

.zoom-result {
    position: fixed;
    width: 400px;
    height: 400px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
    display: none;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    pointer-events: none;
}

.zoom-result img {
    width: 800px;
    height: 800px;
    object-fit: cover;
    transform-origin: 0 0;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.thumb-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0.25rem;
}

.thumb-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

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

/* Product Info Detail */
.product-info-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.product-badge-detail {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.product-title-detail {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin: 0;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    font-size: 0.9375rem;
    color: var(--gray);
}

.product-code-detail {
    font-weight: 600;
}

.product-brand-detail {
    color: var(--primary);
    font-weight: 500;
}

.product-category-detail {
    color: var(--gray);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stars {
    color: #FFD700;
    font-size: 1rem;
}

.stars-large {
    color: #FFD700;
    font-size: 1.5rem;
}

.rating-text {
    color: var(--gray);
    font-size: 0.9375rem;
}

.product-price-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: var(--spacing-md);
    background: var(--gray-lighter);
    border-radius: 8px;
}

.price-old {
    font-size: 1.25rem;
    color: var(--gray);
    text-decoration: line-through;
}

.price-discount {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    width: fit-content;
}

.price-current {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Preço PIX destacado na página de detalhes */
.price-pix-highlight-detail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: linear-gradient(135deg, #32CD32 0%, #228B22 100%);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(50, 205, 50, 0.25);
    margin-bottom: 0.5rem;
}

.price-pix-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.price-pix-value-detail {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.price-pix-save {
    font-size: 0.8125rem;
    opacity: 0.9;
    font-weight: 500;
}

.price-normal-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.price-label-detail {
    font-size: 1rem;
    color: var(--gray);
}

.price-value-detail {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-dark);
}

.price-installment-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: 8px;
    border: 2px solid var(--gray-light);
}

/* Preço Atacadista - Página de Detalhes */
.price-wholesale-highlight-detail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: linear-gradient(135deg, #4169E1 0%, #1E90FF 100%);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(65, 105, 225, 0.25);
    margin-top: 0.75rem;
}

.price-wholesale-badge-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.price-wholesale-value-detail {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.price-wholesale-note-detail {
    font-size: 0.8125rem;
    opacity: 0.9;
    font-weight: 500;
}

.btn-wholesale-price-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #4169E1 0%, #1E90FF 100%);
    color: var(--white);
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(65, 105, 225, 0.25);
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-wholesale-price-detail:hover {
    background: linear-gradient(135deg, #1E90FF 0%, #4169E1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(65, 105, 225, 0.4);
    color: var(--white);
}

.btn-wholesale-price-detail i {
    font-size: 1.125rem;
}

.installment-label-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--gray);
}

.installment-value-detail {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.installment-note-detail {
    font-size: 0.875rem;
    color: var(--gray);
    font-style: italic;
    margin-left: auto;
}

.price-unit {
    font-size: 0.9375rem;
    color: var(--gray);
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-weight: 500;
}

.product-stock i {
    font-size: 1.25rem;
}

.product-description-short {
    padding: var(--spacing-md);
    background: var(--gray-lighter);
    border-radius: 8px;
    line-height: 1.8;
    color: var(--dark);
}

/* Product Variations */
.product-variations {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
}

.variation-group {
    margin-bottom: var(--spacing-lg);
}

.variation-group:last-child {
    margin-bottom: 0;
}

.variation-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.variation-label i {
    color: var(--primary);
    font-size: 1rem;
}

.selected-variation {
    font-weight: 400;
    color: var(--primary);
    margin-left: 0.25rem;
}

.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Color Options */
.color-options .variation-option {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e5ea;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    padding: 0;
    background: none;
    overflow: visible;
}

.color-options .variation-option:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

.color-options .variation-option.active {
    border-color: var(--primary);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
    transform: scale(1.1);
}

.color-options .variation-option .check-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.color-options .variation-option.active .check-icon {
    opacity: 1;
}

/* Size and Material Options */
.size-options .variation-option,
.material-options .variation-option {
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border: 2px solid #e5e5ea;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    text-align: center;
}

.size-options .variation-option:hover,
.material-options .variation-option:hover {
    border-color: var(--primary);
    background: #fff5f5;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.15);
}

.size-options .variation-option.active,
.material-options .variation-option.active {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    transform: translateY(-2px);
}

.size-options .variation-option.active:hover,
.material-options .variation-option.active:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.qty-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--gray-light);
    border-right: 1px solid var(--gray-light);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-cart-detail {
    flex: 1;
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-wishlist,
.btn-compare {
    width: 50px;
    height: 50px;
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-wishlist:hover,
.btn-compare:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.product-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--gray-lighter);
    border-radius: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark);
    font-size: 0.9375rem;
}

.feature-item i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Tabs */
.product-tabs {
    margin-top: var(--spacing-xl);
    border-top: 2px solid var(--gray-light);
    padding-top: var(--spacing-lg);
}

.tabs-header {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tabs-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--spacing-md);
}

.tab-pane h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.tab-pane p {
    line-height: 1.8;
    color: var(--dark);
    margin-bottom: var(--spacing-md);
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list i {
    color: var(--secondary);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid var(--gray-light);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.spec-label {
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 600;
    color: var(--dark);
    width: 200px;
    background: var(--gray-lighter);
}

.spec-value {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--gray);
}

.reviews-summary {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--gray-lighter);
    border-radius: 8px;
}

.reviews-average {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.average-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.reviews-count {
    color: var(--gray);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.review-item {
    padding: var(--spacing-md);
    background: var(--gray-lighter);
    border-radius: 8px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.review-date {
    color: var(--gray);
    font-size: 0.875rem;
    display: block;
    margin-top: var(--spacing-xs);
}

/* Related Products */
.related-products {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--gray-light);
}

.related-products .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .product-gallery {
        position: static;
    }
    
    .gallery-main {
        aspect-ratio: 3/4; /* Ajuste para mobile */
    }
    
    .zoom-result {
        display: none !important;
    }
    
    .product-variations {
        padding: var(--spacing-md);
    }
    
    .variation-options {
        gap: 0.5rem;
    }
    
    .color-options .variation-option {
        width: 40px;
        height: 40px;
    }
    
    .size-options .variation-option,
    .material-options .variation-option {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .product-title-detail {
        font-size: 1.5rem;
    }
    
    .price-current {
        font-size: 2rem;
    }
    
    .gallery-main {
        aspect-ratio: 4/5; /* Ajuste para tablets */
    }
    
    .gallery-zoom img {
        padding: 0.75rem; /* Menos padding no mobile */
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .quantity-selector {
        width: 100%;
    }
    
    .qty-input {
        flex: 1;
    }
    
    .btn-add-cart-detail {
        width: 100%;
    }
    
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-features {
        grid-template-columns: 1fr;
    }
}

/* Frete inline (página do produto) */
.product-shipping-inline {
    margin-top: 1rem;
}

.product-shipping-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.product-shipping-box {
    margin-top: 0.75rem;
    padding: 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.product-shipping-form {
    margin-bottom: 0.75rem;
}

.product-shipping-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.35rem;
}

.product-shipping-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.product-shipping-input {
    flex: 1;
    min-width: 160px;
    height: 42px;
    padding: 0 0.85rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    background: var(--white);
    color: var(--dark);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.product-shipping-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.12);
}

.product-shipping-help {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.35;
}

.product-shipping-msg {
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.product-shipping-msg.loading {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.product-shipping-msg.error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.product-shipping-results-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.product-shipping-options {
    display: grid;
    gap: 0.5rem;
}

.product-shipping-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.product-shipping-option:hover {
    border-color: #FF0000;
    box-shadow: 0 6px 18px rgba(255, 0, 0, 0.08);
}

.product-shipping-option input {
    accent-color: #FF0000;
}

.product-shipping-option-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.product-shipping-option-title {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
}

.product-shipping-option-sub {
    font-size: 0.85rem;
    color: #6b7280;
}

.product-shipping-option-price {
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .product-shipping-row .btn {
        width: 100%;
        justify-content: center;
    }
}
