.psd-directory {
    --psd-ink: #17212b;
    --psd-muted: #536273;
    --psd-line: #dce4eb;
    --psd-blue: #0868b2;
    --psd-blue-dark: #064d84;
    --psd-green: #2f6b31;
    width: min(1240px, 100%);
    margin: 24px auto 60px;
    color: var(--psd-ink);
}

.psd-directory *,
.psd-featured-grid * {
    box-sizing: border-box;
}

.psd-directory__intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    margin-bottom: 18px;
    padding: clamp(22px, 4vw, 40px);
    border-radius: 18px;
    background: linear-gradient(135deg, #eef6fb, #fff 66%);
}

.psd-directory__intro h2 {
    margin: 0 0 8px;
    color: var(--psd-ink);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.15;
}

.psd-directory__intro p:last-child {
    max-width: 760px;
    margin: 0;
    color: var(--psd-muted);
}

.psd-eyebrow {
    margin: 0 0 6px;
    color: var(--psd-blue-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.psd-directory__paths {
    display: grid;
    gap: 8px;
    min-width: 190px;
}

.psd-directory__paths a {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid #b9d1e1;
    border-radius: 9px;
    background: #fff;
    color: var(--psd-blue-dark);
    font-size: 0.8rem;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.psd-directory__paths a:hover,
.psd-directory__paths a:focus-visible {
    border-color: var(--psd-blue);
    background: #eaf4fa;
}

.psd-filters {
    margin-bottom: 20px;
    border: 1px solid var(--psd-line);
    border-radius: 14px;
    background: #fff;
}

.psd-filters summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 900;
}

.psd-filters__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 12px;
}

.psd-filters label {
    display: grid;
    gap: 4px;
    color: #405365;
    font-size: 0.75rem;
    font-weight: 800;
}

.psd-filters input,
.psd-filters select {
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    border: 1px solid #bfcbd5;
    border-radius: 8px;
    background: #fff;
    color: var(--psd-ink);
    font: inherit;
    font-size: 0.82rem;
}

.psd-filters input:focus,
.psd-filters select:focus {
    outline: 3px solid rgba(8, 104, 178, 0.2);
    border-color: var(--psd-blue);
}

.psd-reset {
    margin: 0 18px 16px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--psd-blue-dark);
    cursor: pointer;
    font-weight: 800;
    text-decoration: underline;
}

.psd-grid,
.psd-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.psd-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--psd-line);
    border-top: 5px solid #166a9a;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(23, 33, 43, 0.06);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.psd-card[hidden] {
    display: none;
}

.psd-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 27px rgba(23, 33, 43, 0.1);
}

.psd-card__media {
    position: relative;
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8fafb;
}

.psd-card__media > a {
    display: flex;
    width: 100%;
    min-height: 180px;
    align-items: center;
    justify-content: center;
}

.psd-card__media .swp-product-image {
    max-height: 190px;
}

.psd-card__compare {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #c7d2db;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 900;
}

.psd-card__compare input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--psd-blue);
}

.psd-card__rating {
    position: absolute;
    right: 0;
    bottom: 10px;
    padding: 6px 9px;
    border-radius: 8px 0 0 8px;
    background: #102c46;
    color: #fff;
    font-size: 0.7rem;
}

.psd-card__rating strong {
    font-size: 1.05rem;
}

.psd-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.psd-card__class {
    align-self: flex-start;
    margin-bottom: 7px;
    padding: 3px 8px;
    border-radius: 99px;
    background: #eaf2f7;
    color: #405365;
    font-size: 0.67rem;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.psd-card__guide-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.psd-card__brand-guide {
    color: #405365;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
}

.psd-card__brand-guide:hover,
.psd-card__brand-guide:focus-visible {
    color: var(--psd-blue-dark);
    text-decoration: underline;
}

.psd-card h3 {
    min-height: 2.6em;
    margin: 0 0 12px;
    font-size: 1.08rem;
    line-height: 1.3;
}

.psd-card h3 a {
    color: var(--psd-ink);
    text-decoration: none;
}

.psd-card__specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}

.psd-card__specs > div {
    min-width: 0;
    padding: 7px;
    border-radius: 7px;
    background: #f4f7f9;
}

.psd-card__specs dt {
    color: var(--psd-muted);
    font-size: 0.62rem;
    font-weight: 700;
}

.psd-card__specs dd {
    overflow: hidden;
    margin: 2px 0 0;
    font-size: 0.76rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psd-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.psd-button--details {
    margin-top: auto;
    border: 1px solid #b9c9d4;
    background: #eef4f7;
    color: #173d59;
}

.psd-card .swp-cta-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
}

.psd-card__retailers {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--psd-line);
}

.psd-card__retailers > span {
    display: block;
    margin-bottom: 5px;
    color: var(--psd-muted);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Keep retailer buttons visible even if a page builder delays shared CSS. */
.psd-card .swp-cta {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.psd-card .swp-cta--primary {
    border-color: #2f6b31;
    background: #2f6b31;
    color: #fff !important;
}

.psd-card .swp-cta--secondary {
    border-color: #db8b16;
    background: #fff8ec;
    color: #442800 !important;
}

.psd-card .swp-cta:only-child {
    grid-column: 1 / -1;
}

.psd-empty {
    padding: 40px;
    text-align: center;
}

.psd-compare-dock {
    position: fixed;
    z-index: 9998;
    right: 20px;
    bottom: 20px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: min(660px, calc(100% - 40px));
    padding: 12px;
    border: 1px solid #b8c8d3;
    border-left: 6px solid var(--psd-blue);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 35px rgba(23, 33, 43, 0.2);
    backdrop-filter: blur(8px);
}

.psd-compare-dock[hidden] {
    display: none;
}

.psd-compare-dock > div {
    display: grid;
    min-width: 0;
}

.psd-compare-dock [data-psd-selected-names] {
    overflow: hidden;
    color: var(--psd-muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psd-button--compare {
    background: var(--psd-green);
    color: #fff;
}

.psd-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.psd-button--clear {
    background: #edf1f4;
    color: #374957;
}

@media (max-width: 980px) {
    .psd-filters__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .psd-grid,
    .psd-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .psd-directory__intro {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .psd-directory__paths {
        min-width: 0;
        grid-template-columns: 1fr 1fr;
    }

    .psd-filters:not([open]) .psd-filters__grid,
    .psd-filters:not([open]) .psd-reset {
        display: none;
    }

    .psd-filters__grid {
        grid-template-columns: 1fr 1fr;
        padding-inline: 12px;
    }

    .psd-grid,
    .psd-featured-grid {
        grid-template-columns: 1fr;
    }

    .psd-card__media {
        min-height: 205px;
    }

    .psd-compare-dock {
        right: 8px;
        bottom: 8px;
        grid-template-columns: 1fr auto;
        width: calc(100% - 16px);
    }

    .psd-button--clear {
        grid-column: 1 / -1;
        min-height: 34px;
    }
}

@media (max-width: 400px) {
    .psd-filters__grid {
        grid-template-columns: 1fr;
    }
}
