/*
 * EKR full PDP presentation layer for Hyva.
 *
 * Scope everything to catalog-product-view so this does not change category,
 * cart, CMS, or Vehicle Landing pages. This stylesheet intentionally uses plain
 * CSS during migration; it can be folded into the child-theme Tailwind sources
 * after the full Hyva migration is accepted.
 */

body.catalog-product-view {
    --ekr-pdp-ink: #101828;
    --ekr-pdp-muted: #667085;
    --ekr-pdp-line: #d8dde5;
    --ekr-pdp-line-soft: #eaecf0;
    --ekr-pdp-surface: #ffffff;
    --ekr-pdp-soft: #f8fafc;
    --ekr-pdp-accent: #e82020;
    --ekr-pdp-radius: 12px;
}

body.catalog-product-view main#maincontent {
    padding-bottom: 72px;
}

/* ---------- Product details: Description / More Information ---------- */
body.catalog-product-view .ekr-pdp-details {
    width: 100%;
    margin-top: 56px;
}

body.catalog-product-view .ekr-pdp-details__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
    gap: 30px;
    align-items: start;
}

body.catalog-product-view .ekr-pdp-details__section--wide {
    margin-top: 54px;
}

body.catalog-product-view .ekr-pdp-section-title,
body.catalog-product-view .block.review-list > .block-title,
body.catalog-product-view .block.review-list > .block-title strong,
body.catalog-product-view .block.relatedposts > .block-title,
body.catalog-product-view .block.related-posts > .block-title,
body.catalog-product-view .blog-related-posts > .block-title,
body.catalog-product-view .mfblog-related-posts > .block-title {
    margin: 0 0 18px;
    color: var(--ekr-pdp-ink);
    font-size: clamp(24px, 2.1vw, 32px);
    line-height: 1.18;
    font-weight: 750;
    letter-spacing: -.02em;
}

body.catalog-product-view .ekr-pdp-details__card,
body.catalog-product-view .product.attribute.description,
body.catalog-product-view .additional-attributes-wrapper {
    min-width: 0;
    padding: 26px 28px;
    border: 1px solid var(--ekr-pdp-line);
    border-radius: var(--ekr-pdp-radius);
    background: var(--ekr-pdp-surface);
    color: var(--ekr-pdp-ink);
}

body.catalog-product-view .ekr-pdp-details__card > :first-child,
body.catalog-product-view .product.attribute.description > :first-child {
    margin-top: 0;
}

body.catalog-product-view .ekr-pdp-details__card > :last-child,
body.catalog-product-view .product.attribute.description > :last-child {
    margin-bottom: 0;
}

body.catalog-product-view .product.attribute.description,
body.catalog-product-view .product.attribute.description .value,
body.catalog-product-view .ekr-pdp-details__card .product.attribute.description {
    font-size: 15px;
    line-height: 1.65;
}

