/* Custom styles for improved cart popup */
.ps-cart--mini {
    width: 500px !important; /* Increase cart width from 400px to 450px */
    padding: 0 !important;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: fadeInDown 0.3s ease;
    border: 1px solid #f0f0f0;
}

/* Cart header */
.ps-cart--mini .ps-cart__header {
    background: linear-gradient(135deg, #ff9a00 0%, #ff5e00 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ps-cart--mini .ps-cart__header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ps-cart--mini .ps-cart__count {
    background: white;
    color: #ff5e00;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    padding: 2px 10px;
}

/* Cart items */
.ps-cart--mini .ps-cart__items {
    max-height: 320px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

.ps-cart--mini .ps-cart__item {
    border-bottom: 1px solid #f0f0f0;
    margin: 0 !important;
    padding: 15px !important;
    transition: all 0.3s ease;
}

.ps-cart--mini .ps-cart__item:hover {
    background-color: #f9f9f9;
}

/* Product in cart */
.ps-cart--mini .ps-product--mini-cart {
    display: flex;
    gap: 15px;
}

.ps-cart--mini .ps-product__thumbnail {
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease;
}

.ps-cart--mini .ps-product__thumbnail:hover {
    transform: scale(1.05);
}

.ps-cart--mini .ps-product__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-cart--mini .ps-product__content {
    flex-grow: 1;
    position: relative;
    padding-right: 25px;
}

.ps-cart--mini .ps-product__name {
    color: #333;
    font-weight: 600;
    font-size: 16px !important;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-top: 0 !important;
    transition: color 0.2s ease;
}

.ps-cart--mini .ps-product__name:hover {
    color: #ff5e00;
}

.ps-cart--mini .ps-product__desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.ps-cart--mini .ps-product__list {
    padding-left: 15px;
    margin: 5px 0;
}

/* Remove button */
.ps-cart--mini .sc-cart-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ps-cart--mini .sc-cart-remove:hover {
    background: #ff5e00;
    color: white;
    opacity: 1;
}

/* Quantity controls */
.ps-cart--mini .sc-cart-item-summary {
    display: flex;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.ps-cart--mini .sc-quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.ps-cart--mini .sc-quantity-btn {
    width: 25px;
    height: 25px;
    background: #f5f5f5;
    border: none;
    color: #555;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-cart--mini .sc-quantity-btn:hover {
    background: #ff5e00;
    color: white;
}

.ps-cart--mini .sc-cart-item-qty {
    width: 40px;
    height: 25px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    -moz-appearance: textfield;
}

.ps-cart--mini .sc-cart-item-qty::-webkit-outer-spin-button,
.ps-cart--mini .sc-cart-item-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Price display */
.ps-cart--mini .ps-product__price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 5px;
}

.ps-cart--mini .ps-product__cust {
    font-size: 13px;
    color: #666;
    margin-right: 10px;
}

.ps-cart--mini .sc-cart-item-amount {
    font-weight: 600;
    color: #ff5e00;
    font-size: 16px;
}

/* Cart footer */
.ps-cart--mini .ps-cart__footer {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
}

.ps-cart--mini .ps-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.ps-cart--mini .sc-cart-subtotal {
    font-weight: 700;
    color: #ff5e00;
    font-size: 18px;
}

.ps-cart--mini .sc-cart-toolbar {
    display: flex;
    gap: 10px;
}

/* Buttons */
.ps-cart--mini .ps-btn {
    flex: 1;
    text-align: center;
    border-radius: 5px;
    padding: 10px 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.ps-cart--mini .ps-btn--outline {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.ps-cart--mini .ps-btn--outline:hover {
    border-color: #ff5e00;
    color: #ff5e00;
}

.ps-cart--mini .ps-btn--warning {
    background: linear-gradient(135deg, #ff9a00 0%, #ff5e00 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(255, 94, 0, 0.2);
}

.ps-cart--mini .ps-btn--warning:hover {
    background: linear-gradient(135deg, #ff5e00 0%, #ff9a00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 94, 0, 0.25);
}

/* Empty cart */
.ps-cart--mini .sc-cart-empty-msg {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.ps-cart--mini .sc-cart-empty-msg:before {
    content: "🛒";
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight effect */
.ps-cart--mini .sc-highlight {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% {
        background-color: rgba(255, 94, 0, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* Basic cart styling */
.sc-cart {
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.sc-cart-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    border-radius: 4px;
}

/* Animation for adding/removing items */
.sc-cart-item.removing {
    background-color: #ffeeee !important;
    opacity: 0.5;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

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

/* Animation for updating items */
.cart-item.updating {
    background-color: #f0f8ff !important;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

/* Quantity controls */
.sc-quantity-wrapper {
    display: flex;
    align-items: center;
    height: 36px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.sc-cart-item-qty {
    width: 40px;
    border: none;
    text-align: center;
    height: 100%;
    padding: 0;
    font-size: 14px;
    -moz-appearance: textfield;
}

.sc-cart-item-qty::-webkit-outer-spin-button,
.sc-cart-item-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sc-quantity-btn {
    width: 30px;
    height: 100%;
    background: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sc-quantity-btn:hover {
    background: #ff5e00;
    color: white;
}

/* Loader animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.text-primary {
    color: #ff5e00 !important;
}

/* Fade-in animation for the cart overlay */
#cart-loader-overlay {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cart header styling */
.ps-cart__header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ff9a00 0%, #ff5e00 100%);
    color: white;
}

.ps-cart__header h4 {
    margin: 0;
    font-size: 18px;
}

.ps-cart__count {
    background: white;
    color: #ff5e00;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Cart item styling */
.ps-cart__items {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    list-style: none;
}

/* Override Bootstrap list-group-item styles that break cart layout */
.ps-cart--mini .sc-cart-item.list-group-item {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0 !important;
    margin-bottom: 0;
    padding: 15px;
    position: relative;
    overflow: visible;
} 