

/* ==================================================
   MEGATECH — CSS UNIVERSAL DAS PÁGINAS DE PRODUTOS
   Arquivo: produtos.css
================================================== */


/* ================= CONFIGURAÇÕES GERAIS ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

html {
    width: 100%;
    min-height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: #D9D9D9;
    color: #000000;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

.page-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #D9D9D9;
}


/* ================= CABEÇALHO ================= */

.main-header {
    width: 100%;
    padding: 18px 3%;
    background-color: #123B69;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.header-top {
    width: 100%;
    display: grid;
    grid-template-columns: 45px 140px minmax(180px, 1fr)
                           minmax(220px, 400px) 100px;
    align-items: center;
    gap: 18px;
}


/* ================= BOTÃO VOLTAR ================= */

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #FFFFFF;
    color: #123B69;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 25px;
    font-weight: bold;
    transition: 0.2s;
}

.back-button:hover {
    transform: scale(1.05);
}


/* ================= LOGO ================= */

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.logo img {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}


/* ================= TÍTULO DA PÁGINA ================= */

.page-title {
    color: #FFFFFF;
    font-size: clamp(20px, 2vw, 34px);
    font-weight: 900;
    text-align: center;
    overflow-wrap: anywhere;
}


/* ================= BARRA DE PESQUISA ================= */

.search-bar {
    width: 100%;
    height: 42px;
    padding: 0 15px;
    border-radius: 25px;
    background-color: #D9D9D9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #000000;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: #666666;
}

.search-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    color: #123B69;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-btn svg {
    width: 20px;
    height: 20px;
    stroke: #123B69;
    stroke-width: 3;
}


/* ================= ÍCONES DE USUÁRIO E CARRINHO ================= */

.user-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-icon,
.cart-icon {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}


/* ================= MENU DE NAVEGAÇÃO ================= */

.nav-bar {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 35px;
}

.menu-dropdown {
    position: relative;
    flex-shrink: 0;
}

.menu-dropdown summary {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.menu-dropdown summary::-webkit-details-marker {
    display: none;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    width: 17px;
    height: 2px;
    background-color: #FFFFFF;
    border-radius: 3px;
}


/* ================= MENU SUSPENSO ================= */

.menu-modal {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 1000;
    width: 480px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 15px;
    background-color: #174A83;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.menu-modal-content {
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.menu-column {
    flex: 1;
    min-width: 0;
}

.menu-column h3 {
    margin-bottom: 12px;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
}

.menu-column a {
    display: block;
    margin-bottom: 7px;
    padding: 8px 10px;
    border-radius: 10px;
    background-color: #D9D9D9;
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    transition: 0.2s;
}

.menu-column a:hover {
    background-color: #FFFFFF;
}


/* ================= LINKS DA NAVEGAÇÃO ================= */

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
}

.nav-links a:hover {
    text-decoration: underline;
}


/* ================= CONTEÚDO PRINCIPAL ================= */

.product-details-container {
    width: 100%;
    flex: 1;
    padding: 25px 3%;
    display: flex;
    flex-direction: column;
    gap: 45px;
}

.product-main-content {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.5fr);
    align-items: start;
    gap: 3.5%;
}


/* ================= GALERIA DO PRODUTO ================= */

