:root {
    --bg: #ffffff;
    --text: #111;
    --muted: #666;
    --accent: #f97316;
    --radius: 14px;
    --maxw: 1200px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #fff 0%, #fff6f0 100%);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    margin-bottom: 28px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 12px;
    z-index: 100;
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(6px);
}

body.scrolled header {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/*
  style.css
  Estilização principal do site.
  Este arquivo foi reorganizado com seções e comentários para facilitar a leitura.
*/

:root {
    /* Variáveis de tema */
    --bg: #ffffff;
    --text: #111;
    --muted: #666;
    --accent: #f97316;
    /* cor de destaque laranja */
    --radius: 14px;
    --maxw: 1200px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
}

/* Layout e wrapper */
body {
    margin: 0;
    background: linear-gradient(180deg, #fff 0%, #fff6f0 100%);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
}

/* Header (topbar) */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    margin-bottom: 28px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 12px;
    z-index: 100;
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(6px);
}

body.scrolled header {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    color: var(--text);
}

.brand p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

nav a,
nav .cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
}

nav a.cta {
    background: var(--accent);
    color: #fff;
}

nav .cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    margin-left: 8px;
    flex-shrink: 0;
}

nav .cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    border-radius: 999px;
    padding: 2px 6px;
}

/* Main content */
main {
    display: grid;
    gap: 30px;
}

.hero {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Wrapper para permitir colapsar o hero e mostrar apenas uma aba */
.hero-wrapper {
    position: relative;
    transition: box-shadow 0.3s ease;
}

.hero-wrapper .hero {
    transition: max-height 0.45s ease, padding 0.35s ease;
    max-height: 2000px;
    /* estado expandido por padrão */
}

/* Estado colapsado: reduzir o hero a uma pequena faixa */
.hero-wrapper.collapsed .hero {
    max-height: 56px;
    padding-top: 12px;
    padding-bottom: 12px;
    overflow: hidden;
}

/* Quando colapsado, escondemos tudo dentro do hero exceto o título (h2) */
.hero-wrapper.collapsed .hero>*:not(h2) {
    display: none;
}

/* Aba/Tab que fica visível quando o hero está colapsado */
.hero-tab {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -18px;
    background: var(--accent);
    color: #fff;
    border: none;
    width: 44px;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, background 0.15s ease;
    z-index: 50;
}

.hero-tab:hover {
    transform: translateX(-50%) translateY(-2px);
}

/* estado visual do botão controlado pelo conteúdo e pelo hover; sem regras específicas para aria-expanded */

@media (max-width: 600px) {
    .hero-wrapper.collapsed .hero {
        max-height: 96px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .hero-tab {
        bottom: -16px;
        width: 40px;
        height: 34px;
    }
}

.hero h2 {
    margin: 0;
    font-size: 26px;
}

.hero p {
    color: var(--muted);
    margin-top: 12px;
    font-size: 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
}

.btn.secondary {
    background: #fff;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    background: #fff;
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.filters select,
.filters input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.catalog {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    justify-content: center;
}

.card {
    box-sizing: border-box;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
    overflow: hidden;
    height: auto;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-6px);
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.card h3 {
    margin: 10px 0 4px 0;
    font-size: 16px;
}

.card p {
    margin: 0 0 10px 0;
    color: var(--muted);
    font-size: 13px;
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-wrap: nowrap;
    gap: 8px;
}

.chip {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent);
}

footer {
    margin-top: 40px;
    padding: 18px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

/* Modal (detalhes / carrinho) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal .box {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 20px 36px;
    max-width: 480px;
    max-height: 90vh;
    margin: auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

.modal .carousel {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.modal .carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* Botão de fechar no canto superior direito do modal */
.modal .box .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.12s;
}

.modal .box .close-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
    transform: translateY(-1px);
}

/* Espaçamento entre preço, ações e base do modal */
#modalPrice {
    font-size: 20px;
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 14px;
}

.modal .box .actions {
    margin-top: 12px;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal .box .actions .btn {
    min-width: 140px;
}

/* Espaço extra no final do modal para rolagem infinita e evitar conteúdo colado na borda */
.modal .box {
    padding-bottom: 48px;
}

#modalDesc {
    font-size: 15px;
    white-space: normal;
    overflow: visible;
    display: block;
    transition: 0.25s ease;
    margin-bottom: 8px;
}

#modalDesc.expanded {
    overflow: auto;
}

.more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: bold;
    cursor: pointer;
    margin: 4px 0 8px 0;
    padding: 0;
}

#modalPrice {
    font-size: 20px;
    font-weight: 700;
    margin-top: 8px;
}

/* Responsividade */
@media (max-width: 600px) {
    .modal .box {
        max-width: 92vw;
        height: 82vh;
    }

    .modal .carousel {
        aspect-ratio: 1 / 1;
    }

    .modal .carousel img {
        height: 100%;
    }

    #modalDesc {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        display: block;
    }
}

.carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 14px;
}

.carousel img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    height: 100%;
    transition: opacity 0.3s ease;
    display: block;
}

.carousel button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 50%;
    color: var(--accent);
    transition: background 0.2s;
}

.carousel button:hover {
    background: rgba(255, 255, 255, 1);
}

.carousel .prev {
    left: 10px;
}

.carousel .next {
    right: 10px;
}

.card .carousel {
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
    overflow: hidden;
}

.card .carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.card .carousel button {
    font-size: 18px;
    padding: 4px 8px;
}

/* Destaques nos links de navegação específicos */
nav a[href="cores.html"] {
    background: var(--accent);
    color: #fff;
}

nav a[href="index.html"] {
    background: var(--accent);
    color: #fff;
}

@media (max-width: 768px) {
    .catalog {
        grid-template-columns: 1fr;
    }

    .card {
        height: auto;
    }

    .card img {
        height: 300px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 12px 14px;
    }

    .logo {
        width: 44px;
        height: 44px;
    }

    nav a {
        padding: 6px 8px;
        font-size: 13px;
    }

    .cart-btn {
        font-size: 18px;
    }

    .brand h1 {
        font-size: 18px;
    }

    .catalog {
        grid-template-columns: 1fr;
    }

    .card {
        height: auto;
    }

    .card img {
        height: 300px;
    }
}