/* Cart Page Styles - Modern Redesign */

/* Main container styling */
#cart-content {
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Empty cart message */
#cart-content .alert-info {
    font-size: 1rem;
    margin: 0;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    border-radius: 0;
}

#cart-content .alert-info a {
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
}

#cart-content .alert-info a:hover {
    text-decoration: underline;
}

/* Cart Items Container */
.cart-items-container {
    padding: 0;
}

/* Dark theme for cart content */
.dark-theme #cart-content {
    background: #2d2d2d;
    color: #f1f1f1;
}

.dark-theme #cart-content .alert-info {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    color: #f1f1f1;
}

.dark-theme #cart-content .alert-info a {
    color: #ff6b7a;
}

/* Cart Item Cards - Modern Design */
.cart-item {
    padding: 1rem !important;
    margin-bottom: 0px !important;
    transition: all 0.3s ease;
    background: #fff;
}

.cart-item:last-child {
    margin-bottom: 0 !important;
}

.cart-item:hover {
    background: #f8f9fa;
}

/* Dark theme for cart items */
.dark-theme .cart-item {
    background: #2d2d2d;
    color: #f1f1f1;
}

.dark-theme .cart-item:hover {
    background: #3a3a3a;
}

.cart-item-card {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    background: #fff;
}

.cart-item-card:last-child {
    border-bottom: none;
}

.cart-item-card .card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.cart-item-card .card-body {
    padding: 1.2rem;
}

.cart-item-card:hover {
    background: #f8f9fa;
}

/* Dark theme for cart item cards */
.dark-theme .cart-item-card {
    background: #2d2d2d;
    border-bottom-color: #444;
}

.dark-theme .cart-item-card:hover {
    background: #3a3a3a;
}

.dark-theme .cart-item-card .card-title {
    color: #f1f1f1;
}

.dark-theme .cart-item-card .text-muted {
    color: #adb5bd !important;
}

/* Cart Thumbnail */
.cart-thumbnail {
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-thumbnail img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-thumbnail img:hover {
    transform: scale(1.05);
}

/* Cart Item Image Styling */
.cart-item-image {
    object-fit: cover;
    transition: all 0.3s ease;
}

.cart-item-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Special item image border */
.cart-item-special .cart-item-image {
    border-color: #ffc107;
}

.cart-item-special .cart-item-image:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Product Title */
.cart-item-card .card-title {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.cart-item-card .text-muted {
    font-size: 0.95rem;
    color: #6c757d !important;
}

/* Quantity Controls - Matching checkout style */
.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
    background-color: #fff;
    color: #6c757d;
    min-width: 44px; /* Better touch target for mobile */
    min-height: 44px;
}

.quantity-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
    background-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.quantity-btn:active {
    transform: translateY(0);
}

.quantity-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    padding: 0 8px;
}

/* Price styling */
.cart-item-card .text-danger {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Remove button styling */
.cart-item-card .btn-danger {
    border-radius: 0 !important;
    padding: 6px 10px;
    transition: all 0.3s ease;
    border: 2px solid #dc3545;
    background-color: #dc3545;
    color: #fff;
    min-width: 40px; /* Better touch target for mobile */
    min-height: 40px;
}

.cart-item-card .btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.cart-item-card .btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

/* Cart Summary Card - Sticky */
.cart-summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    z-index: 10;
}

.cart-summary-card .card {
    background: transparent;
    border: none;
    border-radius: 0;
}

.cart-summary-card .card-body {
    padding: 1.2rem;
}

.cart-summary-card h5 {
    color: #333;
    font-weight: 600;
}

.cart-summary-card h4 {
    color: #dc3545;
    font-weight: 700;
}

/* Dark theme for cart summary */
.dark-theme .cart-summary-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-color: #444;
}

.dark-theme .cart-summary-card h5 {
    color: #f1f1f1;
}

.dark-theme .cart-summary-card h4 {
    color: #ff6b7a;
}

/* Cart Actions - Matching checkout button styles */
.cart-actions {
    margin: 0;
}

.cart-actions .btn {
    border-radius: 6px !important;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px; /* Better touch target for mobile */
}

