/**
 * Cart Item Component
 *
 * @package Hafo\Checkout
 * @version 1.0.0
 */

.hafo-cart-wrapper {
    border: 1px solid var(--hafo-checkout-border);
    border-radius: var(--hafo-checkout-radius-lg);
    padding: var(--hafo-checkout-spacing-lg);
}

.hafo-cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: var(--hafo-checkout-spacing-sm);
    align-items: start;
    padding: var(--hafo-checkout-spacing-sm);
    background-color: var(--hafo-checkout-secondary);
    border-bottom: 1px solid var(--hafo-checkout-border);
    position: relative;
    margin-bottom: var(--hafo-checkout-spacing-2xl);
}

.hafo-cart-item__image {
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: var(--hafo-checkout-radius-md);
    border: 1px solid var(--hafo-checkout-border);
    padding: 8px;
}

.hafo-cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hafo-cart-item__details {
    display: flex;
    flex-direction: column;
    gap: var(--hafo-checkout-spacing-sm);
}

.hafo-cart-item__title {
    margin: 0;
    font-size: var(--hafo-checkout-font-size-lg);
    font-weight: var(--hafo-checkout-font-weight-bold);
    line-height: var(--hafo-checkout-line-height-xs) !important;
    color: var(--hafo-checkout-title-color) !important;

}

.hafo-cart-item__title a {
    color: var(--hafo-checkout-title-color) !important;
    text-decoration: none;
}

.hafo-cart-item__title a:hover {
    text-decoration: underline;
}

.hafo-cart-item__description {
    font-size: var(--hafo-checkout-font-size-sm);
    color: var(--hafo-checkout-text-light);
    line-height: 1.5;
}

.hafo-cart-item__quantity {
    display: flex;
    align-items: center;
    gap: var(--hafo-checkout-spacing-sm);
    margin-top: var(--hafo-checkout-spacing-sm);
}

.hafo-cart-item__quantity-label {
    font-size: var(--hafo-checkout-font-size-sm);
    font-weight: var(--hafo-checkout-font-weight-light);
    color: var(--hafo-checkout-text-light);
}

.hafo-quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--hafo-checkout-border);
    border-radius: var(--hafo-checkout-radius-sm);
    overflow: hidden;
}

.hafo-quantity-input__button {
    width: 36px;
    height: 36px;
    border: none;
    background-color: var(--hafo-checkout-secondary);
    color: var(--hafo-checkout-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hafo-checkout-font-size-lg);
    font-weight: var(--hafo-checkout-font-weight-bold);
    transition: var(--hafo-checkout-transition);
}

.hafo-quantity-input__button:hover {
    background-color: var(--hafo-checkout-background);
}

.hafo-quantity-input__button:focus-visible {
    outline: 2px solid var(--hafo-checkout-primary);
    outline-offset: -2px;
}

.hafo-quantity-input__field {
    width: 60px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--hafo-checkout-border);
    border-right: 1px solid var(--hafo-checkout-border);
    text-align: center;
    font-size: var(--hafo-checkout-font-size-base);
    font-weight: var(--hafo-checkout-font-weight-medium);
    appearance: textfield;
}

.hafo-quantity-input__field::-webkit-outer-spin-button,
.hafo-quantity-input__field::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.hafo-quantity-input__field:focus-visible {
    outline: 2px solid var(--hafo-checkout-primary);
    outline-offset: -2px;
}

.hafo-cart-item__price {
    font-size: var(--hafo-checkout-font-size-lg);
    font-weight: var(--hafo-checkout-font-weight-bold);
    color: var(--hafo-checkout-title-color);
    text-align: right;
}

.hafo-cart-item__remove {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(18px, -20px);
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: var(--hafo-checkout-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hafo-checkout-font-size-xl);
    line-height: 1;
    border-radius: var(--hafo-checkout-radius-sm);
    transition: var(--hafo-checkout-transition);
}

.hafo-cart-item__remove:hover {
    background-color: var(--hafo-checkout-background);
    color: var(--hafo-checkout-error);
}

.hafo-cart-item__remove:focus-visible {
    outline: 2px solid var(--hafo-checkout-primary);
    outline-offset: 2px;
}