/* Ensure mini-cart drawer content is visible */
.wc-block-mini-cart__drawer {
    visibility: visible !important;
    opacity: 1 !important;
}

.wc-block-components-drawer__content {
    display: block !important;
    visibility: visible !important;
    overflow-x: hidden;
}

.wc-block-components-drawer {
    overflow-x: hidden;
}

.wp-block-woocommerce-mini-cart-contents {
    overflow-x: hidden;
}

.wc-block-mini-cart__template-part {
    display: block !important;
}

.wp-block-woocommerce-mini-cart-contents {
    display: block !important;
    padding: 0;
    color: var(--wp--preset--color--foreground);
    background: var(--wp--preset--color--background);
}

/* Prevent large empty gaps above items caused by space distribution in the
   filled mini-cart wrapper on some pages (blog/tracking). */
.wp-block-woocommerce-filled-mini-cart-contents-block {
    justify-content: flex-start;
    min-height: 0;
}

.wc-block-mini-cart__items {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.wc-block-mini-cart__footer {
    margin-top: auto;
}

/* Don't let the close-wrapper add vertical space; the close button should
   float above the drawer content (as in default Woo blocks styles). */
.wp-block-woocommerce-mini-cart-contents .wc-block-components-drawer__close-wrapper {
    padding: 0;
    border: 0;
    height: 0;
}

.wp-block-woocommerce-mini-cart-contents .wc-block-components-button.wc-block-components-drawer__close {
    position: absolute !important;
    top: 12px;
    right: 12px;
    margin: 0 !important;
    opacity: 0.7;
    z-index: 3;
}

.wp-block-woocommerce-mini-cart-contents .wc-block-components-button.wc-block-components-drawer__close:hover {
    opacity: 1;
}

/* Ensure mini-cart container can contain the absolute close button. */
.wp-block-woocommerce-mini-cart-contents {
    position: relative !important;
}

h2.wc-block-mini-cart__title,
.wc-block-mini-cart__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    padding: 20px 20px 20px 20px;
    padding-top: 44px;
    border-bottom: 1px solid var(--wp--preset--color--tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.wc-block-mini-cart__items {
    overflow-y: auto;
    padding: 15px 0;
}


.wc-block-cart-items {
    width: 100%;
    font-size: 14px;
}

.wc-block-cart-items__row {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid var(--wp--preset--color--tertiary);
}

.wc-block-cart-item__image {
    width: 100%;
    height: auto;
}

.wc-block-cart-item__image img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.wc-block-cart-item__image a {
    display: block;
    text-decoration: none;
}

.wc-block-cart-item__product {
    width: 100%;
    margin-top: 12px;
}

.wc-block-cart-item__wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lithos-mini-cart-item__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.lithos-mini-cart-item__subtotal {
    white-space: nowrap;
}

.wc-block-components-product-name {
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    font-weight: 600;
}

.wc-block-components-product-name:hover {
    text-decoration: underline;
}

.wc-block-cart-item__prices {
    font-weight: 600;
}

.wc-block-components-product-metadata__description {
    font-size: 13px;
    color: var(--wp--preset--color--secondary);
    margin: 0;
}

.wc-block-components-product-metadata__description p {
    margin: 0;
}

.wc-block-cart-item__quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wc-block-components-quantity-selector {
    display: flex;
    gap: 5px;
    align-items: center;
}

.wc-block-components-quantity-selector__input {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--wp--preset--color--tertiary);
    text-align: center;
}

.wc-block-components-quantity-selector__button {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--wp--preset--color--tertiary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-block-components-quantity-selector__button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
}

.wc-block-components-quantity-selector__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wc-block-cart-item__remove-link {
    background: none;
    border: none;
    color: var(--wp--preset--color--secondary);
    cursor: pointer;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.wc-block-cart-item__remove-link:hover {
    opacity: 0.8;
}


.wc-block-cart-item__total {
    display: none;
}

.wc-block-mini-cart__footer {
    padding: 20px;
    border-top: 1px solid var(--wp--preset--color--tertiary);
}

.wc-block-components-totals-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.wc-block-components-totals-item__label {
    font-weight: 600;
    font-size: 16px;
}

.wc-block-components-totals-item__value {
    font-weight: 700;
    font-size: 16px;
}

.wc-block-components-totals-item__description {
    font-size: 12px;
    color: var(--wp--preset--color--secondary);
}

.wc-block-mini-cart__footer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wc-block-components-button {
    display: inline-block;
    padding: 12px 20px;
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
    text-decoration: none;
    border: 1px solid var(--wp--preset--color--foreground);
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.wc-block-components-button.outlined {
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--foreground);
    border: 1px solid var(--wp--preset--color--foreground);
}

.wc-block-components-button.contained {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--background);
}

.wc-block-components-button:hover {
    opacity: 0.8;
}

.wc-block-components-button__text {
    display: block;
}

.has-text-align-center {
    text-align: center !important;
}

.wc-block-mini-cart__empty-cart-wrapper {
    padding: 40px 20px;
    text-align: center;
}

.wc-block-mini-cart__empty-cart-wrapper p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

table caption {
    display: none;
}
