/*
 * Automatic.css variables used below carry fallbacks, so this looks the same
 * on a site without Automatic.css. Where Automatic.css is present its values
 * win and nothing changes; the fallbacks are one such site's values, with the
 * brand colour taken from MS Tours' own setting.
 */
/* =========================================================
   SOURCE: MS Tours - Cart Drawer
   ========================================================= */


/* =========================================================
   MS TOURS — CART DRAWER
   ========================================================= */

.ms-cart-drawer {
    display: flex;
    gap: 0;
    width: 100%;
    line-height: 1;
    flex-grow: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    font-size: var(--text-xs, 0.875rem);
    position: relative;
}

.ms-cart-has-items {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    gap: 0;
}

/* =========================================================
   UNBOOKABLE
   ========================================================= */

.is-unbookable::after {
    content: "";
    position: absolute;
    z-index: 1;
    background: var(--danger-ultra-light, #fbe9eb);
    inset: 0;
    border-radius: var(--radius, 8px);
    border: 2px solid var(--danger, #dc3545);
    mix-blend-mode: multiply;
}

/*
 * Available to assistive technology, invisible on screen. The red overlay above
 * carries no text, so this is the only thing that tells a screen reader user
 * which items the warning refers to.
 */
.ms-cart-item-issue-note {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/*
 * Hidden until the cart actually has a problem.
 *
 * The warning lives in a Bricks template, so the plugin cannot render it with a
 * hidden attribute. Without this it painted on every cart and checkout load and
 * was then hidden by script, producing a visible flash of a warning that did not
 * apply. The body class is written server-side, so the very first frame is right.
 */
body:not(.ms-cart-has-issues) .ms-cart-has-booking-issues {
    display: none !important;
}

.ms-cart-has-booking-issues {
    margin-inline: var(--space-xs, 0.85rem);
    width: calc(100% - var(--space-xs, 0.85rem) - var(--space-xs, 0.85rem));
    background: var(--danger-ultra-light, #fbe9eb);
    border: 2px solid var(--danger, #dc3545);
    border-radius: var(--radius, 8px);
    padding: var(--space-xs, 0.85rem);
    font-size: 12px;
    display: flex;
    gap: calc(var(--space-xs, 0.85rem)/2);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.ms-cart-has-booking-issues[hidden] {
    display: none!important;
}

.ms-cart-checkout.is-disabled {
    cursor: not-allowed;
    opacity: 0.42;
}


/* =========================================================
   HEADER
   ========================================================= */

.ms-cart-drawer__header {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xs, 0.85rem);
    padding: var(--space-s, 1.25rem);
    border-bottom: 1px solid var(--neutral-light, #d9d9d9);
    width: 100%;
    flex: 0 0 auto;
    background: var(--white, #fff);
    box-shadow: 0px 5px 5px var(--neutral-trans-10, rgba(0, 0, 0, 0.1));
    z-index: 2;
}

.ms-cart-drawer__heading {
    display: flex;
    flex-direction: row;
    gap: var(--space-xs, 0.85rem);
    align-items: center;
    line-height: 1 !important;
    height: 40px;
}

.ms-cart-drawer__heading h3 {
    margin: 0;
}

.ms-cart-drawer__count {
    display: flex;
    align-items: center;
    color: var(--neutral-semi-dark, #595959);
}

.ms-cart-bookings-count {
    font-weight: 700;
}


/* =========================================================
   CART LIST
   ========================================================= */

.ms-cart-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs, 0.85rem);
    padding: var(--space-s, 1.25rem);
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
}

/*
 * Pending state while the exact Bricks markup is being fetched.
 *
 * The drawer opens as soon as the booking modal has closed, without waiting
 * for that request, so for a moment the list can still be showing the cart as
 * it was a second ago. Dimming it and disabling pointer events makes the wait
 * legible and stops anyone acting on a row that is about to be replaced.
 */
.ms-cart-list.is-refreshing {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 120ms ease-out;
}

.ms-cart-list.is-refreshing::after {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: 2px;
    border-radius: 2px;
    background-color: currentColor;
    opacity: 0.35;
    animation: ms-cart-refreshing 900ms ease-in-out infinite;
}

@keyframes ms-cart-refreshing {
    0%   { transform: scaleX(0);   transform-origin: left center; }
    50%  { transform: scaleX(1);   transform-origin: left center; }
    100% { transform: scaleX(0);   transform-origin: right center; }
}

@media (prefers-reduced-motion: reduce) {
    .ms-cart-list.is-refreshing::after { animation: none; }
}


/* =========================================================
   CART ITEM
   ========================================================= */

.ms-cart-item {
    position: relative;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0px;
    background: var(--neutral-ultra-light, #f2f2f2);
    border-radius: var(--radius, 8px);
}

.ms-cart-item__img-wrapper img {
    border-radius: var(--radius, 8px) 0 0 var(--radius, 8px) !important;
}


/* =========================================================
   ITEM CONTENT
   ========================================================= */

.ms-cart-item__content {
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: var(--space-xs, 0.85rem);
    flex-direction: column;
    gap: calc(var(--space-xs, 0.85rem)/2);
}


/* =========================================================
   TOUR TITLE
   ========================================================= */

.ms-cart-item__title {
    margin: 0;
    font-weight: 700;
    font-size: var(--text-m, 1.125rem)!important;
    line-height: 1!important;
    margin-bottom: auto;
}


/* =========================================================
   REMOVE BUTTON
   ========================================================= */

.ms-cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;

    flex: 0 0 auto;

    padding: 6px;

    border: 0;
    border-radius: var(--radius, 8px);

    background: transparent;
    color: var(--neutral, #000);

    cursor: pointer;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.ms-cart-remove:hover {
    background: var(--danger, #dc3545);
    color: var(--white, #fff);
}


/* If you're using a Bricks Icon inside it */

.ms-cart-remove svg {
    width: 18px;
    height: 18px;
}


/* =========================================================
   DATE + TIME
   ========================================================= */

.ms-cart-item__datetime {
    font-weight: 700;
}


/* =========================================================
   DURATION + PEOPLE
   ========================================================= */

.ms-cart-item__facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5ch;
}

.ms-cart-item__duration,
.ms-cart-item__people {
    display: inline-flex;
    align-items: center;
}

.ms-cart-item__duration:not(:empty)::after {
    content: "•";
    margin-left: 0.5ch;
}

.ms-tour-people-row.is-disabled {
    opacity: .42;
    cursor: not-allowed !important;
}

.ms-tour-people-row.is-disabled * {
    cursor: not-allowed !important;
}


/* Don't show separator when duration is empty */

.ms-cart-item__duration:empty {
    display: none;
}


/* =========================================================
   PICKUP
   ========================================================= */

.ms-cart-item__pickup {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.ms-cart-item__pickup-label {
    font-weight: 700;
}


/* Hide completely empty dynamic fields */

.ms-cart-item__datetime:empty,
.ms-cart-item__pickup-detail:empty {
    display: none;
}


/* =========================================================
   ITEM PRICE
   ========================================================= */

.ms-cart-item__price {
    font-weight: 700;
    color: var(--white, #fff);
    font-size: var(--text-s, 0.9375rem);
}


/* =========================================================
   CART SUMMARY
   ========================================================= */

.cart-footer {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 18px;
    padding-top: var(--space-xs, 0.85rem);
    background: var(--white, #fff);
    border-top: 1px solid var(--neutral-light, #d9d9d9);
    box-shadow: 0px -5px 5px var(--neutral-trans-10, rgba(0, 0, 0, 0.1));
    z-index: 2;
    flex: 0 0 auto;
}

.ms-cart-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs, 0.85rem);
    padding-inline: var(--space-s, 1.25rem);
}

.ms-cart-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs, 0.85rem);
}

.ms-cart-summary__row > :last-child {
    flex: 0 0 auto;
}

.ms-cart-summary__total {
    padding-top: var(--space-xs, 0.85rem);
    border-top: 1px solid var(--neutral-light, #d9d9d9);
}

.ms-cart-summary__total strong {
    font-weight: 700;
}

/* =========================================================
   CART FOOTER
   ========================================================= */

.ms-cart-checkout__wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs, 0.85rem);
    padding: var(--space-s, 1.25rem);
    padding-top: 0;
}

/* =========================================================
   EMPTY CART
   ========================================================= */

/*
 * Important:
 * Some Bricks/global CSS can override the HTML hidden attribute.
 */

.ms-cart-empty[hidden],
.ms-cart-has-items[hidden],
[hidden].ms-cart-empty,
[hidden].ms-cart-has-items {
    display: none !important;
}

.ms-cart-empty__icon {
    width: var(--space-xxl, 6rem);
    height: var(--space-xxl, 6rem);
    color: var(--white, #fff);
}

.ms-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: var(--text-l, 1.5rem);
    height: 100%;
    width: 100%;
    gap: var(--space-s, 1.25rem);
    padding: 40px 20px;
    text-align: center;
    background: var(--neutral-ultra-light, #f2f2f2);
}


/* =========================================================
   LOADING / REMOVING STATE
   ========================================================= */

.ms-cart-item.is-removing {
    pointer-events: none;
    opacity: 0.42;
}

.ms-cart-remove.is-loading {
    pointer-events: none;
    opacity: 0.42;
}

/* =========================================================
   COMPACT CART ITEM — SINGLE LINE / TRUNCATION
   ========================================================= */


/* Prevent content from forcing the card wider */

.ms-cart-item__content {
    overflow: hidden;
}


/* Tour title: always one line */

.ms-cart-item__title {
    width: 100%;
    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    /* Keep title clear of remove button */
    padding-right: 25px;
}


/* Date + time: always one line */

.ms-cart-item__datetime {
    width: 100%;
    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* Duration + people: never wrap */

.ms-cart-item__facts {
    width: 100%;
    min-width: 0;

    flex-wrap: nowrap;

    overflow: hidden;

    white-space: nowrap;
}


/*
 * Duration is allowed to truncate first.
 * People stays fully visible.
 */

.ms-cart-item__duration {
    flex: 0 1 auto;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.ms-cart-item__people {
    flex: 0 0 auto;

    white-space: nowrap;
}


/* =========================================================
   PICKUP + PICKUP DETAIL ON ONE LINE
   ========================================================= */

.ms-cart-item__pickup {
    width: 100%;
    min-width: 0;

    align-items: center;

    overflow: hidden;

    white-space: nowrap;
}


/*
 * Hide "Pickup:" to save horizontal space.
 */

.ms-cart-item__pickup-label {
    display: none;
}


/*
 * Pickup location.
 *
 * Add the class:
 * ms-cart-item__pickup-value
 *
 * to the Bricks element containing {ms_cart_pickup}.
 */

.ms-cart-item__pickup-value {
    flex: 0 1 auto;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/*
 * Pickup detail stays on the same line.
 */

.ms-cart-item__pickup-detail {
    flex: 1 1 auto;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* Add separator only when pickup detail exists */

.ms-cart-item__pickup-detail:not(:empty)::before {
    content: "•";

    margin-right: 5px;

    color: #b5b5b5;
}


/* Existing empty behavior */

.ms-cart-item__pickup-detail:empty {
    display: none;
}

/* =========================================================
   WOOCOMMERCE NOTICE — DISMISS BUTTON
   v0.9.7

   Uses the Lucide X SVG already uploaded to WordPress:
   /wp-content/uploads/2026/08/x-1.svg
   ========================================================= */

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    position: relative;
    padding-right: 48px !important;
}

.ms-wc-notice-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    padding: 0;

    border: 0;
    border-radius: var(--radius, 6px);

    background: transparent;
    color: currentColor;

    font-size: 0;
    line-height: 0;

    cursor: pointer;
    opacity: 0.65;

    transition:
        opacity 0.2s ease,
        background-color 0.2s ease;
}

.ms-wc-notice-dismiss::before {
    content: "";

    display: block;
    width: 18px;
    height: 18px;

    background-color: currentColor;

    -webkit-mask-image: url("/wp-content/uploads/2026/08/x-1.svg");
    mask-image: url("/wp-content/uploads/2026/08/x-1.svg");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: contain;
    mask-size: contain;
}

.ms-wc-notice-dismiss:hover {
    opacity: 1;
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.ms-wc-notice-dismiss:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Collapse Bricks' Notice element when its last notice is dismissed. */
.woocommerce-notices-wrapper[hidden],
.brxe-woocommerce-notice[hidden] {
    display: none !important;
}


/* v0.29.4: New rows are always rendered by the real Bricks query loop. */

/* v0.33 — visible keyboard focus + reduced motion */
.ms-cart-item :where(a, button, input, select):focus-visible,
[data-ms-checkout]:focus-visible,
[data-ms-remove-unbookable]:focus-visible,
.ms-wc-notice-dismiss:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary, #37c8bd) 50%, transparent) !important;
    outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
    .ms-cart-item *,
    .ms-cart-item *::before,
    .ms-cart-item *::after,
    .ms-wc-notice-dismiss {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.ms-tours-cart-announcer {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
