/* Página de produto — loja virtual profissional (tokens alinhados à home) */

.product-page {
    --p-ink: #0f172a;
    --p-muted: #64748b;
    --p-navy: #1e3a5f;
    --p-blue: #2563eb;
    --p-green: #16a34a;
    --p-line: rgba(148, 163, 184, 0.28);
    --p-card: #ffffff;
    --p-radius: 18px;
    --p-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.product-page.main-container {
    gap: 1.5rem;
}

.product-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Card principal */
.product-main-container {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2rem 2.25rem;
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    padding: 1.5rem 1.5rem 1.75rem;
    align-items: start;
}

.product-main-header {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: var(--p-navy);
    text-decoration: none;
    font-family: var(--p-font);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.back-button:hover {
    background: #dbeafe;
    border-color: rgba(30, 58, 95, 0.28);
    color: var(--p-navy);
    transform: translateY(-1px);
}

.back-button .icon {
    display: inline-flex;
}

.product-title {
    font-family: var(--p-font);
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 800;
    color: var(--p-ink);
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
}

/* Galeria */
.product-images-column {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1536 / 1024; /* 3:2 — proporção das imagens de produto */
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--p-line);
}

.main-image-container.no-image-large {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    cursor: zoom-in;
    background: #f1f5f9;
}

.additional-images {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.additional-images::-webkit-scrollbar {
    height: 4px;
}

.additional-images::-webkit-scrollbar-thumb {
    background: var(--p-navy);
    border-radius: 999px;
}

.thumb-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    background: #fff;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumb-image:hover,
.thumb-image.active {
    border-color: var(--p-navy);
    transform: translateY(-1px);
}

/* Coluna de compra */
.product-info-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    position: sticky;
    top: 7.5rem;
}

.product-price-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--p-line);
}

.product-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.55rem;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
    color: var(--p-green);
    font-family: var(--p-font);
    font-weight: 800;
    line-height: 1;
}

.price-currency {
    font-size: 1.15rem;
}

.price-value {
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    letter-spacing: -0.03em;
}

/* Categoria ao lado do preço — estilo limpo de loja */
.product-category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--p-line);
    color: #475569;
    font-family: var(--p-font);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.product-category-link i {
    font-size: 0.9rem;
    color: var(--p-navy);
}

.product-category-link:hover {
    background: #eff6ff;
    border-color: rgba(30, 58, 95, 0.22);
    color: var(--p-navy);
}

.product-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f0fdf4;
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: #166534;
    font-size: 0.82rem;
    font-weight: 600;
}

.product-actions form {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Painel Pague com — destaque da seção */
.product-pay-panel {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid rgba(30, 58, 95, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.product-pay-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.65rem;
}

.product-pay-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--p-font);
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--p-ink);
}

.product-pay-panel-title i {
    color: var(--p-navy);
    font-size: 0.95rem;
}

.product-pay-panel-note {
    font-family: var(--p-font);
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}

.product-pay-methods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
}

.product-pay-method {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--p-font);
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.2;
}

.product-pay-method i {
    font-size: 1.05rem;
    color: var(--p-navy);
    width: 1.15rem;
    text-align: center;
}

.product-inline-sep {
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    user-select: none;
}

.product-qty {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    min-width: 0;
    width: auto;
    flex: 0 0 auto;
}

.product-qty label {
    display: block;
    height: 1.15rem;
    line-height: 1.15rem;
    margin: 0;
    padding: 0;
    font-family: var(--p-font);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--p-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.product-qty-input {
    box-sizing: border-box;
    width: 5.5rem;
    height: 48px;
    min-height: 48px;
    padding: 0 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--p-line);
    background: #f8fafc;
    font-family: var(--p-font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--p-ink);
    line-height: 1;
}

.product-qty-input:focus {
    outline: none;
    border-color: rgba(30, 58, 95, 0.45);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.product-short-description {
    margin: 0;
    font-family: var(--p-font);
    font-size: 0.95rem;
    line-height: 1.55;
    color: #475569;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    word-break: break-word;
}

/* Quantidade + Comprar + Favoritar */
.product-cta-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: end;
    width: 100%;
}

.product-actions .btn-whatsapp,
button.btn-whatsapp[name="add_to_cart"],
.btn-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    margin: 0;
    padding: 0 0.65rem;
    border-radius: 10px;
    font-family: var(--p-font);
    font-size: 0.9rem !important;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
    box-shadow: none !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.product-actions .btn-whatsapp,
button.btn-whatsapp[name="add_to_cart"] {
    border: 1px solid var(--p-navy);
    background: var(--p-navy) !important;
    color: #fff !important;
}

.product-actions .btn-whatsapp:hover,
button.btn-whatsapp[name="add_to_cart"]:hover {
    background: #16304f !important;
    border-color: #16304f;
    transform: none;
}

.btn-favorite {
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: #fff;
    color: #b91c1c;
    font-weight: 600;
}

.btn-favorite:hover {
    background: #fef2f2;
    border-color: rgba(220, 38, 38, 0.45);
    color: #b91c1c;
    transform: none;
}

.btn-favorite.favorited {
    background: #fef2f2;
    border-color: #dc2626;
}

.btn-favorite i {
    color: #dc2626;
}

/* Abas */
.product-tabs {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    overflow: visible;
}

.product-tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--p-line);
    background: #f8fafc;
    overflow: visible;
}

