/* MyDiabetes 1.2.3: native WooCommerce templates, reference-led presentation. */
body.mdp-store-design {
    --mdp-navy: var(--md-primary, #103e63);
    --mdp-teal: var(--md-secondary, #14a7af);
    --mdp-line: #e3e9ee;
    --mdp-muted: #64748b;
}
body.mdp-store-design .md-shop.md-page { padding-top: 36px; }
body.mdp-store-design .md-shop { width: min(1440px, calc(100% - 64px)); }
body.mdp-store-design .woocommerce-breadcrumb { font-size: 14px; margin-bottom: 24px; }
body.mdp-store-design .woocommerce-products-header {
    text-align: start; padding: 0; margin-bottom: 30px; background: transparent;
}
body.mdp-store-design .woocommerce-products-header h1 {
    font-size: clamp(28px, 3vw, 40px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 16px; color: var(--mdp-navy);
}
body.mdp-store-design .woocommerce-result-count,
body.mdp-store-design .woocommerce-ordering { font-size: 15px; margin-bottom: 24px; }
body.mdp-store-design .woocommerce-ordering select { min-height: 44px; max-width: 100%; }
/* Keep the native header in the document flow and contain the gallery zoom icon. */
body.mdp-store-design .mdc-header-shell { position: relative; top: auto; }
body.mdp-store-design.single-product div.product:not(li) > .woocommerce-product-gallery {
    float: none; width: 100%; min-width: 0; margin: 0; position: relative;
    align-self: start; border: 1px solid var(--mdp-line); border-radius: 12px; padding: 18px; background: #fff;
}
body.mdp-store-design.single-product .md-shop > div.product {
    display: grid; grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
    column-gap: 38px; row-gap: 32px; align-items: start;
}
body.mdp-store-design.single-product .md-shop > div.product::before,
body.mdp-store-design.single-product .md-shop > div.product::after { display: none; }
body.mdp-store-design.single-product .md-shop > div.product > .summary {
    width: 100%; float: none; min-width: 0; margin: 0; padding: 0;
}
body.mdp-store-design.single-product .md-shop > div.product > .onsale { z-index: 5; }
body.mdp-store-design.single-product .md-shop > div.product > .woocommerce-tabs,
body.mdp-store-design.single-product .md-shop > div.product > .related,
body.mdp-store-design.single-product .md-shop > div.product > .up-sells { grid-column: 1 / -1; min-width: 0; width: 100%; }
body.mdp-store-design.single-product .summary h1.product_title {
    font-size: clamp(23px, 1.8vw, 28px); line-height: 1.4; font-weight: 650;
    letter-spacing: -.015em; margin: 0 0 12px; color: var(--mdp-navy); overflow-wrap: anywhere;
}
body.mdp-store-design.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper { margin: 0; }
body.mdp-store-design.single-product .woocommerce-product-gallery__image img {
    width: 100%; height: auto; aspect-ratio: 1.15; object-fit: contain; background: #fff; border-radius: 6px;
}
body.mdp-store-design.single-product .woocommerce-product-gallery .flex-control-thumbs { margin-top: 12px; }
body.mdp-store-design.single-product .woocommerce-product-gallery .flex-control-thumbs img { aspect-ratio: 1; object-fit: contain; }
body.mdp-store-design.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger { top: 10px; right: 10px; z-index: 6; }
body.mdp-store-design.single-product .summary .mdp-product-brand { font-size: 16px; margin: 0 0 12px; }
body.mdp-store-design.single-product .summary .mdp-product-brand a { color: var(--mdp-navy); text-decoration-color: var(--mdp-teal); text-underline-offset: 4px; font-weight: 600; }
body.mdp-store-design.single-product .summary > .price {
    font-size: 24px; font-weight: 700; line-height: 1.5; text-align: end; margin: 14px 0 24px; color: var(--mdp-navy);
}
body.mdp-store-design .price ins { text-decoration: none; background: transparent; }
body.mdp-store-design .price del { font-size: .78em; color: var(--mdp-muted); opacity: 1; font-weight: 400; }
body.mdp-store-design .price del + ins { margin-inline-start: 5px; }
.mdp-price-unit { font-size: .7em; font-weight: 400; color: #64748b; white-space: nowrap; }
body.mdp-store-design.single-product .summary > .price > .mdp-price-unit { display: none; }
body.mdp-store-design .mdp-selling-unit { display: flex; align-items: center; gap: 10px; font-size: 18px; line-height: 1.5; margin: 0 0 26px; color: var(--mdp-navy); }
body.mdp-store-design .mdp-unit-dot { width: 19px; height: 19px; flex: 0 0 19px; border: 2px solid var(--mdp-teal); border-radius: 50%; padding: 3px; background: var(--mdp-teal); background-clip: content-box; }
body.mdp-store-design.single-product .summary .woocommerce-product-details__short-description { font-size: 16px; line-height: 1.7; margin-bottom: 22px; }
body.mdp-store-design.single-product .summary form.cart { margin: 26px 0 22px; gap: 12px; align-items: center; }
body.mdp-store-design.single-product .summary form.cart .quantity .qty { border-color: var(--mdp-line); min-height: 48px; width: 80px; }
body.mdp-store-design.single-product .summary form.cart .single_add_to_cart_button {
    min-height: 48px; padding: 12px 24px; font-size: 15px; line-height: 1.4; border-radius: 9px;
    background: var(--mdp-navy); color: #fff; border: 2px solid var(--mdp-navy);
}
body.mdp-store-design.single-product .summary form.cart .mdp-buy-now { background: #fff; color: var(--mdp-navy); }
body.mdp-store-design.single-product .summary form.cart .single_add_to_cart_button:hover { background: #0b304e; color: #fff; }
body.mdp-store-design.single-product .summary form.cart .mdp-buy-now:hover { background: #eff8fa; color: var(--mdp-navy); }
body.mdp-store-design.single-product .summary .product_meta { font-size: 14px; line-height: 1.7; color: var(--mdp-muted); padding-top: 15px; border-top: 1px solid var(--mdp-line); }
body.mdp-store-design.single-product .summary .product_meta > span { display: block; }
body.mdp-store-design.single-product .summary .up-sells { margin-top: 28px; padding: 24px; border: 1px solid var(--mdp-line); border-radius: 18px; background: #f2f6f8; }
body.mdp-store-design.single-product .summary .up-sells > h2 { font-size: 22px; text-align: center; color: var(--mdp-navy); margin: 0 0 20px; }
body.mdp-store-design.single-product .woocommerce-tabs h2,
body.mdp-store-design.single-product .related > h2 { font-size: 25px; line-height: 1.4; }
body.mdp-store-design.single-product .woocommerce-tabs { font-size: 16px; line-height: 1.7; }
/* Equal-height product cards. Native anchors, stock checks and AJAX stay intact. */
body.mdp-store-design ul.products {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
    list-style: none; padding: 0; clear: both;
}
body.mdp-store-design ul.products::before,
body.mdp-store-design ul.products::after { display: none; }
body.mdp-store-design ul.products li.product {
    display: flex; flex-direction: column; position: relative; min-width: 0; width: auto !important;
    float: none !important; margin: 0 !important; padding: 20px; overflow: hidden;
    background: #fff; border: 1px solid var(--mdp-line); border-radius: 18px; box-shadow: none;
}
body.mdp-store-design ul.products li.product:hover { border-color: #b4dadd; box-shadow: 0 6px 22px #103e6309; }
body.mdp-store-design ul.products li.product > a.woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1; color: var(--mdp-navy); text-decoration: none; min-width: 0; }
body.mdp-store-design ul.products li.product a img {
    width: 100%; height: auto; aspect-ratio: 1.2; object-fit: contain;
    padding: 16px; border-radius: 12px; background: #f7f9fa; margin: 0 0 20px;
}
body.mdp-store-design ul.products li.product .woocommerce-loop-product__title {
    border-top: 1px dashed #dce3e9; padding: 18px 0 0; margin: 0 0 22px;
    font-size: 19px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em;
    color: var(--mdp-navy); overflow-wrap: anywhere;
}
body.mdp-store-design ul.products li.product .price {
    margin: auto 0 0; padding: 4px 0; min-height: 48px; display: block;
    font-size: 21px; line-height: 1.45; font-weight: 700; color: var(--mdp-navy); overflow-wrap: anywhere;
}
body.mdp-store-design ul.products li.product:has(> .mdp-cart-icon) .price { padding-inline-end: 56px; }
body.mdp-store-design ul.products li.product .price del { display: block; }
body.mdp-store-design ul.products li.product .price ins { margin: 0; }
body.mdp-store-design ul.products li.product .mdp-price-unit { font-size: 14px; }
body.mdp-store-design ul.products li.product > .button:not(.mdp-cart-icon) { margin-top: 12px; width: 100%; font-size: 14px; }
body.mdp-store-design ul.products li.product > a.mdp-cart-icon {
    position: absolute; inset-inline-end: 20px; bottom: 20px; margin: 0; padding: 0;
    width: 46px; min-width: 46px; height: 46px; min-height: 46px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--mdp-teal); color: #082d47; border: 0; box-shadow: 0 2px 5px #103e631a;
}
body.mdp-store-design ul.products li.product > a.mdp-cart-icon:hover { background: var(--mdp-navy); color: #fff; }
body.mdp-store-design ul.products li.product > a.mdp-cart-icon.loading svg { opacity: .25; }
body.mdp-store-design ul.products li.product > a.mdp-cart-icon.added::after { display: none; }
body.mdp-store-design ul.products li.product > .added_to_cart { margin-top: 14px; min-height: 44px; padding: 10px 56px 0 0; font-size: 14px; color: var(--mdp-navy); }
body.mdp-store-design ul.products li.product:has(> .added_to_cart) > a.mdp-cart-icon { bottom: 72px; }
body.mdp-store-design ul.products li.product .onsale { top: 10px; left: 10px; right: auto; margin: 0; background: var(--mdp-navy); color: #fff; z-index: 2; }
body.mdp-store-design .summary .up-sells ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 0; }
body.mdp-store-design :is(a,button,input,select):focus-visible { outline: 3px solid var(--mdp-teal); outline-offset: 3px; }
body.mdp-store-design .md-filter { font-size: 14px; }
@media (max-width: 1100px) {
    body.mdp-store-design ul.products { gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body.mdp-store-design.single-product .md-shop > div.product { column-gap: 26px; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
    body.mdp-store-design .summary .up-sells ul.products li.product { padding: 12px; }
    body.mdp-store-design .summary .up-sells ul.products li.product .price { font-size: 18px; }
    body.mdp-store-design .summary .up-sells ul.products li.product .woocommerce-loop-product__title { font-size: 16px; }
    body.mdp-store-design .summary .up-sells ul.products li.product > a.mdp-cart-icon { inset-inline-end: 12px; bottom: 12px; }
    body.mdp-store-design .summary .up-sells ul.products li.product:has(> .added_to_cart) > a.mdp-cart-icon { bottom: 64px; }
}
@media (max-width: 767px) {
    body.mdp-store-design .md-shop { width: calc(100% - 32px); }
    body.mdp-store-design .md-shop.md-page { padding-top: 24px; }
    body.mdp-store-design.single-product .md-shop > div.product { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    body.mdp-store-design.single-product .summary h1.product_title { font-size: 23px; }
    body.mdp-store-design.single-product .summary > .price { text-align: start; }
    body.mdp-store-design.single-product .woocommerce-product-gallery__image img { max-height: 430px; }
    body.mdp-store-design ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    body.mdp-store-design ul.products li.product { padding: 13px; border-radius: 14px; }
    body.mdp-store-design ul.products li.product a img { padding: 10px; margin-bottom: 14px; }
    body.mdp-store-design ul.products li.product .woocommerce-loop-product__title { font-size: 16px; padding-top: 13px; margin-bottom: 16px; }
    body.mdp-store-design ul.products li.product .price { font-size: 18px; }
    body.mdp-store-design ul.products li.product .mdp-price-unit { font-size: 13px; }
    body.mdp-store-design ul.products li.product > a.mdp-cart-icon { inset-inline-end: 13px; bottom: 13px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
    body.mdp-store-design ul.products li.product:has(> .added_to_cart) > a.mdp-cart-icon { bottom: 65px; }
    body.mdp-store-design.single-product .summary .up-sells { padding: 16px; }
    body.mdp-store-design .woocommerce-ordering { float: none; }
}
@media (max-width: 380px) {
    body.mdp-store-design ul.products, body.mdp-store-design .summary .up-sells ul.products { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    body.mdp-store-design .summary .up-sells ul.products { grid-template-columns: minmax(0, 1fr); }
}
