/* Zedflo Addify quote basket: confirmed linked calibration rows only.
   Scoped to Addify’s canonical quote page and template_one on approved Zedflo hosts.
   The existing quote submission form, prices and quantities are untouched. */
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-gauge td {
    border-bottom: 0 !important;
}
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service {
    background: #f3f3f3 !important;
}
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service td {
    background: transparent !important;
    border-bottom: 0 !important;
    padding-top: 11px !important;
    padding-bottom: 11px !important;
}
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service-last td {
    border-bottom: 1px solid #e4e4e4 !important;
}
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service td.product-thumbnail,
body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service td.product-remove {
    background: #f3f3f3 !important;
}
body.zfcal-quote-page .addify-quote-form.template_one tr.zfcal-quote-service .product-thumbnail img {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    object-fit: contain !important;
}
body.zfcal-quote-page .addify-quote-form.template_one tr.zfcal-quote-service td.product-name {
    font-size: 13px !important;
    line-height: 1.35 !important;
}
body.zfcal-quote-page .addify-quote-form.template_one .zfcal-quote-service-name {
    display: block;
    color: #292424;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
}
body.zfcal-quote-page .addify-quote-form.template_one .zfcal-quote-for-gauge {
    display: block;
    color: #292424;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
body.zfcal-quote-page .addify-quote-form.template_one .zfcal-quote-description {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.45;
    margin-top: 7px;
}
body.zfcal-quote-page .addify-quote-form.template_one tr.zfcal-quote-service td.product-name p {
    margin: 5px 0 0 !important;
}
@media (max-width: 768px) {
    /* Preserve the existing mobile quote grid; simply colour the linked cards. */
    body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service {
        background: #f3f3f3 !important;
        padding-left: 10px !important;
        padding-right: 30px !important;
        margin: 0 !important;
    }
    body.zfcal-quote-page .addify-quote-form.template_one table.addify-quote-form__contents tr.zfcal-quote-service td {
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    body.zfcal-quote-page .addify-quote-form.template_one tr.zfcal-quote-service .product-thumbnail img {
        width: 65px !important;
        height: 65px !important;
        max-width: 65px !important;
        max-height: 65px !important;
    }
    body.zfcal-quote-page .addify-quote-form.template_one tr.zfcal-quote-service td.product-name {
        padding-top: 2px !important;
    }
}

/* =============================================================
   v0.5.11: compact MOBILE quote basket only (max 768px).
   Overrides the old 170px image-above-details grid in staging
   Custom CSS, without modifying the Addify form or any cart rules.
   Extra specificity is intentional: staging Custom CSS may load
   after plugin styles. No JS, quantity logic or template overrides.
   ============================================================= */
@media screen and (max-width: 768px) {
    /* Small image on the left, product information on the right,
       and an editable quantity directly below that information. */
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents tr.cart_item {
        grid-template-columns: 62px minmax(0, 1fr) !important;
        grid-template-areas:
            "image name"
            ". qty" !important;
        column-gap: 12px !important;
        row-gap: 8px !important;
        align-items: start !important;
        padding: 16px 28px 16px 0 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    /* The grey calibration surface remains visually attached;
       keep a modest inset rather than a large mobile card. */
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item.zfcal-quote-service {
        padding: 14px 28px 14px 8px !important;
        background: #f3f3f3 !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-thumbnail {
        grid-area: image !important;
        width: 62px !important;
        max-width: 62px !important;
        justify-self: start !important;
        align-self: start !important;
        text-align: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-thumbnail img {
        display: block !important;
        width: 58px !important;
        height: 58px !important;
        max-width: 58px !important;
        max-height: 58px !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* Slightly smaller calibration symbol to mirror the cart. */
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item.zfcal-quote-service td.product-thumbnail img {
        width: 54px !important;
        height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-name {
        grid-area: name !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        overflow-wrap: anywhere;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-name a {
        font-size: 14px !important;
        line-height: 1.35 !important;
        margin-bottom: 5px !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-name dl.variation dt,
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-name dl.variation dd {
        line-height: 1.35 !important;
    }

    /* Retain the real Addify quantity input and its name/value;
       only relocate and resize it. */
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-quantity {
        grid-area: qty !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        justify-self: start !important;
        align-self: start !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        text-align: left !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-quantity::before {
        content: "Quantity" !important;
        display: inline-block !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        color: #777 !important;
        text-align: left !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item .product-quantity .quantity {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        width: auto !important;
    }

    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item .product-quantity input.qty {
        width: 54px !important;
        height: 40px !important;
        min-height: 40px !important;
        font-size: 14px !important;
        border: 2px solid #292424 !important;
        padding: 0 !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    /* Position Remove outside the text flow without covering it. */
    body.zfcal-quote-page .adf-request-quote-page.template_one
    .addify-quote-form.template_one table.addify-quote-form__contents
    tr.cart_item td.product-remove {
        top: 12px !important;
        right: 2px !important;
        width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        padding: 0 !important;
    }
}
