/*==========================================================
    PRODUCT DETAIL TEMPLATE
    Scoped to .product-detail-pg — depends on common.css for
    .container, .sechead, .ptag, .btnlist, [class*="btn_"],
    .form-group and .form-control.
==========================================================*/

/* Section headings inherit .inpage .sechead (left) from common.css:1172 —
   only the spec card and popup opt into centring below. */
.product-detail-pg .pd_sechead_left {
    margin-bottom: 28px;
}

.product-detail-pg .pd_subhead {
    font-family: 'RobotoSlab';
    font-weight: 600;
    font-size: 22px;
    line-height: 30px;
    color: #212121;
    text-transform: capitalize;
    margin-bottom: 6px;
}

/*-----  HERO : GALLERY LEFT / CONTENT RIGHT  -----*/
.product-detail-pg .pd_hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 0 -20px 60px;
}

.product-detail-pg .pd_hero_gallery {
    width: 50%;
    padding: 0 20px;
}

.product-detail-pg .pd_hero_txt {
    width: 50%;
    padding: 0 20px;
}

/* No gallery images set — let the copy use the full width rather than
   stranding it in a half-width column beside empty space. */
.product-detail-pg .pd_hero--nogallery .pd_hero_txt {
    width: 100%;
}

.product-detail-pg .pd_hero_title {
    font-family: 'RobotoSlab';
    font-weight: 600;
    font-size: 32px;
    line-height: 40px;
    color: #000;
    margin-bottom: 18px;
}

.product-detail-pg .pd_hero_txt .ptag {
    margin-bottom: 28px;
}

.product-detail-pg .pd_hero_txt > .btn_green {
    text-transform: uppercase;
}

/* Enquiry form sitting under the Watch Video button */
/* Boxed so the enquiry form reads as a distinct panel rather than more page
   content running on below the product copy. */
.product-detail-pg .pd_hero_form {
    margin-top: 30px;
    padding: 26px 30px 30px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
}

.product-detail-pg .pd_form_title {
    font-family: 'RobotoSlab';
    font-weight: 600;
    font-size: 22px;
    line-height: 30px;
    color: #212121;
    text-transform: capitalize;
    position: relative;
    padding-bottom: 14px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

/* Short brand-green segment sitting on the hairline, tying the title to the
   submit button below it. */
.product-detail-pg .pd_form_title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 54px;
    height: 3px;
    background: #4ca42f;
}

.product-detail-pg .pd_hero_form .form-group {
    margin-bottom: 16px;
}

/* common.css sets appearance:none on every select, which strips the native
   arrow — without a replacement the Country field reads as a text input. */
.product-detail-pg .pd_hero_form select.form-control {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%233a3b4b' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
    padding-right: 40px;
    cursor: pointer;
}

.product-detail-pg .pd_hero_form .pd_form_btn button {
    width: 100%;
    min-width: 0;
    text-transform: uppercase;
}

/*-----  CONTACT FORM 7 INSIDE THE HERO FORM  -----*/
/* CF7 wraps every control in <span class="wpcf7-form-control-wrap">, which would
   otherwise sit inline and collapse the field width. */
.product-detail-pg .pd_hero_form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* Required marker — common.css only reddens this inside .get_form */
.product-detail-pg .pd_hero_form label span {
    color: #f95b5b;
}

.product-detail-pg .pd_hero_form label {
    display: block;
}

/* Carries the product name into the email; value set server-side by
   includes/product-form.php, so it is filled before any script runs. */
.product-detail-pg .pd_hero_form .pd_hide {
    display: none;
}

