/* Cart Page Styles */

/* Page Layout */
.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

/* Empty Cart */
.empty-cart-container {
    margin-top: 50px;
}

/* Cart Item Images */
.cart-item-image-desktop {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.cart-item-image-mobile {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* Product Name Links */
.cart-item-name-desktop {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1.4;
}

.cart-item-name-desktop:hover {
    color: #007bff;
    text-decoration: none;
}

.cart-item-name {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.cart-item-name:hover {
    color: #007bff;
    text-decoration: none;
}

.cart-item-name-mobile {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
}

.cart-item-name-mobile:hover {
    color: #007bff;
    text-decoration: none;
}

/* Price Display */
.current-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

/* Price Change Badges */
.price-change-badge {
    display: block;
    margin-top: 4px;
    max-width: 100%;
}

.price-change-badge .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    font-weight: 500;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.price-change-badge .badge-danger {
    background-color: #dc3545;
    color: white;
    animation: pulseRed 2s ease-in-out infinite;
}

.price-change-badge .badge-success {
    background-color: #28a745;
    color: white;
    animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0);
    }
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0);
    }
}

/* Quantity Controls - Desktop Card Layout */
.quantity-controls-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-controls-desktop button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quantity-controls-desktop button:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.quantity-input-desktop {
    width: 70px;
    text-align: center;
    -moz-appearance: textfield;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px;
    font-weight: 500;
    font-size: 1rem;
}

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

.quantity-input-desktop:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Quantity Controls - Desktop (legacy table) */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quantity-controls button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quantity-controls button:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.quantity-input {
    width: 60px;
    text-align: center;
    -moz-appearance: textfield;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px;
    font-weight: 500;
}

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

.quantity-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Quantity Controls - Mobile */
.quantity-controls-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-controls-mobile button {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quantity-controls-mobile button:hover,
.quantity-controls-mobile button:active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.quantity-input-mobile {
    width: 60px;
    text-align: center;
    -moz-appearance: textfield;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px;
    font-weight: 500;
    font-size: 1rem;
    min-height: 44px;
}

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

.quantity-input-mobile:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Desktop Cart Item Cards */
.cart-item-card {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.cart-item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cart-item-card .card-body {
    padding: 20px;
}

/* Unavailable Items */
.unavailable-item {
    opacity: 0.7;
    border-left: 4px solid #dc3545;
    background-color: #fff5f5;
}

/* Strikethrough Price for Changed Items */
.text-muted strike {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Order Summary */
.sticky-summary {
    position: sticky;
    top: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticky-summary .card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 16px;
}

.sticky-summary .card-body {
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #495057;
}

.total-row {
    font-size: 1.3rem;
    padding-top: 8px;
}

.total-row .text-success {
    color: #28a745 !important;
    font-weight: 700;
}

/* Buttons */
.btn-lg {
    padding: 12px 20px;
    font-size: 1.1rem;
    min-height: 48px;
}

.btn-block {
    min-height: 44px; /* Touch-friendly */
}

.btn-sm {
    min-height: 36px;
    padding: 6px 12px;
}

/* Mobile: Ensure all buttons are touch-friendly */
@media (max-width: 767px) {
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 10px 12px;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 12px 20px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Alert Styling */
.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.alert-warning i {
    margin-right: 8px;
    font-size: 1.1em;
}

.alert-warning strong {
    font-weight: 600;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .sticky-summary {
        position: static;
    }
    
    .cart-item-name-mobile {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
    }
    
    /* Mobile card spacing */
    .card.mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* Mobile price change badges */
    .price-change-badge .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .sticky-summary {
        position: static;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .cart-item-image {
        width: 90px;
        height: 90px;
    }
}

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

.alert {
    animation: fadeIn 0.3s ease;
}

/* Card Hover Effects */
.card {
    transition: box-shadow 0.3s ease;
    border: 1px solid #dee2e6;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile cart item cards */
.cart-items-mobile .card {
    border-radius: 8px;
    overflow: hidden;
}

.cart-items-mobile .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Button Hover States */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Disabled State */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* WhatsApp Button Special Styling */
.btn-success {
    background-color: #25D366;
    border-color: #25D366;
}

.btn-success:hover {
    background-color: #1da851;
    border-color: #1da851;
}

/* Share Button */
.btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
}

/* Remove Button */
.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .btn,
    .toast-container,
    header,
    footer {
        display: none !important;
    }
    
    .sticky-summary {
        position: static;
    }
}
