/* ==========================================================================
   Products — category cards, product rows, product detail
   Builds on site.css + pages.css
   ========================================================================== */

.pg-section--tight {
    padding: 100px 0 140px;
}

.pg-section--tight + .pg-section--tight {
    padding-top: 0;
}

.pg-prose--narrow {
    max-width: 860px;
}

/* ---------- Category cards ---------- */
.pg-cats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

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

.pg-cat {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 3;
    padding: 28px;
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    background: var(--hm-navy);
}

.pg-cats--2 .pg-cat {
    aspect-ratio: 16 / 10;
}

.pg-cat:hover {
    color: #fff;
}

.pg-cat__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--hm-ease);
}

.pg-cat::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(0, 11, 46, .88) 0%, rgba(0, 11, 46, .15) 60%, rgba(0, 11, 46, .4) 100%);
}

/* No photo: typographic card on the brand gradient */
.pg-cat--plain {
    background:
        radial-gradient(520px 380px at 100% 0%, rgba(65, 41, 168, .6), transparent 70%),
        var(--hm-navy);
}

.pg-cat--plain::after {
    display: none;
}

.pg-cat__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.pg-cat__name {
    font-family: var(--hm-sans);
    font-size: clamp(24px, 2.2vw, 34px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -.035em;
}

.pg-cat__arrow {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    font-size: 18px;
    transition: background .3s var(--hm-ease), color .3s var(--hm-ease), transform .3s var(--hm-ease);
}

.pg-cat:hover .pg-cat__img {
    transform: scale(1.05);
}

.pg-cat:hover .pg-cat__arrow {
    background: #fff;
    color: var(--hm-navy);
    transform: translateX(4px);
}

/* ---------- Product rows ---------- */
.pg-list-head {
    margin-bottom: 20px;
}

.pg-products {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--hm-line);
}

.pg-product {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) 40px;
    align-items: baseline;
    gap: 24px;
    padding: 28px 0;
    border-top: 1px solid var(--hm-line);
    position: relative;
    isolation: isolate;
    color: var(--hm-ink);
    text-decoration: none;
}

/* Hover: background on its own layer and the content slides with transform.
   Widths never change, so long descriptions never re-wrap on hover. */
.pg-product::before {
    content: "";
    position: absolute;
    inset: 1px 0 0;
    z-index: -1;
    background: var(--hm-soft);
    opacity: 0;
    transition: opacity .3s var(--hm-ease);
}

.pg-products li:first-child .pg-product {
    border-top-color: var(--hm-ink);
}

.pg-product__name {
    font-family: var(--hm-sans);
    font-size: clamp(20px, 1.8vw, 26px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.03em;
    transition: color .3s var(--hm-ease), transform .35s var(--hm-ease);
}

.pg-product__desc {
    padding-right: 16px; /* room for the hover slide, reserved at rest too */
    font-size: 16px;
    line-height: 1.65;
    color: var(--hm-muted);
    transition: transform .35s var(--hm-ease);
}

.pg-product__arrow {
    justify-self: end;
    font-size: 18px;
    transition: transform .35s var(--hm-ease), color .3s var(--hm-ease);
}

.pg-product:hover {
    color: var(--hm-ink);
}

.pg-product:hover::before {
    opacity: 1;
}

.pg-product:hover .pg-product__name,
.pg-product:hover .pg-product__arrow {
    color: var(--hm-accent);
}

.pg-product:hover .pg-product__name,
.pg-product:hover .pg-product__desc {
    transform: translateX(16px);
}

.pg-product:hover .pg-product__arrow {
    transform: translateX(-12px);
}

/* ---------- Product detail ---------- */
.pg-detail {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 80px;
    align-items: start;
}

.pg-detail__aside {
    position: sticky;
    top: 130px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.pg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 26px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--hm-navy);
    border-radius: 40px;
    background: var(--hm-navy);
    color: #fff;
    font-family: var(--hm-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: gap .3s var(--hm-ease), color .3s;
}

/* Gradient on its own layer (gradients can't be transitioned) — see .hm-form__submit */
.pg-btn::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: linear-gradient(90deg, #e40c1c, #4129a8);
    opacity: 0;
    transition: opacity .3s;
}

.pg-btn:hover::before {
    opacity: 1;
}

.pg-btn::after {
    content: "\2192";
}

.pg-btn:hover {
    gap: 18px;
    color: #fff;
}

.pg-btn--ghost {
    background: transparent;
    color: var(--hm-navy);
}

.pg-detail__main .pg-subhead {
    margin-bottom: 24px;
}

.pg-specs {
    margin: 0;
    border-bottom: 1px solid var(--hm-line);
}

.pg-specs__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    padding: 22px 0;
    border-top: 1px solid var(--hm-line);
}

.pg-specs__row:first-child {
    border-top-color: var(--hm-ink);
}

.pg-specs dt {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--hm-muted);
}

.pg-specs dd {
    margin: 0;
    font-family: var(--hm-sans);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: var(--hm-ink);
}

.pg-detail__desc {
    margin-top: 60px;
}

/* ---------- Document request modal ---------- */
.pg-modal .modal-content {
    padding: 12px;
    border: 0;
    border-radius: 18px;
}

.pg-modal .modal-header {
    border-bottom: 0;
}

.pg-modal .modal-title {
    font-family: var(--hm-sans);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -.03em;
    color: var(--hm-ink);
}

.pg-modal__form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pg-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--hm-muted);
}

.pg-modal__field input,
.pg-modal__field input:hover,
.pg-modal__field input:focus {
    width: 100%;
    padding: 8px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--hm-line);
    border-radius: 0;
    background: transparent;
    color: var(--hm-ink);
    font-size: 17px;
}

.pg-modal__field input:focus {
    outline: none;
    border-bottom-color: var(--hm-accent);
}

.pg-modal__form .pg-btn {
    align-self: flex-start;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .pg-section--tight {
        padding: 70px 0 90px;
    }

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

    .pg-product {
        grid-template-columns: minmax(0, 1fr) 24px;
        row-gap: 8px;
    }

    .pg-product__desc {
        grid-column: 1;
        grid-row: 2;
    }

    .pg-product__arrow {
        grid-column: 2;
        grid-row: 1;
    }

    .pg-detail {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .pg-detail__aside {
        position: static;
    }
}

@media (max-width: 575px) {
    .pg-section--tight {
        padding: 50px 0 70px;
    }

    .pg-cats,
    .pg-cats--2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pg-cat,
    .pg-cats--2 .pg-cat {
        aspect-ratio: 16 / 11;
        padding: 22px;
    }

    .pg-product {
        grid-template-columns: minmax(0, 1fr) 20px;
        gap: 6px 12px;
        padding: 22px 0;
    }

    .pg-product::before {
        display: none;
    }

    .pg-product:hover .pg-product__name,
    .pg-product:hover .pg-product__desc,
    .pg-product:hover .pg-product__arrow {
        transform: none;
    }

    .pg-specs__row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 18px 0;
    }
}