/* Theme submit pattern is .btnbox > input.submitbtn — make it fill the column */
.product-detail-pg .pd_hero_form .btnbox {
    width: 100%;
    min-width: 0;
    border-radius: 5px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fill the box so the whole 45px is clickable, not just the text */
.product-detail-pg .pd_hero_form .btnbox input[type="submit"] {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.product-detail-pg .pd_hero_form .submitbtn,
.product-detail-pg .pd_hero_form input[type="submit"] {
    font-size: 16px;
    font-weight: bold;
    line-height: 100%;
}

.product-detail-pg .pd_hero_form .wpcf7-not-valid-tip {
    font-size: 13px;
    color: #f95b5b;
    margin-top: 5px;
}

/* CF7 runs wpautop over the form, so the submit input lands inside a <p> that
   inherits the theme's paragraph margin and props the .btnbox open below the
   button. Zero it and let the paragraph fill the box instead. */
.product-detail-pg .pd_hero_form .pd_form_btn p {
    margin: 0;
    padding: 0;
    width: 100%;
    line-height: 0;
    position: relative;
}

/*-----  SUBMIT SPINNER  -----*/
/* CF7 6.x injects <span class="wpcf7-spinner"> after the submit input at runtime
   (see .has-spinner in its index.js) and toggles it with form.submitting. Left
   inline it sits after a width:100% input, so the 45px .btnbox pushes it out and
   clips it with overflow:hidden. Lift it out of flow and park it at the right
   edge — the label stays readable, which is the point of the feedback. */
.product-detail-pg .pd_hero_form .wpcf7-spinner {
    position: absolute;
    top: 50%;
    right: 16px;
    margin: -12px 0 0;
    /* CF7 ships a dark disc, which reads as a blob on the green button. */
    background-color: rgba(255, 255, 255, .25);
    opacity: 1;
    pointer-events: none;
}

.product-detail-pg .pd_hero_form .wpcf7-spinner::before {
    background-color: #fff;
}

/*-----  CF7 RESPONSE MESSAGE  -----*/
.product-detail-pg .pd_hero_form .wpcf7-response-output {
    margin: 0 0 20px;
    padding: 12px 16px;
    font-family: 'Roboto';
    font-size: 14px;
    line-height: 22px;
    border-width: 1px;
    border-style: solid;
    border-radius: 5px;
}

/* Sent successfully */
.product-detail-pg .pd_hero_form form.sent .wpcf7-response-output {
    border-color: #4ca42f;
    background: rgba(76, 164, 47, .08);
    color: #3b7d24;
}

/* Validation failure, send failure, spam — all read as a problem */
.product-detail-pg .pd_hero_form form.invalid .wpcf7-response-output,
.product-detail-pg .pd_hero_form form.unaccepted .wpcf7-response-output,
.product-detail-pg .pd_hero_form form.payment-required .wpcf7-response-output,
.product-detail-pg .pd_hero_form form.failed .wpcf7-response-output,
.product-detail-pg .pd_hero_form form.aborted .wpcf7-response-output,
.product-detail-pg .pd_hero_form form.spam .wpcf7-response-output {
    border-color: #f95b5b;
    background: rgba(249, 91, 91, .08);
    color: #c0392b;
}

/*-----  GALLERY  -----*/
/* Dragging to swipe otherwise text-selects the slides, and common.css:210
   paints ::selection green (#4ca42f) right over the images. */
.product-detail-pg .pd_gallery {
    margin-bottom: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* -webkit-user-drag is the only valid form; the standard way is the
   draggable="false" attribute on the <img> tags themselves. */
.product-detail-pg .pd_gallery img {
    -webkit-user-drag: none;
}

.product-detail-pg .pd_gallery ::-moz-selection {
    background: transparent;
}

.product-detail-pg .pd_gallery ::selection {
    background: transparent;
}

.product-detail-pg .pd_slider_for {
    margin-bottom: 14px;
    background: #f7f7f7;
    border-radius: 5px;
    overflow: hidden;
}

.product-detail-pg .pd_slider_for li {
    list-style: none;
}

.product-detail-pg .pd_slider_for li img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
}

.product-detail-pg .pd_slider_nav {
    margin: 0 -7px;
}

.product-detail-pg .pd_slider_nav li {
    list-style: none;
    padding: 0 7px;
    outline: 0;
    cursor: pointer;
}

.product-detail-pg .pd_slider_nav li img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    border-radius: 5px;
    border: 2px solid transparent;
    opacity: .6;
    transition: all .3s ease-in-out;
    -webkit-transition: all .3s ease-in-out;
}

.product-detail-pg .pd_slider_nav .slick-current img,
.product-detail-pg .pd_slider_nav li:hover img {
    border-color: #4ca42f;
    opacity: 1;
}

/* Graceful state before slick boots (and if the JS never loads) */
.product-detail-pg .pd_slider_for:not(.slick-initialized) li:not(:first-child),
.product-detail-pg .pd_slider_nav:not(.slick-initialized) li:nth-child(n+5) {
    display: none;
}

.product-detail-pg .pd_slider_nav:not(.slick-initialized) {
    display: flex;
    flex-wrap: wrap;
}

.product-detail-pg .pd_slider_nav:not(.slick-initialized) li {
    width: 25%;
}

/* Gallery arrows — scoped so slick-theme.css defaults elsewhere are untouched */
.product-detail-pg .pd_gallery .slick-prev,
.product-detail-pg .pd_gallery .slick-next {
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, .55);
    border-radius: 50%;
    z-index: 2;
}