.cart-actions .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    background-color: #fff;
}

.cart-actions .btn-outline-secondary:hover {
    border-color: #5a6268;
    color: #fff;
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.cart-actions .btn-outline-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

.cart-actions .btn-danger {
    border-color: #dc3545;
    color: #fff;
    background-color: #dc3545;
}

.cart-actions .btn-danger:hover {
    border-color: #c82333;
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cart-actions .btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.cart-actions .btn:active {
    transform: translateY(0);
}

/* Mobile Responsive Design */
@media (max-width: 767px) {
    /* Adjust spacing for mobile */
    .cart-item-card .card-body {
        padding: 1rem;
    }
    
    .cart-item-card .card-title {
        font-size: 1rem;
    }
    
    /* Stack quantity controls vertically on very small screens */
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .quantity-display {
        min-width: 36px;
        font-size: 1rem;
    }
    
    /* Adjust summary card padding */
    .cart-summary-card .card-body {
        padding: 1.25rem;
    }
    
    /* Make buttons stack on mobile */
    .cart-actions .row {
        flex-direction: column;
    }
    
    .cart-actions .col-6 {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .cart-actions .col-6:last-child {
        margin-bottom: 0;
    }
    
    /* Adjust thumbnail size on mobile */
    .cart-thumbnail img {
        height: 70px;
    }
    
    /* Improve touch targets on mobile */
    .cart-item-card .btn-danger {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    .cart-item-card .card-body {
        padding: 0.75rem;
    }
    
    .cart-item-card .row > div {
        margin-bottom: 0.5rem;
    }
    
    .cart-item-card .row > div:last-child {
        margin-bottom: 0;
    }
    
    .cart-summary-card .card-body {
        padding: 1rem;
    }
    
    .cart-actions .btn {
        padding: 10px 16px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* Make quantity controls more compact */
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .quantity-display {
        min-width: 32px;
        font-size: 0.9rem;
    }
    
    /* Improve layout for very small screens */
    .cart-item-card .row {
        margin: 0;
    }
    
    .cart-item-card .col-4,
    .cart-item-card .col-6,
    .cart-item-card .col-8,
    .cart-item-card .col-md-2,
    .cart-item-card .col-md-4 {
        padding: 0.25rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    /* Tablet adjustments */
    .cart-item-card .card-body {
        padding: 1.25rem;
    }
    
    .cart-summary-card .card-body {
        padding: 1.5rem;
    }
}

@media (min-width: 992px) {
    /* Desktop enhancements */
    .cart-item-card:hover {
        background: #f8f9fa;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .cart-summary-card {
        transition: transform 0.3s ease;
    }
    
    .cart-summary-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    }
}

/* Cart Loading State */
.cart-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.cart-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #dc3545;
    border-radius: 50%;
}

/* Dark theme for loading state */
.dark-theme .cart-loading {
    color: #adb5bd;
}

.dark-theme .cart-loading .spinner-border {
    color: #ff6b7a;
}

/* Fix spinner to be circular */
#cart-content .spinner-border,
#cart-summary .spinner-border,
#cartBuyAgainItems .spinner-border {
    border-radius: 50%;
    border-width: 0.25em;
}

/* Cart Item Animations */
.cart-item-card {
    transition: all 0.3s ease;
}

.cart-item-card.updating {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Cart Item Removal Animation */
.cart-item-card.removing {
    transform: translateX(-100%);
    opacity: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-item-card .card-body {
        padding: 1rem;
    }
    
    .cart-item-card .col-4,
    .cart-item-card .col-8,
    .cart-item-card .col-6 {
        margin-bottom: 0.5rem;
    }
    
    .cart-actions .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* Cart Empty State */
.alert-info a {
    color: #dc3545;
    text-decoration: none;
}

.alert-info a:hover {
    text-decoration: underline;
}

/* Unavailable Cart Items */
.cart-item-card.unavailable {
    opacity: 0.7;
    background: #f8f9fa;
}

.cart-item-card.unavailable .card {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.unavailable-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.cart-item-card.unavailable .quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-item-card.unavailable .quantity-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Accessibility improvements */
.cart-item-card .btn:focus,
.cart-item-card .quantity-btn:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cart-item-card {
        border-bottom: 2px solid #000;
    }
    
    .cart-item-card .btn {
        border-width: 2px;
    }
    
    .cart-summary-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cart-item-card,
    .cart-item-card .card,
    .cart-item-card .btn,
    .cart-summary-card,
    .cart-actions .btn {
        transition: none;
    }
    
    .cart-item-card:hover {
        transform: none;
    }
    
    .cart-summary-card:hover {
        transform: none;
    }
    
    .cart-actions .btn:hover {
        transform: none;
    }
    
    .quantity-btn:hover {
        transform: none;
    }
    
    .cart-item-card .btn-danger:hover {
        transform: none;
    }
}

/* Cart Sidebar */
.cart-sidebar {
    position: sticky;
    top: 2rem;
}

.cart-sidebar .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-sidebar .card-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-bottom: none;
    padding: 1rem;
}

.cart-sidebar .card-header h6 {
    margin: 0;
    font-weight: 600;
}

.deals-section {
    margin-bottom: 1.5rem;
}

.deals-section:last-child {
    margin-bottom: 0;
}

.deals-section h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.deal-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef !important;
    transition: all 0.2s ease;
}

.deal-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.deal-item .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Mobile optimizations */
@media (max-width: 991.98px) {
    .cart-sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .cart-sidebar .card {
        margin-bottom: 1rem;
    }
}

/* Special Badge Styles */
.special-badge {
    margin-top: 0.5rem;
}

.special-badge .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.special-badge .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.special-badge .badge.bg-success {
    background-color: #198754 !important;
    color: #fff !important;
}

.special-badge .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #fff !important;
}

/* Coupon Section Styles */
.coupon-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.coupon-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.coupon-section .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.coupon-section .form-control {
    border: 1px solid #ced4da;
    border-right: none;
}

.coupon-section .btn {
    border: 1px solid #ced4da;
    border-left: none;
    background: #fff;
    color: #6c757d;
}

.coupon-section .btn:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Applied Coupons Container */
#appliedCouponsContainer {
    max-height: 200px;
    overflow-y: auto;
}

.applied-coupon {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.applied-coupon .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Order Summary Enhancements */
.order-summary-item.text-success {
    color: #198754 !important;
}

.order-summary-item.text-warning {
    color: #ffc107 !important;
}

.order-summary-item.text-info {
    color: #0dcaf0 !important;
} 

/* Cart Item Specials Display */
.cart-item-specials {
    margin-top: 0.5rem;
}

.cart-item-specials .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    line-height: 1.2;
}

/* Special Item Styling - Yellow Accents */
.cart-item-special {
    border-color: #ffc107 !important;
    background: linear-gradient(to right, #fff9e6 0%, #ffffff 10%);
    box-shadow: 0 0 0 2px #ffc107;
}

.cart-item-special:hover {
    background: linear-gradient(to right, #fff5d6 0%, #fafafa 10%);
}

/* Cart Item Row Spacing */
.cart-item .row {
    margin: 0;
}

.cart-item .row > [class*='col-'] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.cart-item-image-container {
    padding: 0;
}

/* Special Item Button Styling */
.btn-special {
    border-color: #ffc107 !important;
    color: #856404 !important;
    background-color: #fff3cd !important;
}

.btn-special:hover {
    border-color: #e0a800 !important;
    color: #533f03 !important;
    background-color: #ffe69c !important;
}

.btn-special:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Warning badge for specials */
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
    font-weight: 600;
    font-size: 0.7rem !important;
    padding: 0.3rem 0.6rem !important;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    line-height: 1.2;
}

/* Special badge with icon - ensure text fits */
.badge.bg-warning i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
}

/* Cart item special badges - responsive sizing */
.cart-item .badge.bg-warning {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.5rem !important;
    max-width: calc(100% - 0.5rem);
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
    min-height: 1.8rem;
    display: inline-flex;
    align-items: center;
}

.cart-item .badge.bg-warning i {
    font-size: 0.6rem;
    margin-right: 0.2rem;
    flex-shrink: 0;
}

/* Order Summary Styling */
.order-summary-container {
    padding: 0;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.order-summary-label {
    font-weight: 500;
}

.order-summary-value {
    font-weight: 600;
}

.order-summary-item.fw-bold {
    font-size: 1.1rem;
    padding: 0.75rem 0;
}

.order-summary-item.text-success {
    color: #198754 !important;
}

.order-summary-item.text-warning {
    color: #ffc107 !important;
}

.order-summary-item.text-danger {
    color: #dc3545 !important;
}

.order-summary-container hr {
    margin: 0.5rem 0;
    border-color: #dee2e6;
}

/* Applied Discounts Section */
#appliedDiscountsSection {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

#appliedDiscountsSection h6 {
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 600;
}

#appliedDiscountsList .border-bottom:last-child {
    border-bottom: none !important;
}

