/* ============================================================
   DITOM — Home
   Mobile-first: estilos base = celular; min-width amplia p/ desktop.
   Estrutura: vídeo hero → categorias em círculo (estilo Stories)
   → fileira "Em destaque" → barra de confiança.
   ============================================================ */

/* ══════════════════════
   HERO — vídeo único, responsivo
   (o <source media="..."> no HTML já escolhe o arquivo certo
   pra celular ou desktop — aqui é só o estilo do container)
══════════════════════ */
.hero-video {
    position: relative;
    width: 100%;
    /* dvh = evita pulo por causa da barra de endereço do celular.
       Ficou em 82dvh (em vez de quase 100%) de propósito: assim a seção
       de categorias já "espia" no rodapé da tela no primeiro carregamento,
       deixando claro que tem mais conteúdo abaixo do vídeo. */
    height: 82dvh;
    min-height: 420px;
    max-height: 720px;
    overflow: hidden;
    background: var(--color-obsidian);
}

.hero-video-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-video-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-video-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.78) 0%,
        rgba(0,0,0,0.35) 40%,
        rgba(0,0,0,0.1) 65%,
        rgba(0,0,0,0.15) 100%
    );
}

.hero-video-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 20px 64px;
    z-index: 2;
}

.hero-video-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
}

.hero-video-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 40px;
    line-height: 1.02;
    letter-spacing: normal;
    color: #ffffff;
    margin: 0 0 14px;
}

.hero-video-sub {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(255,255,255,0.8);
    max-width: 380px;
    margin: 0 0 22px;
}

.hero-video .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: var(--color-obsidian);
    font-family: var(--font-body-medium);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: var(--radius-buttons);
    text-decoration: none;
}

.hero-video .btn-primary svg { transition: transform 0.2s; }
.hero-video .btn-primary:active svg { transform: translateX(3px); }

/* ══════════════════════
   INDICADOR "ROLE PARA VER MAIS"
   Fica ancorado no rodapé do vídeo, com a setinha "quicando" pra deixar
   óbvio que dá pra descer a página. Some sozinho assim que o usuário
   começa a rolar (classe .is-hidden adicionada via static/js/home.js).
══════════════════════ */
.hero-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    opacity: 1;
    transition: opacity 0.35s ease;
}

.hero-scroll-cue.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-scroll-cue-text {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: none;
}

.hero-scroll-cue-arrow {
    animation: hero-scroll-cue-bounce 1.8s ease-in-out infinite;
}

@keyframes hero-scroll-cue-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(7px); opacity: 1; }
}

@media (min-width: 768px) {
    .hero-scroll-cue { bottom: 26px; gap: 6px; }
    .hero-scroll-cue-text { display: block; }
}

/* ══════════════════════
   CATEGORIAS EM CÍRCULO — estilo "Stories" (referência: ermos.com.br)
   Foto redonda pequena + nome da categoria embaixo, em scroll
   horizontal com scroll-snap. Mobile-first; no desktop os círculos
   crescem um pouco e a fileira fica centralizada (sem precisar rolar
   se couber tudo na tela).
══════════════════════ */
.collections {
    background: #ffffff;
    padding: 28px 0 8px;
    /* Evita que o clique no indicador "role para ver mais" esconda o
       título atrás da navbar fixa no topo */
    scroll-margin-top: var(--nav-height);
}

.collections-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 20px;
    color: var(--color-obsidian);
    margin: 0 20px 18px;
    letter-spacing: normal;
    text-align: center;
}

.collections-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 2px 20px 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.collections-track::-webkit-scrollbar { display: none; }

/* Cada categoria: círculo + label embaixo, tipo Stories do Instagram */
.collection-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    width: 76px;
    text-decoration: none;
    background: none;
    scroll-snap-align: start;
}

.collection-tile-img-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-soft-mist);
    border: 1px solid var(--color-concrete-gray);
    flex-shrink: 0;
}

.collection-tile img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.collection-tile:active img {
    transform: scale(1.06);
}

