/* Shared storefront typography and text CTAs. No payment/widget state changes.
   Keep icon controls and provider-owned wallet buttons outside this allowlist. */
body :is(h1, h2, h3, h4, h5, h6, .page-title, .products-widget-title,
    .step-title, .block-title, .fieldset > .legend, .opc-block-summary > .title,
    .post-title, .post-view .post-header .post-title) {
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.2;
}
body :is(h1, h2, h3, h4, h5, h6, .page-title, .products-widget-title,
    .step-title, .block-title, .fieldset > .legend, .opc-block-summary > .title,
    .post-title) :is(span, strong, a) {
    font-family: inherit !important;
    font-weight: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
body h1.page-title {
    font-size: clamp(28px, 2.4vw, 32px) !important;
    text-align: left !important;
}
body .block-title > strong[role="heading"] {
    font-size: clamp(21px, 2vw, 25px) !important;
    font-weight: 700 !important;
}
/* Icon-only buttons keep their dimensions; their accessible text still uses
   the same natural letter case when it is exposed. */
body button.icons-additional span { text-transform: none !important; }
/* Product names are labels, not section headings; retain their lighter weight. */
body .product-sliders-container .product_slider_item a h3 {
    font-weight: 400 !important;
}
body :is(.products-widget-title, .megango-section-heading, .post-view .post-title) {
    text-align: left !important;
    font-size: clamp(25px, 2.4vw, 32px) !important;
}
body :is(.step-title, .opc-block-summary > .title, .login-container .block-title) {
    font-size: clamp(21px, 2vw, 25px) !important;
}

/* IDs here are actual Magento CTAs: they also keep these shared rules above
   legacy theme rules without changing the existing button markup or handlers. */
body :is(#product-addtocart-button, #top-cart-btn-checkout, .action.primary,
    .action.secondary, .action-primary, .action-secondary, .action.subscribe,
    .action.update, .action.clear, .action.apply, .action.action-apply,
    .actions-toolbar .action.back, .actions-toolbar .action.cancel,
    a.more-button, .tmjs-open-modal-btn, .omniva-btn, .tmjs-select-btn,
    .tmjs-modal a.mjvp-pickup-filter.reset, #omnivaLtModal .btn-marker,
    .post-view button.btn-primary, .product-info-main .action.towishlist,
    .megango-product-description-toggle, input[type="submit"]):not(.icons-additional, .product-top .tocart, .product-item-actions .tocart)
    :is(span, strong) {
    font: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
}
body :is(#product-addtocart-button, #top-cart-btn-checkout, .action.primary,
    .action.secondary, .action-primary, .action-secondary, .action.subscribe,
    .action.update, .action.clear, .action.apply, .action.action-apply,
    .actions-toolbar .action.back, .actions-toolbar .action.cancel,
    a.more-button, .tmjs-open-modal-btn, .omniva-btn, .tmjs-select-btn,
    .tmjs-modal a.mjvp-pickup-filter.reset, #omnivaLtModal .btn-marker,
    .post-view button.btn-primary, .product-info-main .action.towishlist,
    .megango-product-description-toggle, input[type="submit"]):not(.icons-additional, .product-top .tocart, .product-item-actions .tocart) {
    box-sizing: border-box !important;
    min-height: 44px;
    max-width: 100%;
    padding: 12px 20px !important;
    border: 1px solid #ea5455 !important;
    border-radius: var(--megango-radius, 5px) !important;
    background: #ea5455 !important;
    color: #fff !important;
    font: 700 16px/1.25 "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    text-align: center;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    white-space: normal;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color .15s, border-color .15s, color .15s !important;
}
body :is(#product-addtocart-button, #top-cart-btn-checkout, .action.primary,
    .action.secondary, .action-primary, .action-secondary, .action.subscribe,
    .action.update, .action.clear, .action.apply, .action.action-apply,
    .actions-toolbar .action.back, .actions-toolbar .action.cancel,
    a.more-button, .tmjs-open-modal-btn, .omniva-btn, .tmjs-select-btn,
    .tmjs-modal a.mjvp-pickup-filter.reset, #omnivaLtModal .btn-marker,
    .post-view button.btn-primary, .product-info-main .action.towishlist,
    .megango-product-description-toggle, input[type="submit"]):not(.icons-additional, .product-top .tocart, .product-item-actions .tocart):is(:hover, :focus-visible) {
    background: #191919 !important;
    border-color: #191919 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: none !important;
}
/* Secondary actions use the outlined Back-button treatment. */
body :is(#checkout, .page-wrapper, .modal-popup) :is(.checkout-go-back,
    .action.secondary, .action-secondary, .actions-toolbar .action.back,
    .actions-toolbar .action.cancel, .action.update, .action.clear,
    .megango-product-description-toggle, .product-info-main .action.towishlist) {
    background: transparent !important;
    border-color: #ea5455 !important;
    color: #ea5455 !important;
}
body :is(#checkout, .page-wrapper, .modal-popup) :is(.checkout-go-back,
    .action.secondary, .action-secondary, .actions-toolbar .action.back,
    .actions-toolbar .action.cancel, .action.update, .action.clear,
    .megango-product-description-toggle, .product-info-main .action.towishlist):is(:hover, :focus-visible) {
    background: #ea5455 !important;
    border-color: #ea5455 !important;
    color: #fff !important;
}
body :is(#product-addtocart-button, #top-cart-btn-checkout, .action.primary,
    .action.secondary, .action-primary, .action-secondary, .tmjs-open-modal-btn,
    .omniva-btn, .tmjs-select-btn, .tmjs-modal a.mjvp-pickup-filter.reset,
    #omnivaLtModal .btn-marker, .product-info-main .action.towishlist,
    .megango-product-description-toggle):not(.icons-additional, .product-top .tocart, .product-item-actions .tocart):focus-visible {
    outline: 2px solid #ea5455 !important;
    outline-offset: 3px;
}
body :is(#product-addtocart-button, #top-cart-btn-checkout, .action.primary,
    .action.secondary, .action-primary, .action-secondary):not(.icons-additional, .product-top .tocart, .product-item-actions .tocart):disabled {
    opacity: .55;
    cursor: not-allowed;
}
/* Search belongs to an input group, not a standalone CTA. Keep its original
   geometry and only normalize the label. Category cards and social-login
   links also use .btn, so that generic class must never enter the allowlist. */
body .block-search .action.search,
body .block-search .action.search span { text-transform: none !important; }
/* Carrier map popups contain an inline 25px height from the vendor. Let the
   shared text/padding size the real select button without changing markers. */
body #omnivaLtModal .btn-marker { height: auto !important; }
body .product-info-main .action.towishlist {
    display: flex; align-items: center; justify-content: center;
    height: auto !important;
}

/* Account-entry actions are the grey secondary variant. Geometry and type
   continue to come from the shared text-button rules above. */
body.customer-account-login #maincontent :is(.customer-register-block, .customer-login-block, .customer-quest-back-block) .action:is(.primary, .secondary) {
    background: #7b7f7c !important;
    border-color: #7b7f7c !important;
    color: #fff !important;
}
body.customer-account-login #maincontent :is(.customer-register-block, .customer-login-block, .customer-quest-back-block) .action:is(.primary, .secondary):is(:hover, :focus-visible) {
    background: #ea5455 !important;
    border-color: #ea5455 !important;
    color: #fff !important;
}

