/**
 * Produto Page - Modern E-commerce Product Page
 * Mobile-first, brutalist-modern design
 */

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */
.produto-page {
    background: var(--brutalist-white, #fff);
    overflow-x: hidden; /* Previne scroll horizontal */
}

.produto-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
    padding-top: clamp(100px, 15vh, 140px); /* Espaço para o header fixo */
    overflow-x: hidden; /* Previne imagens saindo da tela */
}

/* Mobile: ajustes gerais */
@media (max-width: 767px) {
    .produto-container {
        padding: 1rem;
        padding-top: 100px;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--brutalist-gray, #666);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--brutalist-charcoal, #1a1a1a);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--brutalist-green, #2ECC71);
}

.breadcrumb span:last-child {
    color: var(--brutalist-charcoal, #1a1a1a);
    font-weight: 600;
}

/* ============================================================================
   PRODUTO CONTENT
   ============================================================================ */
.produto-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .produto-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .produto-content {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 4rem;
    }
}

/* ============================================================================
   GALERIA DE IMAGENS
   ============================================================================ */
.produto-gallery {
    position: relative;
    height: fit-content;
    max-width: 100%;
    overflow: hidden;
}

/* Sticky apenas em desktop */
@media (min-width: 768px) {
    .produto-gallery {
        position: sticky;
        top: 120px;
    }
}

.gallery-main {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    background: var(--brutalist-cream, #f5f5f5);
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Mobile: limitar altura da imagem principal */
@media (max-width: 767px) {
    .gallery-main {
        aspect-ratio: auto;
        max-height: 400px;
        height: auto;
    }
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    max-width: 100%;
    transition: transform 0.3s ease;
}

.gallery-main:hover img {
    transform: scale(1.05);
}

.gallery-zoom {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-zoom:hover {
    background: var(--brutalist-charcoal, #1a1a1a);
    color: white;
    transform: scale(1.1);
}

/* Thumbnails */
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
    max-width: 100%;
    overflow-x: auto;
}

/* Mobile: scroll horizontal nas thumbnails */
@media (max-width: 767px) {
    .gallery-thumbs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .gallery-thumbs .thumb {
        flex: 0 0 60px;
        scroll-snap-align: start;
    }
}

.gallery-thumbs .thumb {
    aspect-ratio: 1;
    border: 2px solid var(--brutalist-gray, #ccc);
    background: var(--brutalist-cream, #f5f5f5);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    min-width: 60px;
}

.gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumbs .thumb:hover,
.gallery-thumbs .thumb.active {
    border-color: var(--brutalist-charcoal, #1a1a1a);
}

.gallery-thumbs .thumb:hover img {
    transform: scale(1.1);
}

/* ============================================================================
   INFORMAÇÕES DO PRODUTO
   ============================================================================ */
.produto-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.produto-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--brutalist-charcoal, #1a1a1a);
    line-height: 1.1;
    margin: 0;
}

/* Preço */
.produto-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.price-old {
    font-size: 1.25rem;
    color: var(--brutalist-gray, #666);
    text-decoration: line-through;
}

.price-current {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--brutalist-green, #2ECC71);
}

.price-discount {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--brutalist-orange, #E67E22);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 4px;
}

/* Badges */
.produto-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--brutalist-green, #2ECC71);
}

.badge-info {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.badge-social {
    background: rgba(230, 126, 34, 0.1);
    color: var(--brutalist-orange, #E67E22);
}

/* Descrição */
.produto-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--brutalist-charcoal, #1a1a1a);
    padding: 1.5rem;
    background: var(--brutalist-cream, #f5f5f5);
    border-left: 4px solid var(--brutalist-charcoal, #1a1a1a);
}

/* ============================================================================
   FORMULÁRIO DE COMPRA
   ============================================================================ */
.produto-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brutalist-charcoal, #1a1a1a);
}

/* Seletor de Tamanho */
.size-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.size-option {
    position: relative;
    cursor: pointer;
}

.size-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    padding: 0 1rem;
    background: white;
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    font-weight: 700;
    font-size: 1.125rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.size-option:hover span {
    background: var(--brutalist-cream, #f5f5f5);
}

.size-option input:checked + span {
    background: var(--brutalist-charcoal, #1a1a1a);
    color: white;
}

/* Seletor de Quantidade */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
}

.qty-btn {
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: var(--brutalist-charcoal, #1a1a1a);
    color: white;
}

.qty-btn:active {
    transform: scale(0.95);
}

#quantidade {
    width: 80px;
    height: 50px;
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    -moz-appearance: textfield;
}

#quantidade::-webkit-outer-spin-button,
#quantidade::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botões de Ação */
.produto-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .produto-actions {
        flex-direction: row;
    }
}

.btn-add-cart,
.btn-buy-now {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-cart {
    background: var(--brutalist-charcoal, #1a1a1a);
    color: white;
}

.btn-add-cart:hover {
    background: var(--brutalist-green, #2ECC71);
    border-color: var(--brutalist-green, #2ECC71);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-buy-now {
    background: white;
    color: var(--brutalist-charcoal, #1a1a1a);
}

.btn-buy-now:hover {
    background: var(--brutalist-orange, #E67E22);
    border-color: var(--brutalist-orange, #E67E22);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

/* ============================================================================
   INFORMAÇÕES EXTRAS
   ============================================================================ */
.produto-extra-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--brutalist-cream, #f5f5f5);
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--brutalist-green, #2ECC71);
    min-width: 30px;
}

.info-item strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.info-item p {
    font-size: 0.875rem;
    color: var(--brutalist-gray, #666);
    margin: 0;
}

/* ============================================================================
   PRODUTOS RELACIONADOS
   ============================================================================ */
.related-products {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 2px solid var(--brutalist-charcoal, #1a1a1a);
}

.related-products h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 2rem;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
}

.product-image {
    aspect-ratio: 1;
    background: var(--brutalist-cream, #f5f5f5);
    border: 2px solid var(--brutalist-charcoal, #1a1a1a);
    overflow: hidden;
    margin-bottom: 1rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--brutalist-green, #2ECC71);
}

/* ============================================================================
   MODAL DE ZOOM
   ============================================================================ */
.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.zoom-modal.active {
    display: flex;
}

.zoom-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: pinch-zoom;
}

/* Mobile: ajustes do modal de zoom */
@media (max-width: 767px) {
    .zoom-modal {
        padding: 1rem;
    }
    
    .zoom-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

.zoom-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.zoom-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ============================================================================
   NOTIFICAÇÃO DO CARRINHO
   ============================================================================ */
.cart-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--brutalist-green, #2ECC71);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(150%);
    transition: transform 0.3s ease;
}

.cart-notification.show {
    transform: translateY(0);
}

.cart-notification i {
    font-size: 1.5rem;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.produto-content > * {
    animation: fadeInUp 0.6s ease backwards;
}

.produto-gallery {
    animation-delay: 0.1s;
}

.produto-info {
    animation-delay: 0.2s;
}