.product-detail-pg .pd_gallery .slick-prev {
    left: 20px;
}

.product-detail-pg .pd_gallery .slick-next {
    right: 20px;
}

.product-detail-pg .pd_gallery .slick-prev:before,
.product-detail-pg .pd_gallery .slick-next:before {
    font-family: 'FontAwesome';
    font-size: 22px;
    color: #fff;
    opacity: 1;
}

.product-detail-pg .pd_gallery .slick-prev:before {
    content: "\f104";
}

.product-detail-pg .pd_gallery .slick-next:before {
    content: "\f105";
}

.product-detail-pg .pd_gallery .slick-prev:hover,
.product-detail-pg .pd_gallery .slick-next:hover {
    background: #4ca42f;
}

/*-----  LOWER SECTIONS WIDTH  -----*/
/* The three stacked sections below the hero run narrower than the container so
   the body copy does not stretch into an over-long measure.
   margin-left/right rather than the shorthand: each section sets its own
   margin-bottom below, and `margin: 0 auto` here would flatten it. */
.product-detail-pg .pd_content,
.product-detail-pg .pd_specs,
.product-detail-pg .pd_equipment {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

/*-----  MAIN CONTENT (one WYSIWYG field)  -----*/
/* Everything here targets plain h2/h3/p/ul so the editor never has to add a
   class. Paragraphs are covered by .ptag on the wrapper. */
.product-detail-pg .pd_content {
    margin-bottom: 60px;
}

.product-detail-pg .pd_content h2 {
    font-family: 'RobotoSlab';
    font-weight: 600;
    font-size: 36px;
    line-height: 42px;
    color: #000;
    text-transform: capitalize;
    margin-bottom: 28px;
}

.product-detail-pg .pd_content h3,
.product-detail-pg .pd_content h4 {
    font-family: 'RobotoSlab';
    font-weight: 600;
    font-size: 22px;
    line-height: 30px;
    color: #212121;
    text-transform: capitalize;
    margin-bottom: 6px;
}

/* Space between blocks, but never a gap above the very first heading */
.product-detail-pg .pd_content h2:not(:first-child),
.product-detail-pg .pd_content h3:not(:first-child),
.product-detail-pg .pd_content h4:not(:first-child) {
    margin-top: 34px;
}

/* Shared by the main content block and the equipment columns — both are
   WYSIWYG output, so neither can carry a .dlist class. */
.product-detail-pg .pd_content ul,
.product-detail-pg .pd_equipment_col ul {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.product-detail-pg .pd_content ul li,
.product-detail-pg .pd_equipment_col ul li {
    font-family: 'Roboto';
    font-size: 16px;
    line-height: 26px;
    color: #47494b;
    position: relative;
    padding-left: 24px;
    margin-bottom: 14px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.product-detail-pg .pd_content ul li:last-child,
.product-detail-pg .pd_equipment_col ul li:last-child {
    margin-bottom: 0;
}

.product-detail-pg .pd_content ul li:before,
.product-detail-pg .pd_equipment_col ul li:before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ca42f;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 10px;
}

/* A list of 7+ items flows into three columns — the "fits these machines"
   layout — without the editor adding anything. Browsers without :has()
   simply render one column, which is still correct. */
.product-detail-pg .pd_content ul:has(li:nth-child(7)) {
    column-count: 3;
    column-gap: 30px;
}

/*-----  TECHNICAL SPECIFICATIONS  -----*/
.product-detail-pg .pd_specs {
    margin-bottom: 60px;
}

/* Centred heading with a short accent rule beneath it */
.product-detail-pg .pd_spec_head {
    text-align: center;
    margin-bottom: 22px;
}

.product-detail-pg .pd_spec_head:after {
    content: "";
    display: block;
    width: 84px;
    height: 3px;
    background: #4ca42f;
    margin: 22px auto 0;
}

.product-detail-pg .pd_spec_wrap {
    background: #fff;
    border-radius: 5px;
    padding: 30px 40px;
    box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, .08);
}

.product-detail-pg .pd_spec_table {
    width: 100%;
    border-collapse: collapse;
}

.product-detail-pg .pd_spec_table tbody th,
.product-detail-pg .pd_spec_table tbody td {
    font-family: 'Roboto';
    font-size: 16px;
    line-height: 26px;
    padding: 15px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #ebebeb;
}

.product-detail-pg .pd_spec_table tbody th {
    font-weight: bold;
    color: #212121;
    width: 34%;
    padding-right: 24px;
}

.product-detail-pg .pd_spec_table tbody td {
    font-weight: normal;
    color: #666666;
    width: 66%;
}

.product-detail-pg .pd_spec_table tbody tr:last-child th,
.product-detail-pg .pd_spec_table tbody tr:last-child td {
    border-bottom: 0;
}

/*-----  EQUIPMENT OVERVIEW  -----*/
.product-detail-pg .pd_equipment {
    background: #f7f7f7;
    border-radius: 5px;
    padding: 45px 40px;
    margin-bottom: 60px;
}

.product-detail-pg .pd_equipment_wrap {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -20px;
}

/* flex:1 rather than a fixed 50% so two columns give half each and three
   give a third each, without the repeater needing a fixed row count. */
.product-detail-pg .pd_equipment_col {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 20px;
}

/*-----  FORMS  -----*/
.product-detail-pg .pd_form_row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -11px;
}

