/* Enabled only by the maijindou/homepage2 layouts. Keep scientific images uncropped. */
.apex-mobile-enabled .apex-original-image-link { display: none; }
.apex-mobile-enabled .apex-addtocart-status:empty { display: none; }
.apex-mobile-enabled .apex-addtocart-status { clear: both; padding: 10px 0; }
.apex-mobile-enabled .apex-addtocart-status a { margin-left: 8px; text-decoration: underline; }
.apex-mobile-enabled .apex-addtocart-status.is-error { color: #b30000; }
.apex-mobile-enabled .apex-field-help { display: block; margin: 5px 0 12px; color: #555; font-size: 13px; }
.apex-mobile-enabled #artshb { cursor: pointer; }
.apex-mobile-enabled .detail-titer.fixed { box-sizing: border-box; }
/* The theme's transition:all animates active borders and breakpoint sizing, moving anchor targets. */
.apex-mobile-enabled #product-info-attributes .detail-titer a { transition-property: color, background-color; }
.apex-mobile-enabled #carousel-top .item { width: 100%; }

/* The old q-img hover sets 295px/600px limits inline. Fit those images at tablet widths too. */
@media (max-width: 1023px) {
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-left,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-center,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-right {
        width: 100%; float: none; height: auto !important; max-height: none;
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .apex-quality-clear { display: none; }
    .apex-mobile-enabled .apex-original-image-link { display: inline-block; padding: 10px 0; text-decoration: underline; }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .q-img,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .qq-img { max-width: 100%; }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .q-img img,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .qq-img img {
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 767px) {
    .apex-mobile-enabled .apex-addtocart-status a { display: inline-block; box-sizing: border-box; min-height: 44px; padding: 10px 0; }
    .apex-mobile-enabled .header-container .header-content { padding-top: 12px; padding-bottom: 12px; }
    .apex-mobile-enabled .header-container .logo { margin-bottom: 10px; }
    .apex-mobile-enabled .header-container .mobile-bar-icon,
    .apex-mobile-enabled .mobile-bar-content .mobile-bar-close {
        min-height: 44px; min-width: 44px; border: 0; background: transparent; color: inherit;
    }
    .apex-mobile-enabled .mobile-bar-content[hidden] { display: none; }
    .apex-mobile-enabled .mobile-bar-content.open { max-height: 100dvh; overflow-y: auto; }
    /* Keep the full close target inside the scrolling panel; the old right:-35px is clipped. */
    .apex-mobile-enabled .mobile-bar-content .mobile-bar-close {
        right: 0; width: 44px; height: 44px; padding: 0; line-height: 44px; z-index: 1;
        background: #333; color: #fff;
    }
    .apex-mobile-enabled .mobile-bar-content .mobile-bar-close:before {
        content: "×"; font-family: Arial, sans-serif; font-size: 28px;
    }
    .apex-mobile-enabled .amsearch-input { min-height: 44px; font-size: 16px; }
    .apex-mobile-enabled .amsearch-result-section {
        box-sizing: border-box; max-width: 100%; max-height: min(55vh, 480px); overflow-y: auto;
    }
    .apex-mobile-enabled .amsearch-result-section .amsearch-products-section { width: 100%; max-width: 100%; }
    .apex-mobile-enabled .amsearch-result-section .amsearch-product-list { display: block; }
    /* Xsearch -grid:not(.-slider) limits each item to 50% and wraps its children. */
    .apex-mobile-enabled .amsearch-result-section .amsearch-products-section .amsearch-product-list .amsearch-item {
        display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-start; gap: 12px;
        box-sizing: border-box; width: 100%; max-width: 100%; padding: 8px;
    }
    .apex-mobile-enabled .amsearch-result-section .amsearch-image { flex: 0 0 64px; width: 64px; min-width: 64px; }
    /* Xsearch writes width:320px inline on this thumbnail container. */
    .apex-mobile-enabled .amsearch-result-section .amsearch-product-image-container { width: 64px !important; }
    .apex-mobile-enabled .amsearch-result-section .amsearch-image img { max-width: 64px; max-height: 64px; object-fit: contain; }
    .apex-mobile-enabled .amsearch-result-section .amsearch-description { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; text-align: left; }

    .apex-mobile-enabled #product-info-attributes { min-width: 0; }
    .apex-mobile-enabled #product-info-attributes .detail-titer,
    .apex-mobile-enabled #product-info-attributes .detail-titer.fixed {
        position: sticky; top: 0; left: auto; width: 100%; max-width: 100%;
        box-sizing: border-box; z-index: 20; background: #fff; margin-bottom: 12px;
    }
    .apex-mobile-enabled .detail-titer ul { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 4px 0; }
    .apex-mobile-enabled .detail-titer li { flex: 0 0 auto; margin: 0 5px 0 0; }
    .apex-mobile-enabled .detail-titer li a { min-height: 44px; white-space: nowrap; }
    .apex-mobile-enabled .detail-conter .tbar { scroll-margin-top: 64px; }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] { display: flow-root; }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-left,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-center,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .item-right {
        float: none; clear: both; width: 100%; box-sizing: border-box;
        /* These nodes have ordinary inline height:240px/270px/280px in the saved product HTML. */
        height: auto !important; min-height: 0; max-height: none; margin: 0 0 20px; padding: 0 0 16px;
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .q-img,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .qq-img {
        height: auto !important; max-height: none; width: auto; position: static;
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] picture {
        display: block; max-width: 100%; height: auto !important; max-height: none;
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .q-img img,
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] .qq-img img {
        /* Override the existing inline image/hover caps only inside confirmed image wrappers. */
        position: static !important; width: auto !important; max-height: none !important;
        margin-left: 0 !important; box-shadow: none; border: 0;
    }
    .apex-mobile-enabled #product-info-attributes .detail-quality[data-product-attribute="quality_control"] h3 { overflow-wrap: anywhere; }
    .apex-mobile-enabled .apex-original-image-link { display: inline-block; padding: 10px 0; text-decoration: underline; }
    .apex-mobile-enabled .apex-detail-table-scroll { max-width: 100%; overflow-x: auto; }
    .apex-mobile-enabled .apex-detail-table-scroll:focus-visible { outline: 2px solid #e58016; }
    .apex-mobile-enabled #artshb { min-height: 44px; white-space: normal; margin: 10px 0; }

    .apex-mobile-enabled .product-info-main #super-product-table,
    .apex-mobile-enabled .product-info-main #super-product-table tbody { display: block; width: 100%; }
    .apex-mobile-enabled #super-product-table thead { display: none; }
    .apex-mobile-enabled #super-product-table tbody > tr:not(.row-tier-price) {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
        gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid #ddd;
    }
    .apex-mobile-enabled #super-product-table tbody > tr > td {
        box-sizing: border-box; display: block; width: auto; padding: 2px 0; border: 0;
    }
    .apex-mobile-enabled #super-product-table td.col.item { grid-column: 1; grid-row: 1; overflow-wrap: anywhere; }
    .apex-mobile-enabled #super-product-table td.col.price { grid-column: 2; grid-row: 1; text-align: right; }
    .apex-mobile-enabled #super-product-table td.col.stock { grid-column: 1; grid-row: 2; }
    .apex-mobile-enabled #super-product-table td.col.qty { grid-column: 2; grid-row: 2; text-align: right; }
    .apex-mobile-enabled #super-product-table td.col:before { display: none; }
    .apex-mobile-enabled #super-product-table .control.qty { display: inline-block; }
    .apex-mobile-enabled #super-product-table input.qty { min-height: 44px; width: 72px; font-size: 16px; margin: 0; }
    .apex-mobile-enabled #super-product-table .row-tier-price { display: block; }
    .apex-mobile-enabled #super-product-table td.unavailable { grid-column: 1 / -1; }
    .apex-mobile-enabled #product_addtocart_form .box-tocart .fieldset { display: flex; flex-wrap: wrap; gap: 8px; }
    .apex-mobile-enabled #product_addtocart_form .box-tocart .actions { flex: 1 1 45%; width: auto; margin: 0; padding: 0; }
    .apex-mobile-enabled #product_addtocart_form .box-tocart .actions .action {
        width: 100%; min-height: 44px; height: auto; line-height: 1.4; padding: 10px 12px;
        white-space: normal; overflow-wrap: anywhere; font-size: 14px;
    }
    .apex-mobile-enabled #product_addtocart_form .box-tocart .actions .action span { white-space: normal; }
    .apex-mobile-enabled #product_addtocart_form .box-tocart .apex-addtocart-status { flex-basis: 100%; }
    .apex-mobile-enabled.checkout-cart-index .cart-summary { position: static; width: 100%; }

    .apex-mobile-enabled.onestepcheckout-index-index #mageplaza-one-step-checkout input.input-text:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .apex-mobile-enabled.onestepcheckout-index-index #mageplaza-one-step-checkout select,
    .apex-mobile-enabled.onestepcheckout-index-index #mageplaza-one-step-checkout textarea { min-height: 44px; font-size: 16px; max-width: 100%; box-sizing: border-box; }
    .apex-mobile-enabled.onestepcheckout-index-index .input-box { min-width: 0; }
    .apex-mobile-enabled.onestepcheckout-index-index .field.choice,
    .apex-mobile-enabled.onestepcheckout-index-index .shipping-methods label { min-height: 44px; }
    .apex-mobile-enabled.onestepcheckout-index-index label[for="billing:use_for_shipping"],
    .apex-mobile-enabled.onestepcheckout-index-index .payment-method-title label { display: inline-flex; align-items: center; min-height: 44px; }
    .apex-mobile-enabled.onestepcheckout-index-index .osc-address-save-message { overflow-wrap: anywhere; }
}
