.cart-item {
    transition: all 0.3s ease;
}

.cart-item img {
    max-height: none;
}

.quantity-input {
    width: 60px;
    text-align: center;
}

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

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

.btn-outline-secondary {
    border-color: #dee2e6;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #212529;
}

.remove-item {
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.remove-item:hover {
    color: #dc3545 !important;
}

/* Cart total in navigation */
.cart-total {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Empty cart state */
.empty-cart-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Product image container */
.cart-item-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Force perfect square */
    overflow: hidden;
    background: #f8f9fa;
    display: block;
    /* Ensure the link takes full container space */
}

.cart-item-image-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Center the image */
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Product name hover effect - target the link directly */
.cart-item .product-name {
    color: inherit;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.cart-item .product-name:hover {
    text-decoration: underline !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .cart-item-image-container {
        aspect-ratio: 1 / 1;
        /* Maintain square on mobile */
    }

}

/* Quantity Input Group Styles */
.quantity-input-group {
    height: 35px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.quantity-input-group .btn {
    background-color: var(--primary-grey);
    border-color: var(--primary-grey);
    color: #fff;
    width: 30px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.quantity-input-group .btn:hover,
.quantity-input-group .btn:focus,
.quantity-input-group .btn:active {
    background-color: var(--primary-grey) !important;
    border-color: var(--primary-grey) !important;
    color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
}

.quantity-input-group .form-control {
    height: 35px;
    text-align: center;
    border: 1px solid #ced4da;
    width: 60px;
    flex-shrink: 0;
    /* Hide default number input arrows */
    -moz-appearance: textfield;
    appearance: textfield;
    position: relative;
    z-index: 0;
}

/* Hide number input arrows for Chrome, Safari, Edge, Opera */
.quantity-input-group .form-control::-webkit-outer-spin-button,
.quantity-input-group .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ensure the input text is perfectly centered */
.quantity-input-group .form-control:focus {
    box-shadow: none;
    text-align: center;
}

/* Position the buttons to overlap the input borders */
.quantity-input-group .decrease-quantity {
    margin-right: -1px;
}

.quantity-input-group .increase-quantity {
    margin-left: -1px;
}

/* Ensure the input group maintains its shape */
.quantity-input-group .form-control:focus {
    z-index: 0;
}

.quantity-input-group .btn:focus {
    z-index: 2;
}

/* Tartan Display Styles */
.tartan-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tartan-image-container {
    position: relative;
    width: 50px;
    padding-bottom: 50px;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.tartan-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tartan-info {
    flex-grow: 1;
}

@media (min-width: 575px) and (max-width: 991px) {
    .tartan-info {
        margin-right: 0.5rem;
    }
}

/* Order Summary Sticky Styles */
.order-summary-card {
    position: sticky;
}

@media (min-width: 768px) and (max-width: 991px) {
    .order-summary-card {
        top: 110px;
    }
}

@media (min-width: 992px) {
    .order-summary-card {
        top: 70px;
    }
}