/* Total Savings Display */
#totalSavingsSection {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

#totalSavingsSection .bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

/* Enhanced Cart Item Display */
.cart-item-total .text-decoration-line-through {
    font-size: 0.9rem;
}

.cart-item-total .text-success {
    font-weight: 600;
}

.cart-item-total .small {
    font-size: 0.8rem;
}

/* Buy Again Section Styles */
.cart-buy-again-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cart-buy-again-card .card-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.cart-buy-again-card .card-header h5 {
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.cart-buy-again-card .card-body {
    padding: 1.25rem;
}

/* Dark theme for buy again section */
.dark-theme .cart-buy-again-card {
    background: #2d2d2d;
    border-color: #444;
}

.dark-theme .cart-buy-again-card .card-body {
    color: #f1f1f1;
}

.dark-theme .cart-buy-again-card .text-muted {
    color: #adb5bd !important;
}

/* Buy Again Horizontal Scroller */
.buy-again-scroller {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    padding: 10px 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #dc3545 #f8f9fa;
}

.buy-again-scroller::-webkit-scrollbar {
    height: 8px;
}

.buy-again-scroller::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.buy-again-scroller::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 4px;
}

.buy-again-scroller::-webkit-scrollbar-thumb:hover {
    background: #c82333;
}

/* Buy Again Item Card */
.buy-again-item {
    flex: 0 0 180px;
    min-width: 180px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 320px;
}