/* The live newsletter uses a 5px form row gap. Double only this spacing;
   do not change subscription handlers or the hidden category preference. */
body footer.page-footer .block.newsletter .form.subscribe .actions {
    margin-top: 5px !important;
}

/* This contact panel has a pale surface, not a filled CTA background. */
body.cms-sadarbiba-un-atbalsts #maincontent .cms-custom-page section > p:last-child,
body.cms-sadarbiba-un-atbalsts #maincontent .cms-custom-page section > p:last-child :is(strong, a) {
    color: #191919 !important;
}

/* A catalogue with a sidebar is narrower than the viewport. Keep its limiter
   and sorter on separate rows before their labels can collide on tablets. */
@media (min-width: 768px) and (max-width: 1199px) {
    body #maincontent .toolbar.toolbar-products > :is(.limiter, .sorter) {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}

/* Both catalogue filter renderers are supported: legacy dt/dd pairs and
   wrapped accordion items. Keep a title attached to its expanded content. */
body #maincontent .block.filter :is(.filter-options-title, .filter-subtitle) {
    text-transform: none !important;
}
body #maincontent .block.filter .filter-options > .filter-options-content + .filter-options-title {
    margin-top: 12px !important;
}
body #maincontent .block.filter .filter-options > .filter-options-item {
    margin-bottom: 0 !important;
}
body #maincontent .block.filter .filter-options > .filter-options-item + .filter-options-item {
    margin-top: 12px !important;
}

/* The page container owns the outer gutter. Category recommendations are
   already inside it; homepage sections still retain their outer container. */
body #maincontent .category-additional-blocks > .container.product-sliders-container {
    padding-inline: 0 !important;
}
body #maincontent .product-sliders-container > .products-widget-container {
    padding-inline: 0;
}
body #maincontent .product-sliders-container .products-widget > .product-item {
    padding-inline: 0;
}
body #maincontent .product-sliders-container .products-widget > .product-item > .product-item-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
@media (max-width: 1199px) {
    body #maincontent .toolbar.toolbar-products .sorter {
        flex-wrap: wrap;
    }
    body #maincontent .toolbar.toolbar-products .sorter .megango-select {
        flex: 1 1 130px;
        min-width: 0;
        max-width: 100%;
    }
    body #maincontent .toolbar.toolbar-products .sorter .megango-select-trigger {
        min-width: 0;
        width: 100%;
    }
}
