@import url("https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&display=swap");

:root {
    --brand-color: #7ca2f4;
    --dark: #121214;
    --gray: #f3f7ff;
    --white: #ffffff;
}

/* Reset e base */
html,
body {
    width: 100%;
    overflow-x: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: "Archivo";
}

body {
    font-family: "Archivo";
    background: var(--white);
    color: #222;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

/* Banner superior */
.top-banner {
    width: 100%;
    background-color: #f0f4ff;
    color: #111;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    padding: 0.6rem 0;
}

/* Seção Hero */
.hero {
    width: 100%;
    margin: 0 auto;
    background-image: url('../assets/imgs/image-michael-jordan.png');
    background-size: 99%; /* Zoom levemente reduzido */
    background-position: center 7%; /* Imagem movida mais para baixo */
    background-repeat: no-repeat;
    color: #fafafa;
    min-height: 360px; /* Altura mantida */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alinhado à esquerda para desktop */
    padding: 3rem 6rem; 
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    text-align: left; /* Alinhado à esquerda para desktop */
}

.hero-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.hero-logo svg {
    width: 18px;
    height: 18px;
    fill: #fafafa;
    flex-shrink: 0;
}

.hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1rem;
    max-width: 360px;
    opacity: 0.9;
}

/* Conteúdo principal */
main {
    width: 100%;
    max-width: 1200px;
    padding: 3rem 2rem;
    background-color: #fff;
}

main h2 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #111;
}

main p.subtitle {
    max-width: 480px;
    margin: 0.5rem auto 2.5rem auto;
    text-align: center;
    color: #444;
    font-size: 1rem;
    line-height: 1.4;
}

/* Grid de produtos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.2rem 1.25rem;
}

.product-card {
    background-color: #f8faff;
    border-radius: 6px;
    padding: 1rem 1rem 1.35rem 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    cursor: pointer;
    box-shadow: 0 4px 13px rgb(0 0 0 / 0.1);
    transform: scale(1.02);
}

.product-image-container {
    background-color: #e9f0ff;
    border-radius: 6px;
    text-align: center;
    padding: 1.25rem 0;
    margin-bottom: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image-container img {
    max-width: 160px;
    height: auto;
    object-fit: contain;
    user-select: none;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #222;
    margin-bottom: 0.4rem;
    min-height: 44px;
    line-height: 1.2;
}

.product-link {
    font-size: 0.75rem;
    color: #0569d9;
    margin-bottom: 0.8rem;
    display: inline-block;
}

.product-price {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
    user-select: none;
}

/* Estilos do Modal */
.modal-container {
    display: flex; /* Alterado de none para flex */
    visibility: hidden; /* Adicionado para transição */
    opacity: 0; /* Adicionado para transição */
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.modal-container.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content-wrapper {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 100%;
    max-width: 800px;
    position: relative;
    border-radius: 8px;
    transform: scale(0.95); /* Adicionado para efeito de zoom */
    transition: transform 0.3s ease; /* Adicionado para efeito de zoom */
}

.modal-container.show .modal-content-wrapper {
    transform: scale(1); /* Efeito de zoom na abertura */
}

#modal-content-placeholder {
    transition: opacity 0.2s ease-out; /* Transição para cross-fade */
}

#modal-content-placeholder.content-fading-out {
    opacity: 0; /* Classe para iniciar o fade-out */
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Conteúdo do Modal de Compra */
.buy-modal-content {
    display: flex;
    gap: 20px;
}

.buy-modal-image {
    max-width: 40%;
    object-fit: contain;
    background-color: #f0f4ff;
    border-radius: 8px;
}

.buy-modal-details {
    flex: 1;
}

.buy-modal-details h2 {
    margin-top: 0;
}

.buy-modal-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111;
    margin: 10px 0;
}

.size-selector {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.size-selector button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.buy-now-button {
    width: 100%;
    padding: 15px;
    background-color: #0569d9;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* --- Media Queries para Responsividade --- */

@media (min-width: 901px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem 1.2rem;
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem;
        min-height: 280px;
        background-position: center 30%;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .buy-modal-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .buy-modal-image {
        max-width: 60%;
    }

    .size-selector {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 260px; /* Altura menor para celular */
        background-position: center 20%; /* Ajusta o fundo */
    }

    .hero-content h1 {
        font-size: 1.4rem; /* Fonte menor */
    }

    .hero-content p {
        font-size: 0.85rem; /* Fonte menor */
        max-width: 300px;
    }

    main {
        padding: 1.5rem 0.5rem;
    }

    main p.subtitle {
        margin-bottom: 1.5rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content-wrapper {
        padding: 15px;
    }

    .close-button {
        top: 5px;
        right: 15px;
    }
}

/* Estilos do Loader */
.loader-container {
    display: none;
    /* Oculto por padrão */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Fundo branco semitransparente */
    z-index: 9999;
    /* Z-index mais alto para ficar sobre tudo */
    justify-content: center;
    align-items: center;
}

.loader-container.show {
    display: flex;
    /* Mostra o loader */
}

.size-selector button.selected {
    background-color: #60A5FA; /* Cor de destaque */
    color: white;
    border-color: #60A5FA;
}
