/* La Halle overrides for the Commerce Client widget. Loaded after commerceClient.css
   by cimulate/lhaCommerceClient.isml. Kept out of the ISML on purpose: ISML reads text
   between two '#' characters as an expression, so hex colours there break compilation. */

/* The widget gives the cart summary toggle no focus style, so the browser's
   default blue ring shows on click. Use the La Halle pink instead. */
.cim-widget-cart-summary:focus {
    outline: none;
    box-shadow: none;
}

.cim-widget-cart-summary:focus-visible {
    outline: 2px solid #E81F76;
    outline-offset: -2px;
    border-radius: inherit;
}

/* Message input: a single border around the input only, pink on focus.
   The widget nests two elements that both carry
   .cim-widget-messaging-input-group's border: the inner group (input) and
   the composer group (input + send button), which draws a double border.
   Drop the composer group's border, the input's own border and the
   browser's focus ring. */
.cim-widget-messaging-composer-group {
    border: 0 !important;
    box-shadow: none !important;
}

.cim-widget-messaging-input-group:not(.cim-widget-messaging-composer-group):focus-within {
    border-color: #E81F76 !important;
    box-shadow: none !important;
}

.cim-widget-messaging-input-group input.cim-widget-search-input,
.cim-widget-messaging-input-group input.cim-widget-search-input:focus,
.cim-widget-messaging-input-group input.cim-widget-search-input:focus-visible {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ProductTile override (js/lhaCommerceClientOverrides.js). Custom elements are inline by
   default; let the override and the widget's wrapper fill the carousel item, as the
   widget's own tile does. */
.cim-widget-product-carousel-item > [data-override="ProductTile"] {
    flex: 1;
}

lha-product-tile {
    display: block;
    height: 100%;
}

/* A tile the agent sent without product data (no name, no image) would show only the
   product ID. Hide its carousel slide; the tile marks itself data-lha-empty. */
.cim-widget-carousel__item:has(lha-product-tile[data-lha-empty]) {
    display: none;
}

/* Prices in the site's format, 11€<sup>49</sup>, sized like the cents
   lhaCommerceClientI18n.js raises elsewhere in the widget. */
[data-lha-price] sup {
    font-size: 60%;
    position: relative;
    top: -0.6em;
    line-height: 0;
    vertical-align: baseline;
}

/* Links in the agent's messages render as <a class="cim-widget-link">. The widget
   colours them on hover with the theme's secondary colour, a pale pink that is
   unreadable. Keep the La Halle pink and darken it on hover instead. */
.cim-widget-link,
.cim-widget-link:visited {
    color: #E81F76 !important;
    text-decoration: underline;
}

.cim-widget-link:hover,
.cim-widget-link:focus {
    color: #A3124F !important;
    text-decoration: underline;
}

/* On phones the product page pins its buttons to the bottom of the screen and the
   widget's launcher button sits on top of them. Lift the launcher above that bar on
   product pages (productDetails.isml's .product-detail.product-wrapper). The bar is one
   or two buttons high depending on the site, so cimulate/lhaCommerceClient.isml measures
   it into --lha-cc-launcher-lift; 90px until then. transform moves the launcher whether
   the widget positions the container or the button itself. */
@media (max-width: 767.98px) {
    body:has(.product-detail.product-wrapper) .cim-widget-minimized-container {
        transform: translateY(calc(-1 * var(--lha-cc-launcher-lift, calc(90px + env(safe-area-inset-bottom, 0px)))));
    }
}