.collection-tile.is-active .collection-tile-img-wrap {
    border-color: var(--color-obsidian);
    border-width: 2px;
}

.collection-tile-content {
    position: static;
    padding: 0;
    z-index: auto;
    text-align: center;
}

/* Label "Coleção" e CTA "Comprar agora" não fazem sentido no formato
   círculo (não há espaço) — ficam ocultos mas seguem no HTML para o
   caso de voltar ao layout em cards. */
.collection-tile-label,
.collection-tile-cta {
    display: none;
}

.collection-tile-title {
    font-family: var(--font-body-medium);
    font-weight: 500;
    font-size: 12px;
    color: var(--color-obsidian);
    margin: 0;
    letter-spacing: normal;
    line-height: 1.25;
    white-space: normal;
}

/* Tablet/desktop: círculos um pouco maiores, fileira centralizada */
@media (min-width: 640px) {
    .collections-track {
        justify-content: center;
        gap: 32px;
        padding: 4px 20px 8px;
    }

    .collection-tile {
        width: 92px;
    }

    .collection-tile-img-wrap {
        width: 84px;
        height: 84px;
    }

    .collection-tile-title {
        font-size: 13px;
    }
}

@media (min-width: 960px) {
    .collections {
        padding: 48px 0 24px;
    }

    .collections-title {
        font-size: 30px;
        margin-bottom: 28px;
    }

    .collections-track {
        gap: 44px;
        padding: 4px 20px 8px;
    }

    .collection-tile {
        width: 116px;
    }

    .collection-tile-img-wrap {
        width: 108px;
        height: 108px;
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }

    .collection-tile-title {
        font-size: 15px;
    }

    .collection-tile:hover .collection-tile-img-wrap {
        border-color: var(--color-obsidian);
        transform: translateY(-4px);
        box-shadow: 0 14px 28px rgba(0,0,0,0.12);
    }

    .collection-tile:hover img {
        transform: scale(1.06);
    }
}

/* ══════════════════════
   FILEIRA DE PRODUTOS
══════════════════════ */
.product-row-section {
    padding: 40px 20px;
}

.product-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.product-row-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 26px;
    color: var(--color-obsidian);
    margin: 0;
    letter-spacing: normal;
}

.product-row-link {
    font-family: var(--font-body-medium);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-obsidian);
    text-decoration: underline;
    flex-shrink: 0;
}

.product-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.product-row::-webkit-scrollbar { display: none; }

.product-row-card {
    flex: 0 0 auto;
    width: 62vw;
    max-width: 220px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-row-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-soft-mist);
    overflow: hidden;
}

.product-row-img-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

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

.product-row-add-form {
    position: absolute;
    right: 8px;
    bottom: 8px;
    margin: 0;
    z-index: 2;
}

/* Botão "+" e painel de quantidade sobre a imagem do card */
.product-row-qty-controls {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
}

.qty-initial {
    display: flex;
}

.product-row-add {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--color-obsidian, #111111);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.product-row-add:hover {
    transform: scale(1.08);
}

.product-row-add:active {
    transform: scale(0.94);
}

.product-row-add:disabled {
    cursor: default;
    opacity: 0.7;
}

/* ── Painel de quantidade (aparece ao clicar no "+") ── */
.qty-active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    background: #fff;
    border-radius: var(--radius-sm, 8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 8px;
    animation: qtyPanelIn 0.15s ease-out;
}

@keyframes qtyPanelIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.qty-row-destaque {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

/* .qty-btn-destaque usa .btn-icon como base; aqui só o tamanho
   compacto (o card "Em destaque" é menor que o da listagem) */
.qty-btn-destaque {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    font-size: 15px;
}

.qty-num-destaque {
    flex: 1;
    text-align: center;
    font-family: var(--font-body-medium);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-obsidian, #111111);
    transition: color 0.2s ease;
}

.btn-confirmar-destaque {
    width: 100%;
    padding: 8px 0;
    font-size: var(--text-sm);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Selo "Esgotado" */
.product-row-esgotado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(17, 17, 17, 0.85);
    color: #fff;
    font-family: var(--font-body-medium);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 6px 0;
    border-radius: var(--radius-sm, 8px);
}

/* Nome e preço abaixo da imagem */
.product-row-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.product-row-name {
    font-family: var(--font-body-medium);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-obsidian);
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-row-price {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--color-steel);
    text-decoration: none;
}

