/* Header mini-cart only. Native WooCommerce widgets elsewhere keep their styles. */
.ft-header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.ft-header-cart .ft-cart-toggle[aria-expanded="true"] {
    color: var(--orange, #ff650b);
}

.ft-header-cart .ft-mini-cart {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 65;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 390px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - var(--ft-mini-cart-top, 145px) - 16px);
    max-height: calc(100dvh - var(--ft-mini-cart-top, 145px) - 16px);
    margin: 0;
    padding: 22px;
    border: 1px solid #474b46;
    border-top: 3px solid var(--orange, #ff650b);
    border-radius: 3px;
    background: var(--panel, #1b1d1d);
    color: var(--paper, #f0f0ec);
    font-family: var(--font, Arial, sans-serif);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 18px 60px #0008;
}

.ft-header-cart .ft-mini-cart[hidden] {
    display: none !important;
}

/* Keep a continuous pointer path between the trigger and the dropdown. */
.ft-header-cart .ft-mini-cart::before {
    content: "";
    position: absolute;
    top: -17px;
    right: 0;
    left: 0;
    height: 17px;
    background: transparent;
}

.ft-header-cart .ft-mini-cart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    margin: 0 0 5px;
}

.ft-header-cart .ft-mini-cart-heading h2 {
    margin: 0;
    color: var(--paper, #f0f0ec);
    font-family: var(--font, Arial, sans-serif);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}

.ft-header-cart .ft-mini-cart-heading .ft-mini-cart-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 9px;
    border: 1px solid var(--line, #343635);
    border-radius: 3px;
    background: transparent;
    color: var(--muted, #a6a7a4);
}

.ft-header-cart .ft-mini-cart-heading .ft-mini-cart-close:hover {
    border-color: var(--orange, #ff650b);
    color: var(--orange, #ff650b);
}

.ft-header-cart .ft-mini-cart .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 320px;
    width: 100%;
    margin: 0;
    padding: 0 3px 0 0;
    border: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #565c53 transparent;
    list-style: none;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li {
    position: relative;
    display: block;
    box-sizing: border-box;
    min-height: 97px;
    margin: 0;
    padding: 18px 38px 18px 75px;
    border: 0;
    border-bottom: 1px solid var(--line, #343635);
    background: transparent;
    color: var(--paper, #f0f0ec);
    font-size: 14px;
    line-height: 1.5;
    list-style: none;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li:last-child {
    border-bottom: 0;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li > a:not(.remove) {
    display: block;
    margin: 0 0 7px;
    padding: 0;
    color: var(--paper, #f0f0ec);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li > a:not(.remove):hover {
    color: var(--orange, #ff650b);
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li img {
    position: absolute;
    top: 18px;
    left: 0;
    float: none;
    box-sizing: border-box;
    width: 60px;
    max-width: 60px;
    height: 60px;
    margin: 0;
    padding: 4px;
    border: 0;
    border-radius: 2px;
    background: #fff;
    object-fit: contain;
    box-shadow: none;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li a.remove {
    position: absolute;
    top: 18px;
    right: 0;
    left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid #494e47;
    border-radius: 3px;
    background: transparent;
    /* WooCommerce sets the global remove-link color with !important. */
    color: var(--muted, #a6a7a4) !important;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget li a.remove:hover {
    border-color: #cc786a;
    background: #37231f;
    color: #ffc6bc !important;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget .quantity {
    display: block;
    color: var(--muted, #a6a7a4);
    font-size: 13px;
    line-height: 1.5;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget .quantity .amount {
    color: var(--orange, #ff650b);
    font-weight: 600;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget dl.variation {
    margin: 6px 0;
    padding: 0;
    border: 0;
    color: var(--muted, #a6a7a4);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget dl.variation dt,
.ft-header-cart .ft-mini-cart ul.product_list_widget dl.variation dd {
    margin-bottom: 3px;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget dl.variation p {
    margin: 0;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0 0;
    padding: 17px 0 0;
    border: 0;
    border-top: 1px solid var(--line, #343635);
    color: var(--paper, #f0f0ec);
    font-size: 14px;
    line-height: 1.4;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__total strong {
    font-weight: 500;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__total .amount {
    color: var(--orange, #ff650b);
    font-size: 21px;
    font-weight: 700;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-shrink: 0;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
}

/* WooCommerce's float clearfix must not become extra cells in this grid. */
.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons::before,
.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons::after {
    content: none;
    display: none;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 10px;
    border: 1px solid #5b6157;
    border-radius: 3px;
    background: transparent;
    color: var(--paper, #f0f0ec);
    font-family: var(--font, Arial, sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons a.button:hover {
    border-color: var(--orange, #ff650b);
    color: var(--orange, #ff650b);
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons a.checkout {
    border-color: var(--orange, #ff650b);
    background: var(--orange, #ff650b);
    color: var(--ink, #121313);
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons a.checkout:hover {
    border-color: var(--orange-hover, #ff7a2d);
    background: var(--orange-hover, #ff7a2d);
    color: var(--ink, #121313);
}

.ft-header-cart .ft-mini-cart .woocommerce-mini-cart__empty-message {
    margin: 0;
    padding: 27px 8px 23px;
    color: var(--muted, #a6a7a4);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.ft-header-cart .ft-mini-cart :is(a, button):focus-visible {
    outline: 2px solid var(--orange, #ff650b);
    outline-offset: 3px;
}

.ft-header-cart .ft-mini-cart ul.product_list_widget a:focus-visible {
    outline-offset: 1px;
}

@media (max-width: 600px) {
    .ft-header-cart .ft-mini-cart {
        position: fixed;
        top: var(--ft-mini-cart-top, 145px);
        right: 14px;
        left: 14px;
        width: auto;
        max-width: none;
        padding: 18px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ft-header-cart .ft-mini-cart::before {
        content: none;
    }

    .ft-header-cart .ft-mini-cart-heading h2 {
        font-size: 20px;
    }

    .ft-header-cart .ft-mini-cart ul.product_list_widget {
        max-height: 300px;
    }

    .ft-header-cart .ft-mini-cart .woocommerce-mini-cart__buttons {
        gap: 8px;
    }
}
