/* Optional additive polish. Load after dto-storefront.css and the editor styles.
   No payment, supplier, availability, or form-submission behaviour is changed. */

/* Do not lose navigation on a legacy checkout template that omits wp_body_open.
   The main sheet hides these IDs unconditionally; restore only when the replacement
   does not exist in this document. An unsupported :has() rule is simply ignored. */
@supports selector(body:has(.dto-site-header)) {
  body:not(:has(.dto-site-header)) #header { display: block !important; }
  body:not(:has(.dto-site-header)) .header-space { display: block !important; }
  body:not(:has(.dto-site-footer)) #footer { display: block !important; }
}

/* Prevent grid/flex min-content sizing from forcing narrow screens wider. */
.dto-header-inner > *,
.dto-category-grid > *,
.dto-product-grid > *,
.dto-footer-grid > *,
.dto-editor .dto-fields-panel,
.dto-editor .dto-preview-panel { min-width: 0; }
.dto-search input[type="search"] { min-width: 0; }
.dto-site-header .dto-search button { top: 0; height: 44px; min-height: 44px; }
.dto-site-footer p,
.dto-site-footer a,
.dto-category-card h3,
.dto-product-card h3 { overflow-wrap: anywhere; }

/* The retained engraving counters and helper text are useful buying information. */
.dto-editor .dto-counter,
.dto-editor .dto-preview-note,
.dto-editor .dto-check-note,
.dto-editor .dto-pet-name p { font-size: 12px !important; line-height: 1.55; }
.dto-editor input[type="text"]::placeholder { color: #68776f; opacity: 1; }
.dto-editor .dto-label-row { gap: 12px; }
.dto-editor .dto-counter { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.dto-editor .dto-side-switch { flex-wrap: wrap; gap: 8px; }
.dto-editor .dto-side-switch button { min-height: 44px; }

/* Select2 uses a focusable span, so the global input/anchor focus rule misses it. */
.woocommerce .select2-selection:focus-visible,
.woocommerce .select2-container--focus .select2-selection {
  outline: 3px solid #83b3a5 !important;
  outline-offset: 3px;
  border-color: #285b4c !important;
}
.woocommerce .form-row.woocommerce-invalid input.input-text,
.woocommerce .form-row.woocommerce-invalid textarea,
.woocommerce .form-row.woocommerce-invalid .select2-selection { border-color: #a4422c; }
.woocommerce form input[type="checkbox"],
.woocommerce form input[type="radio"] { accent-color: #183d3a; }
.woocommerce-checkout .woocommerce-form__label-for-checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.6;
}
.woocommerce-checkout .woocommerce-form__label-for-checkbox input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

/* Names and engraving details remain readable in narrow cart/checkout columns. */
.woocommerce table.shop_table .product-name,
.woocommerce table.shop_table .variation dd,
.woocommerce table.shop_table .variation dt,
.woocommerce-checkout #payment .payment_box { overflow-wrap: anywhere; }
.woocommerce table.shop_table .variation dd { margin-bottom: 7px; }
.woocommerce table.shop_table .variation p { margin-bottom: 0; }
.woocommerce a.remove {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  line-height: 1;
  border-radius: 50%;
}
.woocommerce .coupon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.woocommerce .coupon input.input-text {
  flex: 1 1 140px;
  min-width: 0;
  width: auto;
  margin: 0;
  min-height: 44px;
}
.woocommerce .coupon button { min-height: 44px; max-width: 100%; margin: 0; white-space: normal; }
.woocommerce .single_add_to_cart_button:disabled,
.woocommerce .single_add_to_cart_button.disabled { opacity: .55; cursor: not-allowed; }
.dto-guide-content table { table-layout: fixed; }
.dto-guide-content th,
.dto-guide-content td { overflow-wrap: anywhere; vertical-align: top; }
.dto-guide-content th:first-child,
.dto-guide-content td:first-child { width: 32%; }

@media (max-width: 600px) {
  .dto-benefits > * { flex-wrap: wrap; }
  .dto-benefits p { min-width: 0; flex: 1 1 140px; }
  .dto-site-footer a { min-height: 44px; }
  .woocommerce .product-info .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }
  .woocommerce .product-info .woocommerce-variation-add-to-cart .quantity { margin: 0 !important; }
  .woocommerce .product-info .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    flex: 1 1 160px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    white-space: normal;
  }
  .woocommerce .quantity .minus,
  .woocommerce .quantity .plus {
    min-width: 44px;
    width: 44px;
    min-height: 48px;
  }
  .woocommerce .quantity input.qty { min-width: 44px; width: 44px; font-size: 16px; }
  .woocommerce table.shop_table .product-name { line-height: 1.6; }
  .woocommerce-checkout .woocommerce-privacy-policy-text,
  .woocommerce-checkout .woocommerce-terms-and-conditions-wrapper { line-height: 1.7; }
}

@media (pointer: coarse) {
  .attr-icon { min-width: 44px; min-height: 44px; }
}

/* Collection pages put the choice first, with useful paths into the catalogue. */
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important}
.dto-catalogue-intro{background:#f7f5ef;padding:36px 24px 22px;color:#203c38}
.dto-catalogue-intro>div{max-width:1152px;margin:auto}
.dto-catalogue-intro h1{font-size:clamp(30px,4vw,46px);font-weight:750;line-height:1.12;letter-spacing:-1.6px;margin:10px 0 14px}
.dto-catalogue-intro p{font-size:15px;line-height:1.7;max-width:650px;color:#52675d;margin:0 0 20px}
.dto-category-links{display:flex;flex-wrap:wrap;gap:8px}
.dto-category-links a{display:inline-flex;align-items:center;min-height:44px;padding:9px 17px;border:1px solid #cad5cd;border-radius:25px;background:#fff;font-size:13px;font-weight:600;text-decoration:none}
.dto-category-links a[aria-current=page]{background:#183d3a;color:#fff;border-color:#183d3a}
.dto-category-links a:hover{border-color:#183d3a}
body .shop-page-title.category-page-title{padding:12px 0 20px;border-bottom:1px solid #e6e9e2}
.category-page-title .page-title-inner{min-height:0;gap:16px}
.category-page-title .woocommerce-ordering{margin:0}
.dto-purchase-details{margin:12px 0 20px;padding-bottom:18px;border-bottom:1px solid #dce3dc}
.dto-current-price{font-size:25px;font-weight:750;line-height:1.4;color:#183d3a}
.dto-current-price ins{text-decoration:none}.dto-current-price del{font-size:18px;color:#66716c;font-weight:400}
/* The replacement panel above this form already updates with the selected size.
   Keep stock/availability and the rest of the variation output visible. */
.single-product .dto-purchase-details ~ form.cart .single_variation .woocommerce-variation-price,
.single-product .dto-purchase-details ~ form.cart .single_variation .price { display:none!important; }
.dto-price-includes{font-size:12px;font-weight:600;color:#426352;margin:5px 0 9px}
.dto-measurement{font-size:13px;color:#52675d;margin:5px 0}
.dto-fit-link{display:inline-flex;align-items:center;min-height:44px;font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:4px}
.dto-help-page{max-width:1050px;padding:48px 24px;margin:auto;color:#203c38}
.dto-help-page>header{max-width:760px;margin-bottom:30px}
.dto-help-page h1{font-size:clamp(32px,4vw,48px);font-weight:750;letter-spacing:-1.8px;line-height:1.12;margin:12px 0 20px}
.dto-help-page>header p{font-size:17px;line-height:1.7;color:#66716c}
.dto-help-page .dto-faq{max-width:none;padding:0 0 32px}
.dto-help-page .dto-faq>.dto-section-heading{display:none}
.dto-help-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.dto-help-box{background:#f7f5ef;border:1px solid #e4e7df;border-radius:18px;padding:28px}
.dto-help-box h2{font-size:24px;line-height:1.2;letter-spacing:-.6px;margin:0 0 15px}
.dto-help-box p{font-size:15px;line-height:1.75;color:#52675d}
.dto-help-box a:not(.dto-button){text-decoration:underline;text-underline-offset:4px;overflow-wrap:anywhere;display:inline-flex;align-items:center;min-height:44px}
.dto-help-end{padding-top:25px;font-weight:600}
.woocommerce-cart .page-checkout,.woocommerce-checkout .page-checkout{max-width:1200px}
@media(max-width:600px){
 .dto-catalogue-intro{padding:25px 18px 16px}.dto-catalogue-intro h1{font-size:32px;letter-spacing:-1.2px}.dto-catalogue-intro p{font-size:14px;margin-bottom:16px}
 .dto-category-links{gap:7px}.dto-category-links a{padding:8px 13px;font-size:12px}
 body .shop-page-title.category-page-title{padding:10px 18px 15px}.category-page-title .page-title-inner{display:grid!important;grid-template-columns:auto minmax(0,1fr);padding:0;gap:10px}.category-page-title .flex-col{width:auto!important;min-width:0;text-align:left!important}.category-page-title .breadcrumbs{display:none}.category-page-title .woocommerce-ordering{display:block;width:100%}.category-page-title select{font-size:13px!important;margin:0!important;width:100%}
 .single-product .product-gallery{margin-bottom:0}
 /* Target the Woo gallery itself: legacy layouts do not all have .product-gallery.
    Override inline variation dimensions, but leave the separate zoom image alone. */
 .single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img:not(.zoomImg){display:block;max-height:260px!important;height:auto!important;width:100%!important;max-width:100%!important;object-fit:contain}
 .single-product .woocommerce-product-gallery:not(.product-gallery-stacked) .flickity-viewport{max-height:260px!important}
 .dto-help-page{padding:30px 20px}.dto-help-page h1{font-size:34px;letter-spacing:-1.3px}.dto-help-page>header p{font-size:15px}.dto-help-grid{grid-template-columns:1fr;gap:14px}.dto-help-box{padding:23px}.dto-help-box h2{font-size:23px}
 .dto-purchase-details{margin-top:8px}.dto-current-price{font-size:23px}
}

/* Theme em-based table/metadata sizes compound to less than 10px. */
.woocommerce-cart .woocommerce table.shop_table .product-name,
.woocommerce-checkout .woocommerce table.shop_table .product-name {font-size:14px;line-height:1.6}
.woocommerce-cart .woocommerce table.shop_table .variation,
.woocommerce-cart .woocommerce table.shop_table .variation dt,
.woocommerce-cart .woocommerce table.shop_table .variation dd,
.woocommerce-cart .woocommerce table.shop_table .variation p,
.woocommerce-checkout .woocommerce table.shop_table .variation,
.woocommerce-checkout .woocommerce table.shop_table .variation dt,
.woocommerce-checkout .woocommerce table.shop_table .variation dd,
.woocommerce-checkout .woocommerce table.shop_table .variation p {font-size:13px;line-height:1.55}
.woocommerce-checkout .woocommerce form.checkout input[type="email"],
.woocommerce-checkout .woocommerce form.checkout .form-row input.input-text,
.woocommerce-checkout .woocommerce form.checkout .form-row textarea,
.woocommerce-checkout .woocommerce form.checkout .form-row select,
.woocommerce-checkout .woocommerce form.checkout .select2-selection__rendered {font-size:16px}

/* Keep each engraving label with its own value instead of the legacy inline run. */
.woocommerce table.shop_table dl.variation dt,
.woocommerce table.shop_table dl.variation dd{display:block!important;float:none!important;clear:none!important;width:auto!important}
.woocommerce table.shop_table dl.variation dt{margin:7px 0 1px!important;font-weight:650}
.woocommerce table.shop_table dl.variation dd{margin:0 0 7px!important}
.woocommerce table.shop_table dl.variation dd p{margin:0!important}

@media(max-width:600px){
 /* Put quantity underneath the details instead of squeezing engraving into a
    third column. Existing theme price/subtotal visibility remains unchanged. */
 .woocommerce-cart .woocommerce table.shop_table.cart,
 .woocommerce-cart .woocommerce table.shop_table.cart>tbody{display:block;width:100%}
 .woocommerce-cart .woocommerce table.shop_table.cart>thead{display:none}
 .woocommerce-cart .woocommerce table.shop_table.cart>tbody>tr{display:block;width:100%}
 .woocommerce-cart .woocommerce table.shop_table.cart .actions{display:block;width:100%}
 .woocommerce-cart .woocommerce table.shop_table.cart tbody tr.cart_item{display:grid;grid-template-columns:60px minmax(0,1fr);column-gap:14px;row-gap:12px;padding:20px 0;border-bottom:1px solid #dce3dc}
 .woocommerce-cart .woocommerce table.shop_table.cart tbody tr.cart_item>td{min-width:0;padding:0;border:0}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-thumbnail{grid-column:1;grid-row:1;width:60px;min-width:0;max-width:60px}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-thumbnail img{width:60px;height:60px;object-fit:contain}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-name{grid-column:2;grid-row:1;min-width:0}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-quantity{grid-column:2;grid-row:2;text-align:left}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-remove{grid-column:1;grid-row:2;width:auto;min-width:0;position:static;align-self:start}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .product-remove a{position:static;display:flex;margin:0 auto;min-width:44px;min-height:44px;width:44px;height:44px}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .variation dt,
 .woocommerce-checkout .woocommerce table.shop_table .variation dt{float:none;clear:both;margin:0;font-weight:650}
 .woocommerce-cart .woocommerce table.shop_table.cart .cart_item .variation dd,
 .woocommerce-checkout .woocommerce table.shop_table .variation dd{float:none;clear:both;margin:0 0 8px}
}
