/**
 * Single-product top-area styling — ported from the live PlumbingKing site
 * (Divi Theme Builder page CSS + the `wcfs_contact` / `free_uk_delivery`
 * snippets) so the new theme's product summary matches it pixel-for-pixel.
 *
 * Selectors are adapted from the Divi-specific ones (#plumb-single-product-
 * description, et_pb_*) to the standard WooCommerce single-product markup the
 * theme renders. Brand colours: navy #1A4371, teal #1399A8.
 */

/* ------------------------------------------------------------------ *
 * Contact block (phone + email cards + "Free UK Delivery" line),
 * rendered below the product gallery. Verbatim from the wcfs_contact snippet.
 * ------------------------------------------------------------------ */
.wcfs-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    box-sizing: border-box;
    margin-top: 20px;
}
.wcfs-contact-items {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.wcfs-contact-items a {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    width: 100%;
    min-height: 100px;
    box-sizing: border-box;
    padding: 0 20px 0 20px;
    text-decoration: none;
}
.wcfs-contact-item-text {
    display: flex;
    flex-direction: column;
}
.wcfs-contact-item-text span:first-child {
    font-size: 0.875rem;
    font-weight: 400;
    color: #666666;
}
.wcfs-contact-item-text span:last-child {
    font-size: 0.9375rem;
    font-weight: 700;
    color: black;
}
.wcfs-contact-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: black !important;
}
@media only screen and (min-width: 1024px) {
    .wcfs-contact-items {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ------------------------------------------------------------------ *
 * "Free UK Delivery" banner, rendered inside the summary (right column).
 * From the free_uk_delivery snippet (the stray global body{} rule dropped).
 * ------------------------------------------------------------------ */
.uk-delivery-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: relative;
    border: 3px solid #4EB748;
    border-radius: 20px;
    min-height: 100px;
    padding: 10px 20px;
    box-sizing: border-box;
    margin: 20px 0;
}
.uk-delivery-banner .delivery-content {
    display: flex;
    align-items: center;
    gap: 15px;
}
.uk-delivery-banner .delivery-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #d0ebee;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1399A8;
    flex-shrink: 0;
}
.uk-delivery-banner .delivery-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.uk-delivery-banner .delivery-text h4 {
    margin: 0 !important;
    padding: 0 0 4px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1A4371;
}
.uk-delivery-banner .delivery-text p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 300;
    color: #1A4371;
}
.uk-delivery-banner .delivery-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A4371;
    background: #d8ecff;
    border-radius: 60px;
    padding: 10px 20px;
    font-weight: 600;
}
.uk-delivery-banner .star-icon {
    position: absolute;
    top: -15px;
    right: -10px;
}

/* ------------------------------------------------------------------ *
 * Breadcrumb (rendered full-width above the product in woocommerce.php).
 * ------------------------------------------------------------------ */
.woocommerce .woocommerce-breadcrumb {
    margin: 0 0 24px;
    font-size: 0.9375rem;
    color: #6b7280;
}
.woocommerce .woocommerce-breadcrumb a {
    color: #1A4371;
    text-decoration: none;
    transition: color 0.15s ease;
}
.woocommerce .woocommerce-breadcrumb a:hover {
    color: #1399A8;
}

/* ================================================================== *
 * Top-area layout — two independent columns.
 *
 * WooCommerce's default layout floats the gallery left (48%) and the summary
 * right (48%). The contact block lives in the LEFT column directly under the
 * gallery, so we float it left and clear:left to drop it below the gallery —
 * its position is independent of the (taller) summary height, and it sidesteps
 * the flexslider, which would otherwise swallow it as a hidden slide if it were
 * rendered inside the gallery wrapper.
 * ================================================================== */

/* Critical two-column layout, inlined from WooCommerce core. This sheet is
 * render-blocking on the product page while woocommerce.css (woocommerce-general)
 * is deferred for performance, so the gallery-left / summary-right floats must
 * live here or the above-the-fold layout collapses to a single column on first
 * paint. Breakpoint matches woocommerce-smallscreen.css (single column ≤768px). */
