.pf-relation-section {
    background: #fff;
    overflow: hidden;
    scroll-margin-top: 90px;
}

.pf-relation-section__header {
    margin-bottom: 26px;
    text-align: center;
}

.pf-relation-section__header h2 {
    color: var(--text);
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.2;
    margin: 0;
}

.pf-relation-tabs {
    align-items: stretch;
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 0 auto -1px;
    max-width: 100%;
    overflow-x: auto;
    padding: 0 4px;
    scrollbar-width: none;
}

.pf-relation-tabs::-webkit-scrollbar { display: none; }

.pf-relation-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 12px 12px 0 0;
    color: #80798a;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    gap: 7px;
    min-width: 122px;
    padding: 15px 18px;
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.pf-relation-tab > i { color: var(--primary); font-size: 19px; }
.pf-relation-tab:hover { color: var(--text); transform: translateY(-2px); }
.pf-relation-tab:focus-visible { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25); outline: 0; }
.pf-relation-tab.is-active { background: var(--surface-tint); box-shadow: 0 -3px 18px rgba(43, 30, 120, 0.08); color: var(--text); font-weight: 700; }

.pf-relation-panels {
    background: var(--surface-tint);
    border: 1px solid #f0e9f0;
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(43, 30, 120, 0.06);
    padding: clamp(16px, 2.4vw, 28px);
}

.pf-relation-panel.is-entering { animation: pf-relation-fade 300ms ease both; }

/* .pf-relation-products cards are rendered by perfexia_product_card() and
   styled by .pf-product-card in components.css; this file only adjusts the
   gap and the mobile layout below. */
.pf-relation-products { gap: 18px; }

@keyframes pf-relation-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    /* Cards stack (image on top, text below) rather than going side-by-side:
       the outer .pf-product-grid is already 2 columns at this width (see
       components.css), so an image+content side-by-side split inside each
       card left almost no room for the title, forcing the browser to break
       mid-word. Full-width stacking gives the title the whole card width
       to wrap normally. */
    .pf-relation-tabs { justify-content: flex-start; }
    .pf-relation-tab { min-width: 108px; padding: 13px 14px; }
    .pf-relation-products .pf-product-card { display: block; }
    .pf-relation-products .pf-product-card__media { aspect-ratio: 4 / 3; }
    .pf-relation-products .pf-product-card__content { padding: 13px; }
    .pf-relation-products .pf-product-card__cart { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .pf-relation-section *, .pf-relation-section *::before, .pf-relation-section *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
