/* ====================================================
   Histórico de Camisas (Nova Dobra)
   Módulo independente — sem parallax.
   ==================================================== */

/* ─── Seção ─── */
.hc-historico-section {
    position: relative;
    padding: 6rem 0;
    background-color: var(--neutral-50, #f8fafc);
    overflow: hidden;
    font-family: var(--font-primary, -apple-system, sans-serif);
    z-index: 1;
}

.hc-historico-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* ─── Header ─── */
.hc-historico-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.hc-historico-header h2 {
    font-size: 2.5rem;
    color: var(--neutral-900, #1e293b);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* ─── Filtros ─── */
.hc-historico-filters {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center; /* Equilibrado ao centro no desktop */
    align-items: center;
    gap: 0.5rem; /* Compacto, mas confortável */
    margin-bottom: 2rem;
    position: relative;
    z-index: 3;
    /* Remover overflow no desktop para forçar mesma linha e sem scroll */
    padding-bottom: 0.5rem;
}

.hc-mobile-active-label {
    display: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-700, #4b5563);
    margin-bottom: 2rem;
    transition: opacity 0.2s ease;
}



.hc-historico-filter-btn {
    background: transparent;
    border: none;
    padding: 5px; /* Hit area confortável ~40px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    flex-shrink: 0;
    position: relative;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hc-filter-color-indicator {
    display: block;
    width: 30px; /* ~28px a 34px de diâmetro */
    height: 30px;
    border-radius: 50%;
    background: rgb(var(--f-rgb, 220, 100, 19));
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); /* Ajustado para 200ms */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0.45; /* Opacidade reduzida inativo */
}

.hc-filter-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--f-text, #fff);
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    padding-left: 0;
    transition: max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) 0s, 
                padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Estado ativo do filtro circular */
.hc-historico-filter-btn.active {
    background: rgb(var(--f-rgb, 220, 100, 19));
    padding: 5px 16px 5px 5px;
    box-shadow: 0 4px 12px rgba(var(--f-rgb, 220, 100, 19), 0.3);
}

.hc-historico-filter-btn.active .hc-filter-text {
    max-width: 150px;
    opacity: 1;
    padding-left: 8px;
    transition: max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s, 
                padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hc-historico-filter-btn.active .hc-filter-color-indicator {
    box-shadow: none;
    border: 2px solid rgba(255,255,255,0.25);
    opacity: 1; /* Cor selecionada 100% de intensidade */
}

/* Filtro TODAS (is-all) */
.hc-historico-filter-btn.is-all {
    background: transparent;
    height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(var(--f-rgb, 220, 100, 19), 0.3);
    color: rgb(var(--f-rgb, 220, 100, 19));
}

.hc-historico-filter-btn.is-all .hc-filter-text {
    max-width: none;
    opacity: 1;
    padding-left: 0;
    color: inherit;
}

.hc-historico-filter-btn.is-all.active {
    background: rgb(var(--f-rgb, 220, 100, 19));
    color: var(--f-text, #fff);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(var(--f-rgb, 220, 100, 19), 0.3);
}

/* Hover e Foco Acessível */
.hc-historico-filter-btn:not(.active):hover .hc-filter-color-indicator {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    opacity: 0.8; /* Aumenta a opacidade temporariamente no hover */
}

.hc-historico-filter-btn.is-all:not(.active):hover {
    background: rgba(var(--f-rgb, 220, 100, 19), 0.08);
}

.hc-historico-filter-btn:focus-visible {
    outline: 2px solid var(--accent-background-bg-tint-01, #DC6413);
    outline-offset: 4px;
}

/* Tooltip Desktop */
.hc-filter-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--neutral-900, #333333);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.hc-filter-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: var(--neutral-900, #333333) transparent transparent transparent;
}

@media (hover: hover) and (pointer: fine) {
    .hc-historico-filter-btn:not(.active):hover .hc-filter-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* ─── Marca d'água do ano ─── */
.hc-historico-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 55vw;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--accent-background-bg-tint-01, #DC6413);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    line-height: 0.8;
    white-space: nowrap;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
}

.hc-historico-watermark.updating {
    opacity: 0 !important;
    transform: translate(-50%, -45%);
    filter: blur(8px);
}

@media (max-width: 1024px) {
    .hc-historico-watermark {
        font-size: 70vw;
    }
}

@media (max-width: 768px) {
    .hc-historico-watermark {
        font-size: 90vw;
    }
}

/* ─── Carrossel ─── */
.hc-historico-carousel-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: 2rem;
}

.hc-historico-carousel {
    transition: opacity 0.3s ease;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hc-historico-carousel::-webkit-scrollbar {
    display: none;
}

/* ─── Cards ─── */
.hc-historico-card {
    flex: 0 0 400px;
    height: 550px;
    perspective: 1000px;
    scroll-snap-align: center;
    cursor: pointer;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 768px) {
    .hc-historico-card {
        flex: 0 0 280px;
        height: 400px;
    }
}

.hc-historico-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
    border-radius: 24px;
    box-shadow: 0 12px 40px -12px rgba(0,0,0,0.2);
}

/* ─── Hover / Opacidade ─── */
@media (hover: hover) and (pointer: fine) {
    .hc-historico-card {
        opacity: 0.85;
    }

    .hc-historico-card:hover,
    .hc-historico-card:focus-within {
        opacity: 1;
        transform: scale(1.015) translateY(-2px);
    }

    

    
}

@media (hover: none) {
    .hc-historico-card {
        opacity: 1;
    }
}

/* ─── Flip ─── */


.hc-historico-card-front,
.hc-historico-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
    background-color: var(--neutral-0, #ffffff);
    outline: 1px solid transparent;
}

.hc-historico-card-front {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.hc-historico-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hc-historico-card-back {
    
    padding: 4.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: none;
}

.hc-historico-card-back h3 {
    font-size: 1.5rem;
    color: var(--accent-background-bg-tint-01, #DC6413);
    margin-bottom: 0.5rem;
}

.hc-historico-card-back .hc-card-year {
    font-size: 1.125rem;
    color: var(--neutral-600, #64748b);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hc-historico-card-back p {
    color: var(--neutral-900, #1e293b);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.hc-historico-card-back .hc-card-curiosity {
    font-style: italic;
    color: var(--neutral-600, #64748b);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--neutral-300, #e2e8f0);
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    .hc-historico-card-inner {
        transition: none;
        transform: none !important;
    }

    

    

    .hc-historico-card-back {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .hc-historico-carousel {
        scroll-behavior: auto;
    }
}

/* ─── Alinhamento edge-to-edge ─── */
.hc-historico-card:first-child {
    margin-left: max(2rem, calc((100vw - 1440px) / 2 + 2rem));
}
.hc-historico-card:last-child {
    margin-right: max(2rem, calc((100vw - 1440px) / 2 + 2rem));
}

/* ─── Indicador + de Flip ─── */
.hc-flip-indicator {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background-color: var(--neutral-0, #fff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-background-bg-tint-01, #DC6413);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 3;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.hc-flip-indicator:hover {
    transform: scale(1.05);
}

.hc-flip-indicator .material-symbols-outlined {
    font-size: 24px;
    font-weight: 500;
    transition: transform 0.3s ease;
}

/* ─── Setas de navegação ─── */
.hc-carousel-btn {
    position: absolute;
    top: calc(50% - 1rem);
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background-color: var(--neutral-0, #fff);
    border: none;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-900, #1e293b);
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.hc-carousel-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.hc-carousel-btn.disabled {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.hc-carousel-btn.prev {
    left: max(1rem, calc((100vw - 1440px) / 2 + 0.5rem));
}

.hc-carousel-btn.next {
    right: max(1rem, calc((100vw - 1440px) / 2 + 0.5rem));
}

@media (max-width: 768px) {
    .hc-carousel-btn {
        width: 48px;
        height: 48px;
    }
}

/* ─── Animação de entrada dos cards ─── */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* LIKE BUTTON OVERRIDE */
.hc-like-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: var(--neutral-foreground-fg-high-contrast, #222);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    border: none;
    cursor: pointer;
    outline: none;
}

.hc-like-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.hc-like-btn .hc-heart-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hc-like-btn.liked .hc-heart-icon {
    fill: var(--accent-background-bg-tint-01, #DC6413);
    stroke: var(--accent-background-bg-tint-01, #DC6413);
    animation: heartBeat 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Estado restaurado do localStorage: mantém o visual "curtido" sem reexecutar
   a animação de clique. A classe sai na primeira interação real do usuário. */
.hc-like-btn.is-restored .hc-heart-icon {
    animation: none;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Ano na frente do card */
.hc-card-year {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: var(--neutral-900, #1e293b);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.6;
    z-index: 2;
    transition: opacity 0.3s;
}

.hc-historico-card:hover .hc-card-year {
    opacity: 1;
}


/* Ocultar ano visualmente */
.hc-card-year { display: none !important; }

.hc-historico-filters::-webkit-scrollbar {
    height: 4px;
}
.hc-historico-filters::-webkit-scrollbar-track {
    background: transparent;
}
.hc-historico-filters::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

@media (max-width: 1024px) {
    .hc-historico-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .hc-historico-filters {
        overflow-x: visible;
        justify-content: center;
        gap: 6px;
        margin-bottom: 0.5rem;
        padding: 0 24px; /* Respiro lateral para telas maiores */
        width: 100%;
        box-sizing: border-box;
    }

    .hc-mobile-active-label {
        display: block;
    }

    .hc-filter-color-indicator {
        width: 24px;
        height: 24px;
    }

    .hc-historico-filter-btn {
        padding: 6px; 
    }

    .hc-historico-filter-btn.active:not(.is-all) {
        background: transparent;
        padding: 6px;
        box-shadow: none;
    }

    .hc-historico-filter-btn.active:not(.is-all) .hc-filter-text {
        max-width: 0;
        opacity: 0;
        padding-left: 0;
    }

    .hc-historico-filter-btn.active:not(.is-all) .hc-filter-color-indicator {
        border: none;
        box-shadow: 0 0 0 2px var(--surface-canvas, #FBFBFA), 0 0 0 4px rgb(var(--f-rgb, 220, 100, 19));
        opacity: 1;
        transform: scale(1.05);
    }
    
    .hc-historico-filter-btn.is-all {
        padding: 0 10px;
        height: 36px;
    }

    .hc-historico-filter-btn.is-all.active {
        padding: 0 10px;
    }
}

@media (max-width: 430px) {
    .hc-historico-filters {
        gap: 4px;
        padding: 0 20px; /* Respiro lateral ideal */
    }
    .hc-filter-color-indicator {
        width: 22px;
        height: 22px;
    }
    .hc-historico-filter-btn {
        padding: 6px;
    }
    .hc-historico-filter-btn.active:not(.is-all) {
        padding: 6px;
    }
    .hc-historico-filter-btn.is-all {
        padding: 0 8px;
        height: 34px;
    }
}

@media (max-width: 374px) {
    .hc-historico-filters {
        gap: 2px;
        padding: 0 16px; /* Respiro lateral mínimo aceitável */
    }
    .hc-filter-color-indicator {
        width: 20px;
        height: 20px;
    }
    .hc-historico-filter-btn {
        padding: 5px;
    }
    .hc-historico-filter-btn.active:not(.is-all) {
        padding: 5px;
    }
    .hc-historico-filter-btn.is-all {
        padding: 0 6px;
        height: 30px;
    }
    .hc-historico-filter-btn.is-all .hc-filter-text {
        font-size: 0.75rem;
    }
    .hc-historico-filter-btn.active:not(.is-all) .hc-filter-color-indicator {
        box-shadow: 0 0 0 1px var(--surface-canvas, #FBFBFA), 0 0 0 2.5px rgb(var(--f-rgb, 220, 100, 19));
    }
}