.product-gallery {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.main-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1.25 / 1;
    min-height: 280px;
    max-height: 500px;
    padding: 25px;
    border-radius: 25px;
    background-color: #173F6C;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.featured-image {
    display: block;
    width: 75%;
    height: 75%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* ================= SETAS DA GALERIA ================= */

.nav-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 27px;
    height: 27px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #000000;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}


/* ================= CONFIGURAÇÕES DO PRODUTO ================= */

.config-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.config-btn {
    width: 85%;
    min-height: 40px;
    padding: 8px 12px;
    border: none;
    border-radius: 25px;
    background-color: #FFFFFF;
    color: #000000;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.config-btn:hover {
    background-color: #EEEEEE;
}

.gear-icon {
    font-size: 16px;
}

.view-config-link {
    color: #666666;
    text-decoration: none;
    font-size: 12px;
}

.view-config-link:hover {
    text-decoration: underline;
}


/* ================= INFORMAÇÕES DO PRODUTO ================= */

.product-info-panel {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-name {
    width: 100%;
    color: #000000;
    font-size: clamp(23px, 2.05vw, 34px);
    line-height: 1.12;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.meta-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    font-size: 12px;
    font-weight: 800;
}

.brand {
    overflow-wrap: anywhere;
}

.rating {
    text-align: right;
}


/* ================= ESTOQUE E CÓDIGO ================= */

.stock-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.status-badge {
    color: #087019;
    font-size: 15px;
    font-weight: 900;
}

.sku {
    color: #000000;
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
}


/* ================= ESPECIFICAÇÕES ================= */

.specifications-box {
    width: 100%;
    min-width: 0;
    padding: 25px;
    border-radius: 25px;
    background-color: #4A6888;
    color: #000000;
}

.specifications-box h2 {
    margin-bottom: 10px;
    font-size: 21px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.specifications-box ul {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.specifications-box li {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    overflow-wrap: anywhere;
}


/* ================= ÁREA DE COMPRA ================= */

.buy-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.buy-button {
    width: 100%;
    min-height: 70px;
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    background-color: #008000;
    color: #FFFFFF;
    text-decoration: none;
    display: grid;
    grid-template-columns: 45px minmax(100px, 1fr) minmax(150px, 1fr);
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s;
}

.buy-button:hover {
    background-color: #006B00;
}


/* ================= ÍCONE DO CARRINHO NA COMPRA ================= */

.buy-cart {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.buy-cart img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}


/* ================= TEXTO DO BOTÃO COMPRAR ================= */

.buy-text {
    min-width: 0;
    text-align: center;
}

.buy-text strong {
    display: block;
    font-size: clamp(19px, 1.8vw, 29px);
    font-weight: 900;
}

.buy-text small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
}


/* ================= PREÇO ================= */

.price-info {
    min-width: 0;
    padding-left: 15px;
    border-left: 2px solid #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.old-price {
    font-size: 10px;
    font-weight: 700;
}

.current-price {
    color: #FFFFFF;
    font-size: clamp(17px, 1.7vw, 25px);
    line-height: 1.2;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.installment-info {
    font-size: 9px;
    font-weight: 700;
}


/* ================= FORMAS DE PAGAMENTO ================= */

.payment-methods-btn {
    width: 220px;
    max-width: 100%;
    height: 38px;
    flex-shrink: 0;
    margin-left: auto;
    padding: 5px 12px;
    border: none;
    border-radius: 25px;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    cursor: pointer;
}

/* Evita que a imagem de pagamento fique gigante */
.payment-methods-btn img {
    display: block;
    width: 100px;
    height: 25px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex: 0 1 auto;
}

.payment-methods-btn span {
    font-size: 12px;
    color: #333333;
    text-align: center;
}


/* ================= PRODUTOS RELACIONADOS ================= */

.related-products-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.related-products-section h2 {
    color: #000000;
    font-size: clamp(23px, 2vw, 34px);
    font-weight: 900;
}

.related-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 25px;
}

/* Limita o tamanho dos cartões */
.related-card {
    width: 100%;
    height: 220px;
    min-width: 0;
    padding: 15px;
    border-radius: 20px;
    background-color: #123B69;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s;
}

.related-card:hover {
    transform: translateY(-4px);
}

/* Impede que as imagens relacionadas ocupem a tela inteira */
.related-card img {
    display: block;
    width: 75%;
    height: 75%;
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
}

/* Se a imagem tiver fundo branco, ela continua limitada ao cartão */
.related-card a,
.related-card picture {
    max-width: 100%;
    max-height: 100%;
}


/* ================= RODAPÉ ================= */

.main-footer {
    width: 100%;
    min-height: 55px;
    margin-top: auto;
    background-color: #123B69;
}


/* ================= TABLETS E TELAS MÉDIAS ================= */

@media (max-width: 1100px) {

    .header-top {
        grid-template-columns: 40px 110px minmax(150px, 1fr)
                               minmax(180px, 300px) 80px;
        gap: 12px;
    }

    .logo img {
        width: 110px;
    }

    .product-main-content {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
        gap: 25px;
    }

    .specifications-box {
        padding: 20px;
    }

    .buy-button {
        grid-template-columns: 38px minmax(80px, 1fr) minmax(120px, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .price-info {
        padding-left: 10px;
    }

    .nav-links {
        gap: 20px;
    }
}


/* ================= TABLETS ================= */

@media (max-width: 850px) {

    .header-top {
        grid-template-columns: 40px 110px minmax(0, 1fr) 85px;
        grid-template-areas:
            "back logo title actions"
            "search search search search";
        gap: 14px;
    }

    .back-button {
        grid-area: back;
    }

    .logo {
        grid-area: logo;
    }

    .page-title {
        grid-area: title;
    }

    .user-actions {
        grid-area: actions;
    }

    .search-bar {
        grid-area: search;
    }

    .product-main-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 35px;
    }

    .product-gallery {
        max-width: 600px;
        margin: 0 auto;
    }

    .product-info-panel {
        max-width: 800px;
        margin: 0 auto;
    }

    .main-image-box {
        max-height: 480px;
    }

    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .related-card {
        height: 200px;
    }
}


/* ================= CELULARES ================= */

@media (max-width: 600px) {

    .main-header {
        padding: 15px;
        gap: 16px;
    }

    .header-top {
        grid-template-columns: 36px minmax(0, 1fr) 75px;
        grid-template-areas:
            "back title actions"
            "logo logo logo"
            "search search search";
        gap: 14px 8px;
    }

    .back-button {
        width: 34px;
        height: 34px;
        font-size: 22px;
    }

    .logo img {
        width: 125px;
    }

    .page-title {
        font-size: 19px;
    }

    .user-actions {
        gap: 5px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .profile-icon,
    .cart-icon {
        width: 27px;
        height: 27px;
    }

    .nav-bar {
        gap: 20px;
    }

    .nav-links {
        gap: 14px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .menu-modal {
        width: 90vw;
        max-width: 90vw;
        max-height: 65vh;
        padding: 15px;
    }

    .menu-modal-content {
        flex-direction: column;
        gap: 15px;
    }

    .product-details-container {
        padding: 20px 15px;
        gap: 35px;
    }

    .main-image-box {
        min-height: 250px;
        max-height: 380px;
        aspect-ratio: 1 / 0.85;
        padding: 20px;
        border-radius: 20px;
    }

    .featured-image {
        width: 75%;
        height: 75%;
    }

    .product-name {
        font-size: 23px;
    }

    .meta-info,
    .stock-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .rating {
        text-align: left;
    }

    .specifications-box {
        padding: 18px;
        border-radius: 20px;
    }

    .specifications-box h2 {
        font-size: 19px;
    }

    .specifications-box li {
        font-size: 12px;
    }

    .buy-button {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        border-radius: 20px;
        padding: 12px;
    }

    .buy-cart {
        width: 35px;
        height: 35px;
    }

    .buy-text strong {
        font-size: 21px;
    }

    .price-info {
        grid-column: 1 / -1;
        align-items: center;
        border-left: none;
        border-top: 1px solid #FFFFFF;
        padding: 10px 0 0;
        text-align: center;
    }

    .current-price {
        font-size: 22px;
    }

    .installment-info {
        font-size: 10px;
    }

    .payment-methods-btn {
        width: 200px;
        height: 36px;
    }

    .payment-methods-btn img {
        width: 85px;
        height: 23px;
    }

    .related-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .related-card {
        width: 100%;
        max-width: 350px;
        height: 190px;
        margin: 0 auto;
    }

    .related-card img {
        width: 70%;
        height: 70%;
        max-width: 135px;
        max-height: 135px;
    }
}


/* ================= CELULARES PEQUENOS ================= */

@media (max-width: 360px) {

    .page-title {
        font-size: 16px;
    }

    .product-name {
        font-size: 20px;
    }

    .main-image-box {
        min-height: 220px;
    }

    .buy-button {
        padding: 10px 8px;
        gap: 7px;
    }

    .buy-text strong {
        font-size: 18px;
    }

    .current-price {
        font-size: 19px;
    }

    .related-card {
        height: 165px;
    }
}
