:root {
    /* Color Palette */
    --primary: #0f172a; /* Deep Blue/Black */
    --primary-light: #1e293b;
    --accent: #3b82f6; /* Vibrant Blue */
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Typography */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Georgia', serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--primary);
}

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
}

.brand-logo {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.brand-logo:hover {
    transform: scale(1.05);
    text-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.brand-logo i {
    -webkit-text-fill-color: initial; /* Keep icon color solid or handle separately if needed */
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 0.5rem 1rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: rgba(15, 23, 42, 0.05);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 70%);
    z-index: 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 992px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.3);
}

.card-img-top {
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-buy {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-buy:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.card:hover .quick-actions {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 991px) {
    .quick-actions {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

.quick-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Categories */
.categories-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
}

.category-link:hover, .category-link.active {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    background: #fafafa;
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    background: #fafafa;
}

.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-group-text {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

/* Admin Specific */
.admin-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom-width: 1px;
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.02);
}

/* Product Carousel */
.product-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem; /* Add padding for shadow visibility */
    margin: -0.5rem; /* Compensate padding */
    padding-bottom: 1.5rem;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}

.product-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.product-carousel-item {
    flex: 0 0 auto;
    width: 85%; /* Mobile width */
    max-width: 300px;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .product-carousel-item {
        width: 280px;
    }
}

/* Carousel Buttons */
.carousel-wrapper {
    padding: 0 10px;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--primary);
    transition: all 0.2s ease;
}
.carousel-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}
.carousel-btn.prev {
    left: -20px;
}
.carousel-btn.next {
    right: -20px;
}