/* ══════════════════════
   BARRA DE CONFIANÇA
   Mobile: grid 2x2, ícone num círculo + texto embaixo (sem scroll
   escondido, tudo visível de uma vez).
   Tablet/Desktop: volta a ser uma linha horizontal com separadores.
══════════════════════ */
.trust-bar {
    background: #ffffff;
    border-top: 1px solid var(--color-concrete-gray);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--color-concrete-gray);
    padding: 0;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 22px 12px;
    background: #ffffff;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 400;
    color: var(--color-obsidian);
}

.trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-soft-mist);
    color: var(--color-obsidian);
    flex-shrink: 0;
}

.trust-text {
    max-width: 130px;
}

.trust-divider {
    display: none;
}

/* ════════════════════════════════════════════════════════════
   TABLET — 600px+
════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .trust-bar {
        grid-template-columns: repeat(4, 1fr);
    }

    .trust-item {
        padding: 28px 16px;
    }
}

/* ════════════════════════════════════════════════════════════
   DESKTOP — 960px+
════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
    .trust-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: #ffffff;
        border-top: 1px solid var(--color-concrete-gray);
        padding: 0 48px;
    }

    .trust-item {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        padding: 22px 32px;
        transition: color var(--transition);
    }

    .trust-icon {
        width: 32px;
        height: 32px;
        background: transparent;
    }

    .trust-text {
        max-width: none;
        white-space: nowrap;
    }

    .trust-item:hover { color: var(--color-obsidian); }

    .trust-divider {
        display: block;
        width: 1px;
        height: 24px;
        background: var(--color-concrete-gray);
        flex-shrink: 0;
    }
}

/* ════════════════════════════════════════════════════════════
   TABLET — 600px+
════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .hero-video-copy { padding: 0 40px 72px; max-width: 560px; }
    .hero-video-title { font-size: 52px; }
    .hero-video-sub { font-size: 15px; }

    .collections-title { margin-left: 40px; margin-right: 40px; font-size: 26px; }
    .collections-track { padding: 4px 40px 8px; }

    .product-row-section { padding: 48px 40px; }
    .product-row { margin: 0 -40px; padding-left: 40px; padding-right: 40px; }
    .product-row-card { width: 240px; }
}

/* ════════════════════════════════════════════════════════════
   DESKTOP — 960px+
════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
    .hero-video { height: 86vh; min-height: 560px; }

    .hero-video-copy { padding: 0 64px 84px; max-width: 620px; }
    .hero-video-eyebrow { font-size: 13px; margin-bottom: 18px; }
    .hero-video-title { font-size: 68px; margin-bottom: 20px; }
    .hero-video-sub { font-size: 16px; margin-bottom: 30px; }

    .hero-video .btn-primary { padding: 13px 28px; }
    .hero-video .btn-primary:hover { opacity: 0.9; }
    .hero-video .btn-primary:hover svg { transform: translateX(3px); }

    /* Desktop: mesma linguagem visual do mobile (círculos estilo Stories) —
       o tamanho/espaçamento maior já é ajustado no bloco de 960px logo
       acima, junto com o resto do componente .collections. Isso evita ter
       dois estilos diferentes brigando entre celular e PC. */

    .product-row-section { padding: 56px 48px; }
    .product-row-header { margin-bottom: 24px; }
    .product-row-title { font-size: 32px; }
    .product-row-link { font-size: 14px; }
    .product-row { margin: 0 -48px; padding-left: 48px; padding-right: 48px; gap: 20px; }
    .product-row-card { width: 260px; }
    .product-row-card:hover .product-row-img-wrap img { transform: scale(1.04); }
    .product-row-img-wrap img { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
}