.product-tab-button {
    appearance: none;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-family: var(--p-font);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--p-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.product-tab-button:hover {
    color: var(--p-navy);
    background: rgba(255, 255, 255, 0.85);
}

.product-tab-button:focus,
.product-tab-button:focus-visible,
.product-tab-button:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.product-tab-button.active {
    color: var(--p-navy);
    background: #fff;
    border: none;
    outline: none;
    box-shadow: none;
}

.product-tabs-body {
    padding: 1.35rem 1.4rem 1.6rem;
    overflow: visible;
    max-height: none;
}

.product-tab-content,
.product-description {
    overflow: visible;
    max-height: none;
}

.product-description {
    font-size: 0.98rem;
    line-height: 1.7;
    color: #334155;
    margin: 0;
    word-break: break-word;
}

.product-buy-extras {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0;
    width: 100%;
}

.product-support-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    align-items: center;
    width: auto;
}

.product-support-list li {
    margin: 0;
    padding: 0;
    min-width: 0;
}

.product-support-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--p-font);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--p-muted);
    text-decoration: none;
    border-bottom: none;
    transition: color 0.2s ease;
}

.product-support-list a:hover {
    color: var(--p-navy);
    border-bottom-color: transparent;
}

.product-support-list a.wa-link {
    color: #15803d;
}

.product-support-list a.wa-link:hover {
    color: #166534;
}

.product-support-list i {
    font-size: 0.85rem;
    opacity: 0.9;
    width: 1rem;
    text-align: center;
}

.product-extra-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-extra-info--empty {
    min-height: 4rem;
    justify-content: center;
}

.product-details-placeholder {
    margin: 0;
    color: var(--p-muted);
    font-size: 0.92rem;
    font-style: italic;
}

.product-detail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--p-line);
    color: var(--p-muted);
    font-size: 0.9rem;
}

.product-detail-row i {
    color: var(--p-navy);
    width: 1.1rem;
    text-align: center;
}

.product-detail-row a {
    color: var(--p-navy);
    font-weight: 600;
    text-decoration: none;
}

.product-detail-row a:hover {
    text-decoration: underline;
}

.product-detail-row a.wa-link {
    color: #16a34a;
}

/* Produtos relacionados */
.product-related {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    padding: 1.35rem 1.4rem 1.5rem;
}

.product-related-header {
    margin-bottom: 1rem;
}

.product-related-title {
    margin: 0 0 0.35rem;
    font-family: var(--p-font);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--p-ink);
    letter-spacing: -0.02em;
}

.product-related-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--p-muted);
}

.product-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    min-height: 0.5rem;
}

/* Modais */
.confirmation-modal,
.politica-modal,
.image-viewer-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* JS usa display:block — força flex para centralizar */
.confirmation-modal[style*="block"],
.politica-modal[style*="block"],
.image-viewer-modal[style*="block"] {
    display: flex !important;
}

.confirmation-content,
.politica-content {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--p-line);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    max-width: 480px;
    width: 100%;
    padding: 1.5rem;
}

.confirmation-icon {
    text-align: center;
    font-size: 2.5rem;
    color: var(--p-green);
    margin-bottom: 0.75rem;
}

.confirmation-title {
    font-family: var(--p-font);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--p-ink);
    text-align: center;
    margin: 0 0 0.5rem;
}

.confirmation-message,
.confirmation-countdown {
    text-align: center;
    color: var(--p-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.btn-whatsapp-now,
.btn-continue-shopping,
.btn-fechar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: var(--p-font);
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-whatsapp-now {
    background: #16a34a;
    color: #fff;
}

.btn-continue-shopping,
.btn-fechar {
    background: #eff6ff;
    color: var(--p-navy);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.politica-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.politica-header h3 {
    margin: 0;
    font-family: var(--p-font);
    font-size: 1.1rem;
    color: var(--p-ink);
}

.politica-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--p-muted);
    line-height: 1;
}

.politica-body {
    color: #334155;
    line-height: 1.6;
    font-size: 0.95rem;
    max-height: 50vh;
    overflow-y: auto;
}

.politica-footer {
    margin-top: 1rem;
    text-align: right;
}

.image-viewer-content {
    position: relative;
    max-width: min(920px, 96vw);
    max-height: 90vh;
}

.image-viewer-image {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    background: #fff;
}

.image-viewer-close {
    position: absolute;
    top: -0.5rem;
    right: -0.25rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: #fff;
    color: var(--p-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--p-navy);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.image-viewer-prev { left: 0.5rem; }
.image-viewer-next { right: 0.5rem; }

.image-viewer-counter {
    text-align: center;
    color: #fff;
    margin-top: 0.75rem;
    font-family: var(--p-font);
    font-weight: 600;
}

@media (max-width: 900px) {
    .product-main-container {
        grid-template-columns: 1fr;
        gap: 1.35rem;
        padding: 1.15rem;
    }

    .product-info-column {
        position: static;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-tabs-body,
    .product-related {
        padding: 1.1rem;
    }
}

@media (max-width: 560px) {
    .product-cta-row {
        grid-template-columns: auto 1fr;
    }

    .product-cta-row .btn-favorite {
        grid-column: 1 / -1;
    }

    .product-actions .btn-whatsapp,
    button.btn-whatsapp[name="add_to_cart"],
    .btn-favorite {
        white-space: normal;
        text-align: center;
        height: auto;
        min-height: 48px;
        max-height: none;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .thumb-image {
        width: 64px;
        height: 64px;
    }

    .price-value {
        font-size: 1.75rem;
    }
}
