/* Product list + detail: renders the five backend module templates. */

/* ---------- List page extras ---------- */
.product-list-intro {
    max-width: 760px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.7;
    color: #5c625b;
}

.cases-page .product-list-intro {
    margin-top: -8px;
    margin-bottom: 40px;
}

.product-services-list .product-list-intro {
    max-width: none;
    margin: -28px 0 44px;
}

.product-list-empty {
    padding: 72px 16px;
    font-size: 15px;
    line-height: 1.7;
    color: #70756c;
    text-align: center;
}

.cases-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cases-pagination .pagination > li > a,
.cases-pagination .pagination > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    background: #fff;
    border: 1px solid #e0e0dc;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.cases-pagination .pagination > li > a:hover {
    opacity: 0.72;
}

.cases-pagination .pagination > .active > span,
.cases-pagination .pagination > .active > a {
    color: #fff;
    background: #111;
    border-color: #111;
}

.cases-pagination .pagination > .disabled > span,
.cases-pagination .pagination > .disabled > a {
    opacity: 0.35;
    cursor: not-allowed;
}

.product-case-card {
    color: inherit;
    text-decoration: none;
}

.product-case-caption {
    padding: 16px 0 4px;
}

.product-case-caption h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #111;
}

.product-case-caption p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.65;
    color: #6a6f68;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Detail hero ---------- */
.product-detail .hot-case-detail__hero-media {
    background-color: #101418;
}

.product-detail .hot-case-detail__hero-media.has-image {
    background-color: #101418;
    background-repeat: no-repeat;
}

.product-detail .hot-case-detail__hero-media.has-image .hot-case-detail__hero-tag {
    color: rgba(255, 255, 255, 0.78);
}

.product-detail .hot-case-detail__hero-media.has-image .hot-case-detail__hero-title {
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.28);
}

.product-detail .hot-case-detail__hero-media.has-image .hot-case-detail__hero-meta {
    color: rgba(255, 255, 255, 0.72);
}

.product-detail--no-anchor .hot-case-detail__main {
    border-left: 0;
}

/* ---------- Module shared media ---------- */
.pm-module .hot-case-detail__section-body > * + * {
    margin-top: 24px;
}

.pm-module .hot-case-detail__section-body > .hot-case-detail__section-label + * {
    margin-top: 0;
}

.pm-media {
    display: block;
    margin: 0;
    overflow: hidden;
    background: #eef0eb;
}

.pm-media img {
    display: block;
    width: 100%;
    height: auto;
}

.pm-video {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    background: #000;
    object-fit: contain;
}

.pm-module-intro {
    margin-bottom: 8px;
}

.pm-module-link {
    margin-top: 8px;
}

/* ---------- Template 3: four images with captions ---------- */
.pm-gallery__media {
    aspect-ratio: 16 / 10;
    background: #eef0eb;
}

.pm-gallery__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pm-gallery__media:hover img {
    transform: scale(1.06);
}

/* ---------- Template 4: text only ---------- */
.pm-module--text .hot-case-detail__section-text {
    white-space: normal;
}

.pm-module--text .hot-case-detail__section-text + .hot-case-detail__section-text {
    margin-top: 20px;
}

/* ---------- Template 5: four cards ---------- */
.pm-cards .pm-card__media {
    background: #eef0eb;
}

.pm-cards .pm-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pm-cards .pm-card__media:hover img {
    transform: scale(1.06);
}

/* ---------- Related products ---------- */
.product-related {
    padding: 64px 40px;
    border-top: 1px solid #ecece8;
}

.product-related__title {
    margin: 0 0 32px;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #111;
}

.product-related .cases-card__overlay {
    padding: 24px;
    background: linear-gradient(180deg, rgba(8, 16, 8, 0) 12%, rgba(8, 16, 8, 0.9) 100%);
}

.product-related .cases-card__tags {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    max-width: calc(100% - 20px);
}

.product-related .cases-card__tags span {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    background: rgba(11, 19, 14, 0.77);
    color: #fff;
    line-height: 1.45;
}

.product-related .cases-card__tags small {
    flex: none;
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c9d2c5;
}

.product-related .cases-card__tags b {
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* ---------- Back link ---------- */
.product-detail__back {
    padding: 32px 40px 56px;
    border-top: 1px solid #ecece8;
}

.product-detail__back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #111;
    text-decoration: none;
    transition: opacity 0.2s;
}

.product-detail__back a:hover {
    opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
    .pm-gallery__media img,
    .pm-cards .pm-card__media img {
        transition: none;
    }

    .pm-gallery__media:hover img,
    .pm-cards .pm-card__media:hover img {
        transform: none;
    }
}

@media (max-width: 991px) {
    .product-related {
        padding: 48px 24px;
    }

    .product-detail__back {
        padding: 24px 24px 48px;
    }
}

@media (max-width: 767px) {
    .product-related {
        padding: 40px 20px;
    }

    .product-related .cases-grid {
        grid-template-columns: 1fr;
    }

    .product-detail__back {
        padding: 24px 20px 40px;
    }

    .product-services-list .product-list-intro {
        margin: -16px 0 32px;
    }
}