@media (min-width: 769px) {
    .woocommerce div.product div.images {
        float: left;
        width: 48%;
    }
    .woocommerce div.product div.summary {
        float: right;
        width: 48%;
        clear: none;
    }
    .woocommerce div.product::after {
        content: "";
        display: table;
        clear: both;
    }
}
.woocommerce div.product div.images img {
    display: block;
    width: 100%;
    height: auto;
}

@media (min-width: 1024px) {
    .single-product div.product .wcfs-contact {
        float: left;
        clear: left;
        width: 48%;
        margin: 24px 0 0;
        box-sizing: border-box;
    }
    /* Everything below the two columns clears the floats and runs full-width. */
    .single-product div.product .woocommerce-tabs,
    .single-product div.product .up-sells,
    .single-product div.product .related,
    .single-product div.product .pk-single-product-content {
        clear: both;
        float: none;
        width: 100%;
    }
}

/* ------------------------------------------------------------------ *
 * Title / price / description typography (brand colours).
 * ------------------------------------------------------------------ */
.single-product div.product .product_title {
    color: #1A4371 !important;
    font-weight: 700 !important;
    font-size: clamp(2rem, 1.2rem + 2.4vw, 2.875rem);
    line-height: 1.1;
    margin: 0 0 0.35em;
}

/* Short description (summary column): airy reading rhythm so the bullet
 * list isn't cramped — matches the live product page. */
.single-product div.product .woocommerce-product-details__short-description {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.7;
}
.single-product div.product .woocommerce-product-details__short-description p {
    margin: 0 0 1em;
}
.single-product div.product .woocommerce-product-details__short-description ul {
    margin: 0 0 1.25em;
}
.single-product div.product .woocommerce-product-details__short-description li {
    margin-bottom: 0.55em;
    line-height: 1.5;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #1399A8 !important;
    font-weight: 700;
}

/* Description lists: replace the disc bullets with the teal circled check. */
.single-product div.product .woocommerce-product-details__short-description ul,
.single-product div.product .wcfs-product-description ul,
.single-product div.product .pk-single-product-content ul,
.woocommerce-Tabs-panel--description ul {
    list-style: none !important;
    padding-left: 0 !important;
}
.single-product div.product .woocommerce-product-details__short-description ul li:before,
.single-product div.product .wcfs-product-description ul li:before,
.single-product div.product .pk-single-product-content ul li:before,
.woocommerce-Tabs-panel--description ul li:before {
    content: "";
    display: inline-block;
    margin-right: 3px;
    position: relative;
    top: 9px;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%231399A8' stroke-linecap='round' stroke-width='1.5'%3E%3Cpath stroke-linejoin='round' d='m8.5 12.5l2 2l5-5'/%3E%3Cpath d='M7 3.338A9.95 9.95 0 0 1 12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12c0-1.821.487-3.53 1.338-5'/%3E%3C/g%3E%3C/svg%3E");
}
.single-product div.product .woocommerce-product-details__short-description strong,
.single-product div.product .woocommerce-product-details__short-description b {
    color: #1A4371 !important;
}

/* ------------------------------------------------------------------ *
 * Variations + quantity + add-to-cart button.
 * ------------------------------------------------------------------ */
.single-product .variations {
    width: 100%;
    margin-bottom: 20px;
}
.single-product .variations th.label {
    display: block;
    text-align: left;
    padding: 0 !important;
    font-weight: 500;
    color: #1e3d73;
    font-size: 15px;
}
.single-product .variations th.label label {
    margin: 0;
}
.single-product .variations td.value {
    display: block;
    width: 100%;
}
.single-product .variations td.value span:after {
    content: none !important;
}
.single-product .variations select {
    width: 100%;
    padding: 15px 20px !important;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f2f4f7;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}
