/* Cart System Styles for Royal Home Appliances */

/* Cart Icon and Badge */
.cart-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #007bff;
    text-decoration: none;
}

.cart-icon:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    transform: translateY(-2px);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Professional Button Base Style - Fixed Width for Container */
.add-to-cart-btn,
.action-buttons .checkout-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    min-width: 110px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    flex: 1;
}

/* Add to Cart Button */
.add-to-cart-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.add-to-cart-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Checkout Button - Green like "Add to Compare" */
.action-buttons .checkout-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.action-buttons .checkout-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.action-buttons .checkout-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

/* Product Card specific styling */
.product-card .add-to-cart-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    min-width: 110px;
    height: 42px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

.product-card .add-to-cart-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Icon styling for both buttons */
.add-to-cart-btn i,
.action-buttons .checkout-btn i {
    margin-right: 6px;
    transition: transform 0.2s ease;
    font-size: 12px;
}

.add-to-cart-btn:hover i,
.action-buttons .checkout-btn:hover i {
    transform: scale(1.1);
}

/* Action buttons container - ensure proper flex layout */
.action-buttons {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
}

.action-buttons .btn.add-to-cart-btn,
.action-buttons .btn.checkout-btn {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* Price section styling to match image */
.price-section {
    margin-bottom: 12px;
}

.price-section .h5 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.price-section small {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Card bottom section layout */
.mt-auto {
    margin-top: auto !important;
}

.mt-auto > div:first-child {
    flex-direction: column;
    align-items: stretch !important;
}

/* Cart Notifications */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    max-width: 400px;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cart-notification.success {
    border-left: 4px solid #28a745;
}

.cart-notification.info {
    border-left: 4px solid #17a2b8;
}

.cart-notification.error {
    border-left: 4px solid #dc3545;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 20px;
    color: #28a745;
}

.cart-notification.info .notification-content i {
    color: #17a2b8;
}

.cart-notification.error .notification-content i {
    color: #dc3545;
}

.notification-content span {
    font-weight: 500;
    color: #333;
}

/* Cart Modal Styles */
#cartModal .modal-dialog {
    max-width: 800px;
}

#cartModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#cartModal .modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    padding: 20px 24px;
}

#cartModal .modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

#cartModal .modal-footer {
    background: #f8f9fa;
    border: none;
    padding: 20px 24px;
}

/* Cart Item Styles */
.cart-item {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 16px 12px !important;
    margin-bottom: 8px;
}

.cart-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.cart-item img {
    max-height: 80px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.cart-item h6 {
    font-weight: 600;
    color: #333;
}

.cart-item .text-muted {
    font-size: 0.875rem;
}

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

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

.quantity-btn:hover {
    transform: scale(1.1);
}

.quantity-btn i {
    font-size: 12px;
}

/* Empty Cart State */
.empty-cart {
    padding: 60px 20px;
}

.empty-cart .fa-shopping-cart {
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-cart h5 {
    color: #6c757d;
    font-weight: 600;
}

.empty-cart p {
    color: #adb5bd;
    margin-bottom: 30px;
}

/* Product Card Integration */
.product-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.product-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 20px;
}

.product-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 16px;
}

.product-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.product-features li {
    padding: 4px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.product-features li i {
    color: #28a745;
    margin-right: 8px;
    width: 16px;
}

/* Color Selection */
.color-selector {
    margin: 16px 0;
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.color-option.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.color-option::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-option.active::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-notification {
        right: 10px;
        left: 10px;
        top: 80px;
        width: auto;
        min-width: auto;
        max-width: none;
    }

    #cartModal .modal-dialog {
        margin: 10px;
        max-width: none;
    }

    .cart-item .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .cart-item .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .cart-item .col-3:last-child {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .cart-item img {
        height: 50px;
    }

    .cart-item h6 {
        font-size: 0.9rem;
    }

    .quantity-controls {
        gap: 3px;
    }

    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Mobile button improvements - ensure both buttons are visible */
    .add-to-cart-btn,
    .action-buttons .checkout-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 90px;
        height: 38px;
        border-radius: 6px;
        letter-spacing: 0.4px;
        flex: 1;
    }

    .product-card .add-to-cart-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 90px;
        height: 38px;
        flex: 1;
    }

    .action-buttons .btn.add-to-cart-btn,
    .action-buttons .btn.checkout-btn {
        font-size: 11px;
        padding: 8px 10px;
        height: 38px;
        min-width: 90px;
        flex: 1 !important;
    }

    .action-buttons {
        gap: 6px !important;
    }

    /* Icons smaller on mobile */
    .add-to-cart-btn i,
    .action-buttons .checkout-btn i {
        margin-right: 4px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .cart-item {
        padding: 10px;
    }

    .cart-item .row {
        align-items: center;
    }

    .modal-footer .d-flex {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer .flex-fill {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    /* Very small screen - both buttons full width */
    .add-to-cart-btn,
    .action-buttons .checkout-btn,
    .checkout-btn {
        min-width: 100%;
        padding: 12px 16px;
        font-size: 12px;
        height: 44px;
        letter-spacing: 0.6px;
        flex: none;
    }

    .product-card .add-to-cart-btn {
        padding: 12px 16px;
        font-size: 12px;
        min-width: 100%;
        height: 44px;
        flex: none;
    }

    .action-buttons .btn.add-to-cart-btn,
    .action-buttons .btn.checkout-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 12px 16px;
        font-size: 12px;
        height: 44px;
        flex: none !important;
    }

    .action-buttons .btn-outline-primary {
        flex: 0 0 auto !important;
        min-width: auto !important;
        width: auto !important;
        padding: 8px 12px;
        height: 38px;
    }
}

/* Loading States */
.add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Animation */
.add-to-cart-btn.success {
    background: #28a745;
}

.add-to-cart-btn.success::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: white;
    font-weight: bold;
} 