/* ==========================================================================
   Commercers_PurchasePermission - disabled add-to-cart button

   The disabled ".purchase-restricted" button is styled per context so it keeps
   the look of the normal add-to-cart button of THAT context:
     - product detail page  -> cream pill (theme .box-tocart button)
     - category / widget grid -> full-width bar like the "out of stock" label
     - Amasty Xsearch flyout -> green pill (theme .amsearch-item button)
   ========================================================================== */

/* --- Base: shared behaviour for every context ---------------------------- */
.action.tocart.purchase-restricted,
.action.tocart.purchase-restricted:hover,
.action.tocart.purchase-restricted:active,
.action.tocart.purchase-restricted:focus,
button.purchase-restricted,
button.purchase-restricted:hover,
button.purchase-restricted:focus,
button.purchase-restricted:active {
    cursor: not-allowed !important;
    opacity: .8;
    box-shadow: none;
    transform: none;
    white-space: normal;
    line-height: 1.2;
}

.action.tocart.purchase-restricted > span,
button.purchase-restricted > span {
    display: inline-block;
    cursor: not-allowed !important;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* --- Product detail page: cream pill, matches the theme add-to-cart button - */
.box-tocart .action.tocart.purchase-restricted,
.product-add-form .action.tocart.purchase-restricted,
button#product-addtocart-button.purchase-restricted {
    display: inline-block;
    width: 100%;
    height: 70px;
    min-height: 4.8rem;
    margin: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
    background: #f3ebdd;
    border: 2px solid #f3ebdd;
    border-radius: 50px;
    color: #006747;
    font-family: 'Nirmala UI';
    font-size: 20px;
}

/* --- Category / widget grid: always visible, styled like "NICHT AUF LAGER" -
   The theme keeps ".action.tocart.primary" hidden (opacity: 0 / visibility: hidden)
   until ".product-image-wrap" is hovered. The Underberg category markup is
   <li class="item"> ... .product-item-inner .product-item-actions .actions-primary
   (NO ".product-item" class), so the override is anchored on ".products-grid" /
   ".products-list" / ".block.widget" + ".actions-primary". Every competing
   declaration is beaten with !important, and the button copies the
   ".stock.unavailable" ("NICHT AUF LAGER") bar. ------------------------------- */
.products-grid .actions-primary .action.tocart.purchase-restricted,
.products-list .actions-primary .action.tocart.purchase-restricted,
.block.widget .actions-primary .action.tocart.purchase-restricted,
.product-image-wrap .product-item-inner .action.tocart.purchase-restricted {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 5px 0 10px !important;
    border: none !important;
    border-radius: 10px !important;
    background: #f3ebdd !important;
    color: #006747 !important;
    box-shadow: none !important;
    font-family: "Rockwell Bold" !important;
    font-size: 18px !important;
    font-weight: normal !important;
    line-height: 2 !important;
    letter-spacing: normal !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    transition: none !important;
}

.products-grid .actions-primary .action.tocart.purchase-restricted:hover,
.products-grid .actions-primary .action.tocart.purchase-restricted:focus,
.products-grid .actions-primary .action.tocart.purchase-restricted:active,
.products-list .actions-primary .action.tocart.purchase-restricted:hover,
.block.widget .actions-primary .action.tocart.purchase-restricted:hover,
.product-image-wrap:hover .action.tocart.purchase-restricted {
    visibility: visible !important;
    opacity: 1 !important;
    background: #f3ebdd !important;
    color: #006747 !important;
    border: none !important;
}

.products-grid .actions-primary .action.tocart.purchase-restricted > span,
.products-list .actions-primary .action.tocart.purchase-restricted > span,
.block.widget .actions-primary .action.tocart.purchase-restricted > span {
    font-family: "Rockwell Bold" !important;
    text-transform: uppercase !important;
    white-space: normal !important;
}

/* --- Amasty Xsearch flyout: green pill, matches the flyout add-to-cart ---- */
.amsearch-products-section .action.tocart.purchase-restricted,
.amsearch-product-list .action.tocart.purchase-restricted,
.amsearch-item .action.tocart.purchase-restricted {
    height: auto;
    min-height: 35px;
    margin: 0;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: #006747;
    color: #fff;
    font-family: inherit;
    font-size: 1.2rem;
    line-height: 1.2;
    text-transform: none;
    white-space: normal;
}

.amsearch-products-section .action.tocart.purchase-restricted:hover,
.amsearch-products-section .action.tocart.purchase-restricted:focus,
.amsearch-item .action.tocart.purchase-restricted:hover,
.amsearch-item .action.tocart.purchase-restricted:focus {
    background: #006747;
    color: #fff;
    opacity: .8;
}

