/* ========== CART PAGE STYLES ========== */

/* Cart Item Styles */
.cart-item {
    transition: all 0.3s ease;
    background: #fff;
}

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

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

.cart-product-img {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.cart-product-img img {
    transition: transform 0.3s ease;
}

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

/* Product Attributes Badges */
.product-attributes .badge {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 0.3em 0.6em;
}

/* ========== QUANTITY CONTROLS (NEW DESIGN) ========== */

.quantity-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-controls .btn-quantity {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f8f9fa;
    color: #495057;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quantity-controls .btn-quantity:hover {
    background: linear-gradient(135deg, #008020 0%, #006b1a 100%) !important;
    color: white;
    transform: scale(1.1);
}

.quantity-controls .btn-quantity:active {
    transform: scale(0.95);
}

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

.quantity-controls .quantity-display {
    width: 50px;
    height: 32px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
    font-weight: 600;
    color: #212529;
    background: white;
    font-size: 14px;
    line-height: 32px;
    padding: 0;
}

.quantity-controls .quantity-display:focus {
    outline: none;
}

/* ========== OLD QUANTITY STYLES (FALLBACK) ========== */

.quantity .input-group-prepend .btn,
.quantity .input-group-append .btn {
    border: 1px solid #008020;
    color: #008020;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.quantity .input-group-prepend .btn:hover,
.quantity .input-group-append .btn:hover {
    background-color: #008020;
    color: #fff;
    transform: scale(1.05);
}

.quantity .input-group-prepend .btn:disabled,
.quantity .input-group-append .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    border-top: 1px solid #008020;
    border-bottom: 1px solid #008020;
    border-left: none;
    border-right: none;
    font-weight: 600;
    font-size: 1rem;
}

/* Remove Button */
.remove-from-cart-btn {
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.remove-from-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Card Styles */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    border-top: none;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #008020 0%, #00661A 100%);
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: background: linear-gradient(135deg, #32CD32 0%, #c88c87 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 128, 32, 0.4) !important;
}

/* Secondary Button */
.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

/* Text Colors */
.text-primary {
    color: #008020 !important;
}

/* Shadow Effects */
.shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075) !important;
}

/* Sticky Summary */
.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* ========== CART SUMMARY STYLES ========== */

/* Summary Card Border */
.card.sticky-top .card-body .border-bottom {
    border-color: #e9ecef !important;
}

.card.sticky-top .card-body .border-top {
    border-color: #dee2e6 !important;
}

/* Price Display */
.total-price {
    font-size: 1.25rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Checkout Button Animation */
.btn-primary.btn-block.btn-lg {
    position: relative;
    overflow: hidden;
}

.btn-primary.btn-block.btn-lg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary.btn-block.btn-lg:hover::before {
    width: 300px;
    height: 300px;
}

/* Trust Badges */
.trust-badges {
    padding: 1rem 0;
}

.trust-badges i {
    transition: transform 0.3s ease;
}

.trust-badges .col-4:hover i {
    transform: scale(1.2);
}

/* ========== EMPTY CART STYLES ========== */

.empty-cart-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========== COUPON CODE SECTION ========== */

.coupon-input {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.coupon-input:focus {
    border-color: #008020;
    box-shadow: 0 0 0 0.2rem rgba(209, 156, 151, 0.25);
}

/* ========== RESPONSIVE STYLES ========== */

@media (max-width: 768px) {
    .cart-item {
        padding: 1rem !important;
    }

    .cart-product-img img {
        height: 80px !important;
    }

    .quantity {
        max-width: 120px !important;
    }

    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-primary.btn-block.btn-lg {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 576px) {
    .cart-item h6 {
        font-size: 0.9rem;
    }

    .product-attributes .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }

    .total-price {
        font-size: 1rem !important;
    }
}

/* ========== LOADING STATES ========== */

.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== PRICE ANIMATIONS ========== */

.price-update {
    animation: priceHighlight 0.6s ease;
}

@keyframes priceHighlight {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(209, 156, 151, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* ========== DISCOUNT BADGE ========== */

.discount-badge {
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ========== CONTINUE SHOPPING BUTTON ========== */

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
    transform: translateX(-5px);
}

/* ========== SCROLL BEHAVIOR ========== */

.cart-items-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.cart-items-container::-webkit-scrollbar {
    width: 8px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #008020;
    border-radius: 10px;
}

.cart-items-container::-webkit-scrollbar-thumb:hover {
    background: #c88c87;
}

/* ========== SECURITY BADGE ========== */

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 8px;
    margin-top: 1rem;
}

.security-badge i {
    color: #28a745;
}

/* ========== INPUT GROUP STYLES ========== */

.input-group .form-control {
    border-right: none;
}

.input-group .form-control:focus {
    border-color: #008020;
    box-shadow: none;
}

.input-group-append .btn {
    border-left: none;
}

/* ========== PRODUCT NAME TRUNCATION ========== */

.cart-item h6 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 768px) {
    .cart-item h6 {
        white-space: normal;
        line-height: 1.4;
    }
}

/* ========== TOTAL DISPLAY ========== */

#total {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

#subtotal, #shipping {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ========== HOVER EFFECTS FOR TRUST BADGES ========== */

.card.shadow-sm.mt-4:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transition: box-shadow 0.3s ease;
}

/* ========== PRICE ANIMATION ========== */

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #28a745; }
    100% { transform: scale(1); }
}

.price-animate {
    animation: priceUpdate 0.3s ease;
}