.product-detail-pg .pd_form_row .form-group {
    width: 50%;
    padding: 0 11px;
}

.product-detail-pg .pd_form_row .form-group.full {
    width: 100%;
}

.product-detail-pg .pd_form_btn {
    margin-top: 12px;
}

.product-detail-pg .pd_form_btn button {
    min-width: 220px;
}

/*-----  MODAL  -----*/
.pd_modal[hidden] {
    display: none;
}

.pd_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.pd_modal_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .65);
    cursor: pointer;
}

.pd_modal_box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    max-height: 100%;
    overflow-y: auto;
    background: #fff;
    border-radius: 5px;
    padding: 45px 40px 40px;
    box-shadow: 0px 10px 40px 0px rgba(0, 0, 0, .3);
}

.pd_modal_close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    line-height: 1;
    font-size: 30px;
    color: #666666;
    background: transparent;
    border: 0;
    border-radius: 50%;
    padding: 0;
    transition: all .3s ease-in-out;
    -webkit-transition: all .3s ease-in-out;
}

.pd_modal_close:hover {
    background: #4ca42f;
    color: #fff;
}

/*-----  VIDEO POPUP  -----*/
/* Wider than the form popup was, and sized to the video rather than to text. */
.pd_modal--video .pd_modal_box {
    max-width: 960px;
    padding: 20px;
    background: #000;
}

/* Inside the box, top-right over the video. Solid disc so it stays legible
   whatever frame is showing behind it. */
.pd_modal--video .pd_modal_close {
    top: 10px;
    right: 10px;
    z-index: 3;
    color: #fff;
    background: rgba(0, 0, 0, .7);
    font-size: 26px;
    line-height: 34px;
    text-align: center;
}

.pd_modal--video .pd_modal_close:hover,
.pd_modal--video .pd_modal_close:focus {
    background: #4ca42f;
    color: #fff;
}

/* 16:9 box so the popup does not jump height while the file loads */
.pd_video_wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
}

.pd_video_wrap .pd_video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

/* Play icon on the trigger button */
.product-detail-pg .pd_video_open i {
    font-size: 18px;
}

/* Locks background scroll while the popup is open */
body.pd_modal_open {
    overflow: hidden;
}