/* Avoid a double card when Magento's attribute template is rendered inside our card. */
body.catalog-product-view .ekr-pdp-details__card .product.attribute.description,
body.catalog-product-view .ekr-pdp-details__card .additional-attributes-wrapper {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.catalog-product-view .product.attribute.description p {
    margin: 0 0 14px;
}

body.catalog-product-view .product.attribute.description h1,
body.catalog-product-view .product.attribute.description h2,
body.catalog-product-view .product.attribute.description h3,
body.catalog-product-view .product.attribute.description h4 {
    margin: 22px 0 8px;
    color: var(--ekr-pdp-ink);
    line-height: 1.3;
    font-weight: 750;
}

body.catalog-product-view .product.attribute.description ul,
body.catalog-product-view .product.attribute.description ol {
    margin: 12px 0 18px;
    padding-left: 1.45rem;
}

body.catalog-product-view .product.attribute.description li {
    margin: 5px 0;
    padding-left: 2px;
}

body.catalog-product-view .product.attribute.description li::marker {
    color: var(--ekr-pdp-accent);
}

body.catalog-product-view .additional-attributes {
    width: 100%;
    border-collapse: collapse;
}

body.catalog-product-view .additional-attributes tr:last-child th,
body.catalog-product-view .additional-attributes tr:last-child td {
    border-bottom: 0;
}

body.catalog-product-view .additional-attributes th,
body.catalog-product-view .additional-attributes td {
    padding: 13px 0;
    border-bottom: 1px solid var(--ekr-pdp-line-soft);
    vertical-align: top;
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
}

body.catalog-product-view .additional-attributes th {
    width: 45%;
    padding-right: 22px;
    color: var(--ekr-pdp-muted);
    font-weight: 550;
}

body.catalog-product-view .additional-attributes td {
    color: var(--ekr-pdp-ink);
    font-weight: 600;
}

/* ---------- Magefan / third-party Related Posts on product pages ---------- */
body.catalog-product-view .block.relatedposts,
body.catalog-product-view .block.related-posts,
body.catalog-product-view .blog-related-posts,
body.catalog-product-view .mfblog-related-posts,
body.catalog-product-view .post-related-posts {
    width: 100%;
    max-width: none;
    margin: 54px 0 0;
}

body.catalog-product-view .block.relatedposts .block-content,
body.catalog-product-view .block.related-posts .block-content,
body.catalog-product-view .blog-related-posts .block-content,
body.catalog-product-view .mfblog-related-posts .block-content,
body.catalog-product-view .post-related-posts .block-content {
    width: 100%;
    padding: 22px;
    border: 1px solid var(--ekr-pdp-line);
    border-radius: var(--ekr-pdp-radius);
    background: var(--ekr-pdp-surface);
}

body.catalog-product-view .block.relatedposts ul,
body.catalog-product-view .block.related-posts ul,
body.catalog-product-view .blog-related-posts ul,
body.catalog-product-view .mfblog-related-posts ul,
body.catalog-product-view .post-related-posts ul,
body.catalog-product-view .block.relatedposts .post-list,
body.catalog-product-view .block.related-posts .post-list,
body.catalog-product-view .blog-related-posts .post-list,
body.catalog-product-view .mfblog-related-posts .post-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
}

