/* GoPeter Cart Display Tweaks
 * Targets WooCommerce mini-cart / Elementor menu cart / side-cart metadata only.
 * Does not affect product page logic, pricing, validation, cart calculation, cart page, or checkout page.
 */

/* Elementor side cart: avoid nested double-scrollbars where possible. */
.elementor-menu-cart__container,
.elementor-menu-cart__main,
.elementor-menu-cart__wrapper,
.elementor-menu-cart__products {
    scrollbar-width: auto;
}

.elementor-menu-cart__main {
    max-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.elementor-menu-cart__products {
    max-height: none !important;
    overflow: visible !important;
}

/* Keep footer/buttons stable and readable. */
.elementor-menu-cart__footer-buttons,
.elementor-menu-cart__subtotal,
.widget_shopping_cart_content .woocommerce-mini-cart__total,
.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    flex-shrink: 0 !important;
}

/* Product rows: give text enough usable width. */
.elementor-menu-cart__product,
.woocommerce-mini-cart .mini_cart_item,
.widget_shopping_cart_content .mini_cart_item {
    min-width: 0 !important;
    overflow: visible !important;
}

.elementor-menu-cart__product-name,
.elementor-menu-cart__product-price,
.elementor-menu-cart__product .variation,
.elementor-menu-cart__product .wc-item-meta,
.woocommerce-mini-cart .variation,
.woocommerce-mini-cart .wc-item-meta,
.widget_shopping_cart_content .variation,
.widget_shopping_cart_content .wc-item-meta {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

/* Metadata containers. */
.woocommerce-mini-cart .variation,
.woocommerce-mini-cart .wc-item-meta,
.elementor-menu-cart__product .variation,
.elementor-menu-cart__product .wc-item-meta,
.elementor-menu-cart__products .variation,
.elementor-menu-cart__products .wc-item-meta,
.widget_shopping_cart_content .variation,
.widget_shopping_cart_content .wc-item-meta {
    display: block !important;
    width: 100% !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    clear: both !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    text-align: left !important;
}

/* Definition-list format used by Woo mini-cart. */
.woocommerce-mini-cart .variation dt,
.woocommerce-mini-cart .variation dd,
.elementor-menu-cart__product .variation dt,
.elementor-menu-cart__product .variation dd,
.elementor-menu-cart__products .variation dt,
.elementor-menu-cart__products .variation dd,
.widget_shopping_cart_content .variation dt,
.widget_shopping_cart_content .variation dd {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.woocommerce-mini-cart .variation dt,
.elementor-menu-cart__product .variation dt,
.elementor-menu-cart__products .variation dt,
.widget_shopping_cart_content .variation dt {
    font-weight: 700 !important;
    margin-top: 5px !important;
}

.woocommerce-mini-cart .variation dd,
.elementor-menu-cart__product .variation dd,
.elementor-menu-cart__products .variation dd,
.widget_shopping_cart_content .variation dd {
    margin-bottom: 3px !important;
}

.woocommerce-mini-cart .variation dd p,
.elementor-menu-cart__product .variation dd p,
.elementor-menu-cart__products .variation dd p,
.widget_shopping_cart_content .variation dd p {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* List format used by wc-item-meta. */
.woocommerce-mini-cart .wc-item-meta li,
.elementor-menu-cart__product .wc-item-meta li,
.elementor-menu-cart__products .wc-item-meta li,
.widget_shopping_cart_content .wc-item-meta li {
    display: block !important;
    width: 100% !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.woocommerce-mini-cart .wc-item-meta li strong,
.elementor-menu-cart__product .wc-item-meta li strong,
.elementor-menu-cart__products .wc-item-meta li strong,
.widget_shopping_cart_content .wc-item-meta li strong {
    display: block !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.woocommerce-mini-cart .wc-item-meta li p,
.elementor-menu-cart__product .wc-item-meta li p,
.elementor-menu-cart__products .wc-item-meta li p,
.widget_shopping_cart_content .wc-item-meta li p {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide empty product-price line after PHP removes 1 x R0,00. */
.elementor-menu-cart__product-price:empty,
.woocommerce-mini-cart .quantity:empty,
.widget_shopping_cart_content .quantity:empty {
    display: none !important;
}

/* Prevent aggressive theme/elementor word breaking inside side-cart only. */
.elementor-menu-cart__product *,
.woocommerce-mini-cart .mini_cart_item *,
.widget_shopping_cart_content .mini_cart_item * {
    word-break: normal !important;
    hyphens: none !important;
}


/* v0.1.2: Side-cart quick-reference layout only. */
.elementor-menu-cart__container .elementor-menu-cart__main {
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.elementor-menu-cart__container .elementor-menu-cart__products {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 4px !important;
}

.elementor-menu-cart__container .elementor-menu-cart__subtotal,
.elementor-menu-cart__container .elementor-menu-cart__footer-buttons {
    flex: 0 0 auto !important;
}

.elementor-menu-cart__container .elementor-menu-cart__product-price[aria-hidden="true"],
.elementor-menu-cart__container .quantity[aria-hidden="true"] {
    display: none !important;
}

.elementor-menu-cart__container .variation,
.elementor-menu-cart__container .wc-item-meta,
.elementor-menu-cart__container .elementor-menu-cart__product .variation,
.elementor-menu-cart__container .elementor-menu-cart__product .wc-item-meta {
    font-size: 11px !important;
    line-height: 1.25 !important;
}

.elementor-menu-cart__container .variation dt,
.elementor-menu-cart__container .wc-item-meta strong {
    margin-top: 4px !important;
}