/*==========  RESPONSIVE  ==========*/
@media only screen and (max-width: 1199px) {

    .product-detail-pg .pd_slider_for li img {
        height: 440px;
    }

    .product-detail-pg .pd_slider_nav li img {
        height: 112px;
    }

    .product-detail-pg .pd_hero_title {
        font-size: 28px;
        line-height: 36px;
    }
}

@media only screen and (max-width: 991px) {

    /* Gallery and copy stack — gallery stays first */
    .product-detail-pg .pd_hero_gallery,
    .product-detail-pg .pd_hero_txt {
        width: 100%;
    }

    .product-detail-pg .pd_hero_txt {
        margin-top: 30px;
    }

    .product-detail-pg .pd_slider_for li img {
        height: 460px;
    }

    .product-detail-pg .pd_equipment {
        padding: 40px 30px;
    }

    .pd_modal--video .pd_modal_box {
        max-width: 100%;
    }

    .product-detail-pg .pd_hero,
    .product-detail-pg .pd_content,
    .product-detail-pg .pd_specs,
    .product-detail-pg .pd_equipment {
        margin-bottom: 45px;
    }

    /* 75% of an already-narrow container leaves too little room to read in;
       the hero goes full width at this breakpoint too. */
    .product-detail-pg .pd_content,
    .product-detail-pg .pd_specs,
    .product-detail-pg .pd_equipment {
        width: 100%;
    }

    /* Three columns is too tight once the container narrows */
    .product-detail-pg .pd_content ul:has(li:nth-child(7)) {
        column-count: 2;
    }
}

@media only screen and (max-width: 767px) {

    .product-detail-pg .pd_slider_for li img {
        height: 340px;
    }

    .product-detail-pg .pd_slider_nav li img {
        height: 100px;
    }

    .product-detail-pg .pd_gallery .slick-prev {
        left: 10px;
    }

    .product-detail-pg .pd_gallery .slick-next {
        right: 10px;
    }

    .product-detail-pg .pd_gallery .slick-prev,
    .product-detail-pg .pd_gallery .slick-next {
        width: 36px;
        height: 36px;
    }

    .product-detail-pg .pd_sechead_left {
        margin-bottom: 22px;
    }

    .product-detail-pg .pd_equipment_col {
        flex: 1 1 100%;
    }

    .product-detail-pg .pd_equipment_col + .pd_equipment_col {
        margin-top: 34px;
    }

    /* Stacked label / value pairs */
    .product-detail-pg .pd_spec_wrap {
        padding: 22px 20px;
    }

    .product-detail-pg .pd_spec_table tbody,
    .product-detail-pg .pd_spec_table tbody tr,
    .product-detail-pg .pd_spec_table tbody th,
    .product-detail-pg .pd_spec_table tbody td {
        display: block;
        width: 100%;
    }

    .product-detail-pg .pd_spec_table tbody th {
        padding: 0 0 2px;
        border-bottom: 0;
    }

    .product-detail-pg .pd_spec_table tbody td {
        padding: 0 0 14px;
    }

    .product-detail-pg .pd_spec_table tbody tr:last-child td {
        padding-bottom: 0;
    }

    .product-detail-pg .pd_form_row .form-group {
        width: 100%;
    }

    .product-detail-pg .pd_form_btn button {
        width: 100%;
    }
}

@media only screen and (max-width: 575px) {

    .product-detail-pg .pd_slider_for li img {
        height: 260px;
    }

    /* 30px each side takes too much off a narrow screen once the form is
       full width. */
    .product-detail-pg .pd_hero_form {
        padding: 22px 18px 24px;
    }

    .product-detail-pg .pd_subhead {
        font-size: 20px;
        line-height: 28px;
    }

    .product-detail-pg .pd_hero_title {
        font-size: 24px;
        line-height: 32px;
    }

    .product-detail-pg .pd_equipment {
        padding: 30px 18px;
    }

    .pd_modal {
        padding: 15px 12px;
    }

    .pd_modal--video .pd_modal_box {
        padding: 12px;
    }

    .pd_modal--video .pd_modal_close {
        top: 6px;
        right: 6px;
        width: 32px;
        height: 32px;
        font-size: 22px;
        line-height: 30px;
    }
}
