/* =========================================================================
   Panamar homepage body sections — shared base + per-section styles
   ========================================================================= */

/* Body-wide bg (homepage uses #eee per Figma) ------------------------- */
body.homepage {
    background: #eeeeee;
    color: #161616;
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
}

/* Foco global: ao clicar com o rato não mostra o anel escuro do browser;
   com teclado (Tab) mantém um anel de marca visível (acessibilidade). */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid #161616; outline-offset: 2px; }

/* Section container with consistent gutter --------------------------- */
.selecao-curada__container {
    /* No max-width — match header/footer/Universos full-width gutter */
    padding: 0 24px;
}
@media (min-width: 1024px) {
    .selecao-curada__container { padding: 0 40px; }
}

/* =====================================================================
   SELEÇÃO CURADA
   ===================================================================== */

.selecao-curada {
    padding: 48px 0 32px;
}

.selecao-curada__title {
    margin: 0 0 28px;
    color: #161616;
    font-family: 'Spectral', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
}

.selecao-curada__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

/* Tabs (Figma: thin-border pill, transparent until active) ----------- */
.selecao-curada__tabs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.selecao-curada__tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: 4px;
    color: rgba(22, 22, 22, 0.5);
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.selecao-curada__tab:hover { color: rgba(22, 22, 22, 0.8); }
.selecao-curada__tab.is-active {
    border-color: #161616;
    color: #161616;
}

/* Explorar tudo link — only the active tab's link shows ------------- */
.selecao-curada__explorar { position: relative; min-height: 1em; }
.selecao-curada__explorar-link {
    display: none;
    color: #161616;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.selecao-curada__explorar-link.is-active { display: inline-block; }
.selecao-curada__explorar-link:hover { color: #161616; opacity: 0.6; } /* força cor: há um a:hover{color:#fff} global */

/* Panes — only active is visible -------------------------------------- */
.selecao-curada__pane { display: none; }
.selecao-curada__pane.is-active { display: block; }

/* Product grid -------------------------------------------------------- */
.selecao-curada__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .selecao-curada__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}
@media (min-width: 1024px) {
    .selecao-curada__grid { gap: 38px; }
}

/* Product card -------------------------------------------------------- */
.selecao-curada__card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.selecao-curada__card-img {
    position: relative;
    aspect-ratio: 428 / 533;
    background: #d9d9d9;
    overflow: hidden;
    border-radius: 0; /* per Figma — no card radius */
}

/* Image stack — all layered absolutely, only .is-active is visible. JS swaps
   the class for cycling. On hover, the active layer scales up slightly. */
.selecao-curada__card-img-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.selecao-curada__card-img-layer.is-active { opacity: 1; }
.selecao-curada__card:hover .selecao-curada__card-img-layer.is-active {
    transform: scale(1.03);
}

/* Arrow buttons — hidden until card hover */
.selecao-curada__card-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Fundo escuro por defeito para a seta (ícone branco) se ver sobre fundos claros. */
    background: rgba(0, 0, 0, 0.38);
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}
.selecao-curada__card:hover .selecao-curada__card-arrow { opacity: 1; }
.selecao-curada__card-arrow:hover { background: rgba(0, 0, 0, 0.58); }
.selecao-curada__card-arrow--left { left: 6px; }
.selecao-curada__card-arrow--right { right: 6px; }

/* Dot indicators — active dot wider per Figma (16px × 6px pill) */
.selecao-curada__card-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}
.selecao-curada__card-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #ffffff;
    opacity: 0.5;
    transition: width 0.3s ease, opacity 0.3s ease;
}
.selecao-curada__card-dot.is-active {
    width: 16px;
    opacity: 1;
}

.selecao-curada__card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ffffff;
    color: #161616;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.2;
}

.selecao-curada__card-body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selecao-curada__card-title {
    margin: 0;
    color: #161616;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
}

.selecao-curada__card-price {
    margin: 0;
    color: #161616;
    font-family: 'Spectral', Georgia, serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}
.selecao-curada__card-price--consulta { color: #6a6a6a; font-style: italic; } /* igual à listagem */

/* Empty state --------------------------------------------------------- */
.selecao-curada__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #808080;
    font-style: italic;
    font-size: 14px;
    padding: 32px 0;
}

/* Decorative emblem divider — Figma: centered between Seleção Curada
   grid and Universos Panamar section, mt-12 (48px). Color hardcoded #808080
   in the SVG asset itself. */
.selecao-curada__divider {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}
.selecao-curada__divider img {
    display: block;
    width: 82px;
    height: 96px; /* explicit — some browsers collapse SVG with only viewBox */
}

/* =====================================================================
   UNIVERSOS PANAMAR
   ===================================================================== */

.universos { padding: 16px 0 48px; }

.universos__container {
    /* No max-width — match the header/footer's full-width gutter (40px desktop) */
    padding: 0 24px;
}
@media (min-width: 1024px) {
    .universos__container { padding: 0 40px; }
}