.single-product .variations td.value span {
    position: relative;
    display: block;
}
.single-product .reset_variations {
    display: inline-block;
    margin-top: 10px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
}
.woocommerce div.product form.cart div.woocommerce-variation-add-to-cart:before {
    content: "Quantity";
    color: #1A4371 !important;
    font-weight: 700 !important;
    width: 100%;
    display: block;
}
.woocommerce div.product form.cart div.quantity,
.woocommerce .quantity input.qty {
    max-width: 100% !important;
    width: 116px !important;
    height: 53px;
    border-radius: 5px;
}
.woocommerce div.product form.cart div.quantity {
    margin-right: 5px !important;
}
.woocommerce div.product form.cart .button,
.woocommerce div.product form.cart .single_add_to_cart_button {
    max-width: calc(100% - 125px) !important;
    width: 100%;
    height: 53px;
    color: white !important;
    background: #1A4371;
    border: 0;
    opacity: 1;
    font-size: .875rem !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

/* ================================================================== *
 * Single-product DESCRIPTION & CONTENT — modern prose typography.
 *
 * Tailwind's preflight strips default heading sizes and paragraph margins,
 * which left the description tab cramped and flat. These rules restore a
 * confident reading rhythm (generous line-height, spacing, clear headings)
 * scoped to the product description so the summary above is untouched.
 * ================================================================== */

/* Comfortable centred reading column under the summary. */
.single-product .woocommerce-tabs {
    max-width: 1160px;
    margin: 48px auto 0;
}

/* Body copy: softer ink, larger size, airy line-height. */
.single-product .woocommerce-Tabs-panel--description,
.single-product .wcfs-product-description {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.85;
}
.single-product .woocommerce-Tabs-panel--description p,
.single-product .wcfs-product-description p {
    margin: 0 0 1.4em;
}
.single-product .woocommerce-Tabs-panel--description p:last-child {
    margin-bottom: 0;
}
.single-product .woocommerce-Tabs-panel--description li {
    line-height: 1.7;
    margin-bottom: 0.6em;
}
.single-product .woocommerce-Tabs-panel--description a {
    color: #1399A8;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
.single-product .woocommerce-Tabs-panel--description a:hover {
    color: #0f7d8a;
}

/* Headings (re-applied after preflight): navy, bold, clear hierarchy. */
.single-product .woocommerce-Tabs-panel--description h1,
.single-product .woocommerce-Tabs-panel--description h2,
.single-product .woocommerce-Tabs-panel--description h3,
.single-product .woocommerce-Tabs-panel--description h4,
.single-product .woocommerce-Tabs-panel--description h5 {
    color: #1A4371;
    font-weight: 700;
    line-height: 1.3;
}
.single-product .woocommerce-Tabs-panel--description h2 {
    font-size: 1.875rem;
    margin: 1.6em 0 0.6em;
}
.single-product .woocommerce-Tabs-panel--description h3 {
    font-size: 1.4rem;
    margin: 1.3em 0 0.5em;
}
.single-product .woocommerce-Tabs-panel--description h4 {
    font-size: 1.15rem;
    margin: 1.1em 0 0.4em;
}

/* Modern tab navigation (override WooCommerce's dated rounded tabs). */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    margin: 0 0 32px;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before {
    display: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: transparent;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
    border: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1rem;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: #1A4371;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #1A4371;
    border-bottom-color: #1399A8;
}

/* ------------------------------------------------------------------ *
 * Product description layout.
 *
 * Generic styling for the description's structural markup: a stack of rows,
 * each a responsive grid of columns, plus images and titled panels. It is
 * deliberately not tied to any page builder — the markup is produced by
 * `DiviContent` for content still holding Divi shortcodes, and stored
 * directly in `post_content` for descriptions the migrator has converted.
 *
 * The `.pk-divi-*` selectors are the previous names, kept so that any
 * description saved before the rename still lays out correctly.
 *
 * EVERY block is an outlined card — rows and panels share one border, radius,
 * padding and gap. Rows used to be separated by a hairline divider instead,
 * which meant a description built of prose rows (nova-flo) and one built of
 * titled panels (pir-sensors) looked like two different products. The client
 * asked for the outlined version everywhere, so the divider is gone and the
 * panel card is the single treatment; keep them in sync when either changes.
 * ------------------------------------------------------------------ */
.pk-content-section,
.pk-divi-section {
    margin: 0;
}
.pk-content-row,
.pk-divi-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: center;
    margin: 0 0 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px 28px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.pk-content-row:last-child,
.pk-divi-row:last-child {
    margin-bottom: 0;
}
/* A row is only a card when it holds prose. Both linked products end with the
   titled panels nested INSIDE a row (nova-flo in the last row, pir-sensors in
   its only one), and outlining that row too would frame every panel in a
   second box. The panels are the blocks there, so the row steps back.
   Specificity (0,2,0) deliberately beats the mobile override below. */
.pk-content-row:has(.pk-content-panels),
.pk-content-row:has(.pk-divi-tabs),
.pk-divi-row:has(.pk-content-panels),
.pk-divi-row:has(.pk-divi-tabs) {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}
.pk-content-col,
.pk-divi-col {
    min-width: 0;
}
.pk-content-col > :first-child,
.pk-divi-col > :first-child {
    margin-top: 0;
}
.pk-content-col > :last-child,
.pk-divi-col > :last-child {
    margin-bottom: 0;
}
.pk-content-image,
.pk-divi-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

/* "Literature & Brochures" / "Delivery" → the same bordered card as a row, so
   a description reads as one continuous stack of outlined blocks. */
.pk-content-panels,
.pk-divi-tabs {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}
/* The panels group is the whole description on products with no prose rows
   (pir-sensors); there is nothing above it to space away from. */
.pk-content-panels:first-child,
.pk-divi-tabs:first-child {
    margin-top: 0;
}
.pk-content-panel,
.pk-divi-tab {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px 28px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.pk-content-panel-title,
.pk-divi-tab-title {
    margin: 0 0 12px;
    color: #1A4371;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.3;
}
.pk-content-panel-body > :first-child,
.pk-divi-tab-body :first-child {
    margin-top: 0;
}
.pk-content-panel-body > :last-child,
.pk-divi-tab-body :last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Specification tables.
 *
 * The imported descriptions are mostly two-column spec tables, and they used
 * to carry their entire appearance inline — a pixel width on all 212 cells and
 * `border="1"` on the table, straight out of the Divi editor. The migration
 * strips that, so the styling lives here: a label column and a value column,
 * separated by hairlines. Tailwind's preflight zeroes table padding and
 * borders, so every value below has to be stated.
 * ------------------------------------------------------------------ */
.woocommerce-Tabs-panel--description table {
    width: 100%;
    margin: 0 0 1.5rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.6;
}
.woocommerce-Tabs-panel--description th,
.woocommerce-Tabs-panel--description td {
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
}
/* First column reads as the label for the row. */
.woocommerce-Tabs-panel--description td:first-child,
.woocommerce-Tabs-panel--description th:first-child {
    width: 38%;
    color: #1A4371;
    font-weight: 600;
}
.woocommerce-Tabs-panel--description tr:last-child td {
    border-bottom: 0;
}
.woocommerce-Tabs-panel--description thead th {
    border-bottom: 2px solid #1399A8;
    color: #1A4371;
    font-weight: 700;
}
/* Cells hold <p> wrappers from the import; their margins would double the padding. */
.woocommerce-Tabs-panel--description td > p:first-child,
.woocommerce-Tabs-panel--description th > p:first-child {
    margin-top: 0;
}
.woocommerce-Tabs-panel--description td > p:last-child,
.woocommerce-Tabs-panel--description th > p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .pk-content-row,
    .pk-divi-row {
        grid-template-columns: 1fr !important;
        gap: 24px;
        margin-bottom: 14px;
        padding: 20px;
    }
    .pk-content-panels,
    .pk-divi-tabs {
        margin-top: 14px;
        gap: 14px;
    }
    .pk-content-panel,
    .pk-divi-tab {
        padding: 20px;
    }
    .single-product .woocommerce-tabs {
        margin-top: 32px;
    }
    /* A two-column spec table has no room to shrink further — let it scroll
       rather than squeezing "European Directive 2014/32/EU" to one word a line. */
    .woocommerce-Tabs-panel--description table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
    .woocommerce-Tabs-panel--description td:first-child,
    .woocommerce-Tabs-panel--description th:first-child {
        width: auto;
        min-width: 9rem;
    }
}

/* ------------------------------------------------------------------ *
 * Product gallery: rounded main image + flex thumbnail row (matches live).
 * ------------------------------------------------------------------ */
.woocommerce-product-gallery .flex-viewport {
    border-radius: 20px;
    overflow: hidden;
}
.woocommerce div.product div.images .flex-control-thumbs {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    padding-bottom: 0 !important;
}
.woocommerce div.product div.images .flex-control-thumbs li {
    margin-right: 0;
    margin-bottom: 0;
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
}