.buy-again-item:hover {
    border-color: #dc3545;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.2);
}

/* Dark theme for buy again items */
.dark-theme .buy-again-item {
    background: #3a3a3a;
    border-color: #555;
}

.dark-theme .buy-again-item:hover {
    border-color: #dc3545;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* Image wrapper with special badge overlay */
.buy-again-item-image-wrapper {
    position: relative;
    margin-bottom: 8px;
}

/* Content area that grows to push button to bottom */
.buy-again-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.buy-again-item-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    display: block;
}

.dark-theme .buy-again-item-image {
    border-color: #555;
}

/* Yellow border for special item images */
.buy-again-item-special .buy-again-item-image {
    border-color: #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.buy-again-item-special:hover .buy-again-item-image {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.buy-again-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;
}

.dark-theme .buy-again-item-name {
    color: #f1f1f1;
}

.buy-again-item-pricing {
    margin-bottom: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.buy-again-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: #dc3545;
}

.dark-theme .buy-again-item-price {
    color: #ff6b7a;
}

/* Special item styling - Yellow theme */
.buy-again-item-special {
    border-color: #ffc107 !important;
    background: linear-gradient(to bottom, #fff9e6 0%, #ffffff 30%);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.dark-theme .buy-again-item-special {
    background: linear-gradient(to bottom, #3d3416 0%, #3a3a3a 30%);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

.buy-again-item-special:hover {
    border-color: #ffc107 !important;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

/* Special badge - positioned over image */
.buy-again-special-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.buy-again-special-badge i {
    font-size: 0.65rem;
}

/* Special pricing - consolidated on one line */
.buy-again-price-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 3px;
}

.buy-again-special-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.dark-theme .buy-again-special-price {
    color: #48d16a;
}

.buy-again-original-price {
    font-size: 0.8rem;
    color: #6c757d;
    text-decoration: line-through;
    font-weight: 400;
}

.dark-theme .buy-again-original-price {
    color: #adb5bd;
}

.buy-again-savings {
    font-size: 0.75rem;
    color: #28a745;
    font-weight: 600;
    text-align: center;
}

.dark-theme .buy-again-savings {
    color: #48d16a;
}

.buy-again-item-add-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.buy-again-item-add-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.buy-again-item-add-btn:active {
    transform: scale(0.98);
}

/* Special item button - Yellow theme */
.buy-again-item-add-btn-special {
    background: #ffc107;
    color: #212529;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.buy-again-item-add-btn-special:hover {
    background: #e0a800;
    border-color: #e0a800;
    color: #000;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.buy-again-item-add-btn-special:active {
    transform: scale(0.98);
}

/* Product Tile Special Item Styling (for Buy Again section using createProductTile) */
.product-tile.special-item {
    border-color: #ffc107 !important;
    background: linear-gradient(to bottom, #fff9e6 0%, #ffffff 30%);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.product-tile.special-item:hover {
    border-color: #ffc107 !important;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.product-tile.special-item .product-tile-image {
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.product-tile.special-item:hover .product-tile-image {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.product-tile.special-item .product-tile-pack {
    color: #856404;
}

.product-tile.special-item .product-tile-price {
    color: #f57c00;
}

.product-tile.special-item .product-tile-savings-text {
    color: #ff6b00;
}

/* Dark theme for product tile special items */
.dark-theme .product-tile.special-item {
    background: linear-gradient(to bottom, #3d3416 0%, #2d2d2d 30%) !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4) !important;
    border-color: #ffc107 !important;
}

.dark-theme .product-tile.special-item:hover {
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6) !important;
    border-color: #ffc107 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .buy-again-item {
        flex: 0 0 160px;
        min-width: 160px;
        padding: 10px;
        height: 300px;
    }
    
    .buy-again-item-image {
        height: 100px;
    }
    
    .buy-again-item-name {
        font-size: 0.85rem;
        min-height: 32px;
    }
    
    .buy-again-special-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
        top: 6px;
        left: 6px;
    }
    
    .buy-again-special-badge i {
        font-size: 0.6rem;
    }
    
    .buy-again-item-price {
        font-size: 0.9rem;
    }
    
    .buy-again-original-price {
        font-size: 0.75rem;
    }
    
    .buy-again-special-price {
        font-size: 1rem;
    }
    
    .buy-again-savings {
        font-size: 0.7rem;
    }
    
    .buy-again-item-add-btn,
    .buy-again-item-add-btn-special {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .cart-buy-again-card .card-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .buy-again-item {
        flex: 0 0 140px;
        min-width: 140px;
        height: 280px;
    }
    
    .buy-again-item-image {
        height: 90px;
    }
    
    .buy-again-special-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
        top: 5px;
        left: 5px;
    }
    
    .buy-again-special-badge i {
        font-size: 0.55rem;
    }
    
    .buy-again-original-price {
        font-size: 0.7rem;
    }
    
    .buy-again-special-price {
        font-size: 0.95rem;
    }
    
    .buy-again-savings {
        font-size: 0.65rem;
    }
    
    .cart-buy-again-card .card-header {
        padding: 0.75rem 1rem;
    }
    
    .cart-buy-again-card .card-header h5 {
        font-size: 1rem;
    }
}

/* Dark theme for cards headers */
.dark-theme .card-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%) !important;
    border-bottom-color: #444 !important;
    color: #f1f1f1 !important;
}

.dark-theme .cart-items-card .card-header,
.dark-theme .cart-buy-again-card .card-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
}

/* Dark theme for buttons */
.dark-theme .quantity-btn {
    background-color: #3a3a3a;
    border-color: #555;
    color: #f1f1f1;
}

.dark-theme .quantity-btn:hover {
    background-color: #3a3a3a;
    border-color: #dc3545;
    color: #ff6b7a;
}

.dark-theme .quantity-display {
    color: #f1f1f1;
}

/* Dark theme for prices */
.dark-theme .text-danger,
.dark-theme .cart-item-card .text-danger {
    color: #ff6b7a !important;
}