.universos__title {
    margin: 0 0 28px;
    color: #161616;
    font-family: 'Spectral', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
}

.universos__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .universos__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}
@media (min-width: 1024px) {
    .universos__grid { gap: 38px; }
}

.universos__card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: #ffffff;
    cursor: pointer;
    aspect-ratio: 1060 / 533;
    background: #d9d9d9;
    border-radius: 0; /* Figma: square edges */
}

.universos__card-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.universos__card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.universos__card:hover .universos__card-img {
    transform: scale(1.05);
}
.universos__card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.universos__card-content {
    position: absolute;
    left: 24px;
    bottom: 32px;
    z-index: 1;
}

.universos__card-title {
    margin: 0 0 20px;
    color: #ffffff;
    font-family: 'Spectral', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
}

.universos__card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 139px;
    height: 41px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #ffffff;
    border-radius: 5px;
    color: #ffffff;
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    transition: opacity 0.2s ease;
}
.universos__card:hover .universos__card-cta { opacity: 0.85; }

.universos__empty {
    color: #808080;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    padding: 32px 0;
}

/* =====================================================================
   LOOKS PANAMAR
   Same structure as Seleção Curada (title + tab bar + image-cycling cards)
   but: portrait aspect (428/693), no title/price below the image.
   ===================================================================== */

.looks { padding: 16px 0 48px; }

.looks__container {
    padding: 0 24px;
}
@media (min-width: 1024px) {
    .looks__container { padding: 0 40px; }
}

.looks__title {
    margin: 0 0 28px;
    color: #161616;
    font-family: 'Spectral', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
}

/* Tabs — same visual style as Seleção Curada */
.looks__tabs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.looks__tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: 4px;
    color: rgba(22, 22, 22, 0.5);
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.looks__tab:hover { color: rgba(22, 22, 22, 0.8); }
.looks__tab.is-active {
    border-color: #161616;
    color: #161616;
}

/* Panes */
.looks__pane { display: none; }
.looks__pane.is-active { display: block; }

/* Grid */
.looks__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .looks__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}
@media (min-width: 1024px) {
    .looks__grid { gap: 38px; }
}

/* Card — taller than Seleção Curada (428/693 vs 428/533), no body */
.looks__card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.looks__card-img {
    position: relative;
    aspect-ratio: 428 / 693;
    background: #d9d9d9;
    overflow: hidden;
}

.looks__card-img-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.looks__card-img-layer.is-active { opacity: 1; }
.looks__card:hover .looks__card-img-layer.is-active {
    transform: scale(1.03);
}

.looks__card-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Fundo escuro por defeito para a seta (ícone branco) se ver sobre fundos claros. */
    background: rgba(0, 0, 0, 0.38);
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}
.looks__card:hover .looks__card-arrow { opacity: 1; }
.looks__card-arrow:hover { background: rgba(0, 0, 0, 0.58); }
.looks__card-arrow--left { left: 6px; }
.looks__card-arrow--right { right: 6px; }

.looks__card-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}
.looks__card-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #ffffff;
    opacity: 0.5;
    transition: width 0.3s ease, opacity 0.3s ease;
}
.looks__card-dot.is-active {
    width: 16px;
    opacity: 1;
}

.looks__empty {
    grid-column: 1 / -1;
    color: #808080;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    padding: 32px 0;
}

/* =====================================================================
   HISTÓRIA DIVIDER  (small editorial transition before Traços de História)
   ===================================================================== */

.historia-divider {
    padding: 16px 24px 48px;
    text-align: center;
}

.historia-divider__emblem {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.historia-divider__emblem img {
    display: block;
    width: 82px;
    height: 96px;
}

.historia-divider__text {
    margin: 0 auto;
    max-width: 860px;
    color: #3b3b3b;
    font-family: 'Spectral', Georgia, serif;
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 400;
    line-height: 1.5;
}

/* =====================================================================
   TRAÇOS DE HISTÓRIA  (full-width hero-like banner, end of homepage body)
   ===================================================================== */

.tracos {
    position: relative;
    width: 100%;
    min-height: 460px;
    max-height: 700px;
    height: 55vw;
    overflow: hidden;
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
}

.tracos__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.tracos__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tracos__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 10%,
        rgba(0, 0, 0, 0.45) 75%
    );
    pointer-events: none;
}

.tracos__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 56px;
    text-align: center;
}

/* Texto editorial por cima do título, dentro do banner (sobre a imagem). */
.tracos__intro {
    margin: 0 auto 20px;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Spectral', Georgia, serif;
    font-size: clamp(16px, 1.9vw, 22px);
    font-weight: 400;
    line-height: 1.4;
}