body.catalog-product-view .block.relatedposts li,
body.catalog-product-view .block.related-posts li,
body.catalog-product-view .blog-related-posts li,
body.catalog-product-view .mfblog-related-posts li,
body.catalog-product-view .post-related-posts li,
body.catalog-product-view .block.relatedposts .post-list-item,
body.catalog-product-view .block.related-posts .post-list-item,
body.catalog-product-view .blog-related-posts .post-list-item,
body.catalog-product-view .mfblog-related-posts .post-list-item {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body.catalog-product-view .block.relatedposts li > a,
body.catalog-product-view .block.related-posts li > a,
body.catalog-product-view .blog-related-posts li > a,
body.catalog-product-view .mfblog-related-posts li > a,
body.catalog-product-view .post-related-posts li > a,
body.catalog-product-view .block.relatedposts .post-list-item > a,
body.catalog-product-view .block.related-posts .post-list-item > a,
body.catalog-product-view .blog-related-posts .post-list-item > a,
body.catalog-product-view .mfblog-related-posts .post-list-item > a {
    min-height: 62px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    border: 1px solid var(--ekr-pdp-line-soft);
    border-radius: 9px;
    background: var(--ekr-pdp-soft);
    color: var(--ekr-pdp-ink);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 650;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

body.catalog-product-view .block.relatedposts li > a:hover,
body.catalog-product-view .block.related-posts li > a:hover,
body.catalog-product-view .blog-related-posts li > a:hover,
body.catalog-product-view .mfblog-related-posts li > a:hover,
body.catalog-product-view .post-related-posts li > a:hover {
    border-color: #b8c0cc;
    background: #fff;
    transform: translateY(-1px);
}

/* ---------- Magento reviews ---------- */
body.catalog-product-view .block.review-list,
body.catalog-product-view #customer-reviews {
    width: 100%;
    max-width: none;
    margin-top: 54px;
}

body.catalog-product-view .review-items,
body.catalog-product-view ol.review-items,
body.catalog-product-view ul.review-items {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
    list-style: none;
}

body.catalog-product-view .review-item {
    margin: 0;
    padding: 22px 24px;
    border: 1px solid var(--ekr-pdp-line);
    border-radius: var(--ekr-pdp-radius);
    background: var(--ekr-pdp-surface);
}

body.catalog-product-view .review-ratings {
    margin: 0 0 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

body.catalog-product-view .review-rating,
body.catalog-product-view .rating-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body.catalog-product-view .review-rating .label,
body.catalog-product-view .rating-summary .label {
    color: var(--ekr-pdp-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

body.catalog-product-view .rating-result,
body.catalog-product-view .rating-result > span {
    line-height: 1;
}

body.catalog-product-view .review-title {
    margin: 0 0 8px;
    color: var(--ekr-pdp-ink);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 750;
}

body.catalog-product-view .review-content {
    margin: 0 0 12px;
    color: #344054;
    font-size: 14px;
    line-height: 1.65;
}

body.catalog-product-view .review-details {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    color: var(--ekr-pdp-muted);
    font-size: 12px;
    line-height: 1.45;
}

body.catalog-product-view .review-details strong {
    color: #344054;
}

body.catalog-product-view .toolbar.review-toolbar,
body.catalog-product-view .review-toolbar {
    margin: 18px 0 0;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    background: transparent;
}

body.catalog-product-view .review-toolbar select {
    min-height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--ekr-pdp-line);
    border-radius: 8px;
    background: #fff;
}

body.catalog-product-view .block.review-add,
body.catalog-product-view .review-add {
    width: 100%;
    margin-top: 30px;
    padding: 24px;
    border: 1px solid var(--ekr-pdp-line);
    border-radius: var(--ekr-pdp-radius);
    background: var(--ekr-pdp-surface);
}

body.catalog-product-view .block.review-add .block-title,
body.catalog-product-view .review-add .block-title,
body.catalog-product-view .review-add h2,
body.catalog-product-view .review-add h3 {
    margin: 0 0 10px;
    color: var(--ekr-pdp-ink);
    font-size: 20px;
    line-height: 1.3;
    font-weight: 750;
}

body.catalog-product-view .block.review-add a,
body.catalog-product-view .review-add a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Common lower-PDP spacing ---------- */
body.catalog-product-view .product.info.detailed + .block,
body.catalog-product-view .ekr-pdp-details + .block {
    margin-top: 54px;
}

@media (max-width: 1023px) {
    body.catalog-product-view .ekr-pdp-details {
        margin-top: 42px;
    }

    body.catalog-product-view .ekr-pdp-details__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    body.catalog-product-view .block.relatedposts ul,
    body.catalog-product-view .block.related-posts ul,
    body.catalog-product-view .blog-related-posts ul,
    body.catalog-product-view .mfblog-related-posts ul,
    body.catalog-product-view .post-related-posts ul,
    body.catalog-product-view .block.relatedposts .post-list,
    body.catalog-product-view .block.related-posts .post-list,
    body.catalog-product-view .blog-related-posts .post-list,
    body.catalog-product-view .mfblog-related-posts .post-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    body.catalog-product-view main#maincontent {
        padding-bottom: 48px;
    }

    body.catalog-product-view .ekr-pdp-details,
    body.catalog-product-view .block.review-list,
    body.catalog-product-view #customer-reviews,
    body.catalog-product-view .block.relatedposts,
    body.catalog-product-view .block.related-posts,
    body.catalog-product-view .blog-related-posts,
    body.catalog-product-view .mfblog-related-posts,
    body.catalog-product-view .post-related-posts {
        margin-top: 38px;
    }

    body.catalog-product-view .ekr-pdp-details__card,
    body.catalog-product-view .product.attribute.description,
    body.catalog-product-view .additional-attributes-wrapper,
    body.catalog-product-view .review-item,
    body.catalog-product-view .block.review-add,
    body.catalog-product-view .review-add {
        padding: 18px;
    }

    body.catalog-product-view .ekr-pdp-section-title,
    body.catalog-product-view .block.review-list > .block-title,
    body.catalog-product-view .block.review-list > .block-title strong {
        margin-bottom: 14px;
        font-size: 23px;
    }

    body.catalog-product-view .additional-attributes th,
    body.catalog-product-view .additional-attributes td {
        display: block;
        width: 100%;
        padding: 9px 0;
    }

    body.catalog-product-view .additional-attributes th {
        padding-bottom: 2px;
        border-bottom: 0;
        color: var(--ekr-pdp-muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    body.catalog-product-view .additional-attributes td {
        padding-top: 2px;
        padding-bottom: 12px;
    }

    body.catalog-product-view .review-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
