:root {
    --primary: #007bff;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --dark: #212529;
    --light: #f8f9fa;
    
    /* Beautiful Box Shadow Colors */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 20px 40px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #000 !important;
}

body.dark-mode .card {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #3d3d3d;
}

body.dark-mode .bg-light {
    background-color: #2d2d2d !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-color: #4d4d4d;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #4d4d4d;
    color: #e0e0e0;
    border-color: #007bff;
}

/* Navbar */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Category Cards */
.category-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
}

body.dark-mode .category-card:hover {
    background-color: #3d3d3d;
}

.category-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc3545;
}

.product-rating {
    color: #ffc107;
}

.badge-sale {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    font-weight: bold;
}

/* Detail Page */
.detail-image {
    max-height: 500px;
    object-fit: contain;
}

.spec-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

body.dark-mode .spec-item {
    border-bottom-color: #3d3d3d;
}

.color-option {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    margin: 5px;
}

.color-option:hover {
    border-color: #007bff;
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

body.dark-mode .cart-item {
    border-bottom-color: #3d3d3d;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.quantity-input {
    width: 80px;
}

/* Orders */
.order-card {
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
}

body.dark-mode .order-card {
    background-color: #2d2d2d;
}

.order-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
}

.status-pending {
    background-color: #ffc107;
    color: black;
}

.status-processing {
    background-color: #17a2b8;
    color: white;
}

.status-shipped {
    background-color: #0056b3;
    color: white;
}

.status-delivered {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Toast */
#toast {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

body.dark-mode .modal-content {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
}

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .product-image {
        height: 200px;
    }

    .detail-image {
        max-height: 400px;
    }

    .carousel {
        height: 250px !important;
    }

    .display-4 {
        font-size: 1.8rem;
    }

    .offcanvas-end {
        width: 100% !important;
    }
}

/* Carousel Enhancement */
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

.carousel-indicators {
    bottom: 20px;
    z-index: 10;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    background-color: white;
    transform: scale(1.3);
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(0, 0, 0, 0.4);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge-new {
    background-color: #28a745;
}

.badge-hot {
    background-color: #dc3545;
}

.flash-sale {
    position: relative;
    overflow: hidden;
}

.flash-sale::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Search Bar Styling */
#navbarSearch {
    border-radius: 20px;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#navbarSearch:focus {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    border-color: #007bff !important;
}

#searchSuggestions {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.search-suggestion {
    transition: background-color 0.2s ease;
}

.search-suggestion:hover {
    background-color: #f0f0f0 !important;
}

body.dark-mode #searchSuggestions {
    background-color: #2d2d2d !important;
    border-color: #3d3d3d !important;
}

body.dark-mode .search-suggestion:hover {
    background-color: #3d3d3d !important;
}

body.dark-mode .search-suggestion {
    color: #e0e0e0 !important;
    border-bottom-color: #3d3d3d !important;
}

/* Intro Page Styling */
#intro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 3rem 0;
}

#intro .display-4 {
    color: #007bff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.intro-card {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease;
}

.intro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

body.dark-mode #intro-card {
    background-color: #2d2d2d !important;
}

.feature-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: white;
    animation: slideUp 0.5s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: #007bff;
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.2);
}

body.dark-mode .feature-card {
    background-color: #2d2d2d;
}

body.dark-mode .feature-card:hover {
    background-color: #3d3d3d;
}

/* Badge in Intro */
.badge-info-group {
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Print */
@media print {
    .navbar, .footer, .btn, .offcanvas {
        display: none !important;
    }

    .page-section {
        display: block !important;
    }
}