.tracos__caption {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.tracos__title {
    margin: 0 0 28px;
    color: #ffffff;
    font-family: 'Spectral', Georgia, serif;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 400;
    line-height: 1.1;
}

.tracos__cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 157px;
    height: 41px;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #ffffff;
    border-radius: 5px;
    color: #ffffff;
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.tracos__cta:hover { opacity: 0.8; }
.tracos__cta:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* =====================================================================
   CATEGORY LANDING (Phase 3A — Moda / Decoração / Arte top-level pages)
   ===================================================================== */

body.panamar-page {
    background: #eeeeee;
    color: #161616;
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    margin: 0;
}

.categoria-landing {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden; /* trava qualquer scroll horizontal residual desta página */
}

/* Dark hero with category name */
.categoria-landing__hero {
    position: relative;
    overflow: hidden;
    background: #161616; /* fallback quando a categoria não tem imagem */
    padding: 112px 24px 48px; /* extra top padding so the transparent header doesn't cover the label */
    text-align: center;
}
/* Imagem de fundo do hero = campo Imagem da categoria (Catálogo) */
.categoria-landing__hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.categoria-landing__hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55); /* escurece p/ o texto branco continuar legível (= protótipo) */
    z-index: 1;
}
.categoria-landing__hero-content {
    position: relative; /* fica por cima da imagem + overlay */
    z-index: 2;
}
@media (min-width: 1024px) {
    .categoria-landing__hero { padding: 128px 40px 56px; }
}

.categoria-landing__hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.categoria-landing__hero-label {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.categoria-landing__hero-title {
    margin: 0;
    color: #ffffff;
    font-family: 'Spectral', Georgia, serif;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 400;
    line-height: 1.1;
}

/* Card grid */
.categoria-landing__grid-wrap {
    flex: 1;
    padding: 40px 24px;
}
@media (min-width: 1024px) {
    .categoria-landing__grid-wrap { padding: 40px; }
}

/* Flex (em vez de grid) para CENTRAR quando os cards não preenchem a linha
   inteira (ex.: Moda só tem 2 subcategorias). 2 por linha no mobile, 5 no
   desktop (Arte tem 5 subcats → cabem numa linha); justify-content:center
   trata das linhas parciais. max-width alto p/ ocupar quase toda a largura,
   deixando só as margens do grid-wrap. */
.categoria-landing__grid {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}
@media (min-width: 1024px) {
    .categoria-landing__grid { gap: 20px; }
}

.categoria-landing__card {
    position: relative;
    display: block;
    flex: 0 1 calc(50% - 8px);   /* 2 por linha (gap 16 → 8 de cada lado) */
    min-width: 0;
    max-width: 460px;
    overflow: hidden;
    text-decoration: none;
    color: #ffffff;
    cursor: pointer;
    aspect-ratio: 3 / 4;
    background: #d9d9d9;
}
@media (min-width: 1024px) {
    /* 5 por linha (gap 20 × 4 / 5 = 16) */
    .categoria-landing__card { flex-basis: calc(20% - 16px); }
}

.categoria-landing__card-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.categoria-landing__card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}
.categoria-landing__card:hover .categoria-landing__card-img {
    transform: scale(1.05);
}
.categoria-landing__card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
}
.categoria-landing__card-tint {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease;
    pointer-events: none;
}
.categoria-landing__card:hover .categoria-landing__card-tint {
    background: rgba(0, 0, 0, 0.1);
}

.categoria-landing__card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 24px 28px;
    z-index: 1;
}
.categoria-landing__card-sub {
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 300;
}
.categoria-landing__card-title {
    margin: 0 0 20px;
    color: #ffffff;
    font-family: 'Spectral', Georgia, serif;
    /* Fluido: evita o título gigante nos cartões estreitos (2-up no telemóvel). */
    font-size: clamp(18px, 3.4vw, 28px);
    font-weight: 400;
    line-height: 1.1;
}
.categoria-landing__card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Largura flexível (era 139px fixo → transbordava o cartão no telemóvel). */
    width: auto;
    min-width: 120px;
    max-width: 100%;
    height: 41px;
    padding: 0 18px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #ffffff;
    border-radius: 5px;
    color: #ffffff;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}
/* Telemóvel: cartões estreitos → menos padding, CTA à largura toda. */
@media (max-width: 560px) {
    .categoria-landing__card-content { padding: 16px 14px 18px; }
    .categoria-landing__card-title { margin-bottom: 12px; }
    .categoria-landing__card-cta { width: 100%; min-width: 0; height: 38px; padding: 0 10px; font-size: 12px; }
}

.categoria-landing__empty {
    text-align: center;
    color: #808080;
    font-style: italic;
    padding: 48px 0;
}

/* ─── Touch fallback ──────────────────────────────────────────────────
   As setas dos carrosséis dos cartões (Seleção Curada / Looks) só aparecem
   em :hover, ficando inacessíveis em telemóvel. Em ecrãs sem hover tornam-se
   permanentemente visíveis para poderem ser tocadas. */
@media (hover: none) {
    .selecao-curada__card-arrow,
    .looks__card-arrow { opacity: 1; }
}
