/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================ */
/* TYPOGRAPHY SYSTEM                           */
/* ============================================ */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* Type Scale */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
}

body {
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--brand-gray-800);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--brand-gray-900);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: 600;
}

/* Display sizes for hero sections */
.display-1 {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.1;
}

.display-2,
.display-3,
.display-4 {
    font-weight: 700;
    line-height: 1.2;
}

/* Text utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

/* Paragraph styling */
p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.lead {
    font-size: var(--font-size-lg);
    font-weight: 400;
    line-height: 1.5;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================ */
/* BRAND COLOR SYSTEM                          */
/* ============================================ */
:root {
    /* Primary Brand Colors */
    --brand-primary: #0066cc;
    --brand-primary-dark: #004d99;
    --brand-primary-light: #3385d6;

    /* Secondary Colors */
    --brand-secondary: #ff6b35;
    --brand-secondary-dark: #e55a2b;
    --brand-secondary-light: #ff8456;

    /* Neutral Palette */
    --brand-gray-50: #f8f9fa;
    --brand-gray-100: #e9ecef;
    --brand-gray-200: #dee2e6;
    --brand-gray-300: #ced4da;
    --brand-gray-400: #adb5bd;
    --brand-gray-500: #6c7580;
    --brand-gray-600: #495057;
    --brand-gray-700: #343a40;
    --brand-gray-800: #212529;
    --brand-gray-900: #191c1f;

    /* Success, Warning, Danger */
    --brand-success: #28a745;
    --brand-warning: #ffc107;
    --brand-danger: #dc3545;
    --brand-info: #17a2b8;

    /* Surface & Shadow */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --card-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --card-border-radius: 12px;
    --card-border-radius-sm: 8px;
}

/* Update Bootstrap button colors to use brand palette */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.25);
}

.btn-secondary {
    background-color: var(--brand-gray-500);
    border-color: var(--brand-gray-500);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--brand-gray-600);
    border-color: var(--brand-gray-600);
}

/* Update admin card header backgrounds */
.bg-black.bg-gradient {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%) !important;
}

/* Link colors */
a:not(.btn) {
    color: var(--brand-primary);
}

a:not(.btn):hover {
    color: var(--brand-primary-dark);
}

/* ============================================ */
/* ADMIN PAGE ENHANCEMENTS                     */
/* ============================================ */

/* Admin card headers */
.admin-card-header {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%) !important;
    padding: 1.5rem 2rem !important;
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
}

.admin-card-header h2,
.admin-card-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    color: white !important;
}

.admin-card-body {
    padding: 2rem !important;
}

/* Section headers within admin pages */
.section-header {
    background-color: var(--brand-gray-50);
    border-left: 4px solid var(--brand-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 var(--card-border-radius-sm) var(--card-border-radius-sm) 0;
}

.section-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--brand-gray-800);
}

/* Admin card styling */
.card.shadow {
    box-shadow: var(--card-shadow-lg) !important;
}

.card {
    border-radius: var(--card-border-radius);
}

/* ============================================ */
/* UI IMPROVEMENTS - Product Cards & Tables    */
/* ============================================ */

/* 1. Product Card Hover Effects */
.product-card {
    border-radius: var(--card-border-radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 1px solid var(--brand-gray-200);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover) !important;
    border-color: var(--brand-primary-light);
}

/* Product card image effects */
.product-card .ratio {
    background: var(--brand-gray-50);
    position: relative;
    overflow: hidden;
}

.product-card .ratio img {
    transition: transform 0.3s ease;
    object-fit: cover;
}

.product-card:hover .ratio img {
    transform: scale(1.05);
}

/* Product card price */
.product-card .h6 {
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Product card title */
.product-card h3 {
    color: var(--brand-gray-800);
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product card button */
.product-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: var(--card-border-radius-sm);
}

.product-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 102, 204, 0.3);
}

/* 2. Admin Table Improvements */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--card-border-radius-sm);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* Admin table headers with gradient */
.table thead {
    background: linear-gradient(to right, var(--brand-gray-100), var(--brand-gray-50));
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--brand-gray-700);
    padding: 1rem 1.25rem !important;
    border-bottom: 2px solid var(--brand-gray-200);
}

.table th,
.table td {
    padding: 1rem 1.25rem !important;
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.04);
    transform: scale(1.01);
}

/* Action button spacing in tables */
.table td .btn + .btn {
    margin-left: 0.5rem;
}

.table .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--card-border-radius-sm);
}

/* 3. Standardized Button Styles */
.btn {
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 1.1rem;
}

.btn-primary:hover {
    background-color: #155a99;
    border-color: #14508a;
    box-shadow: 0 4px 8px rgba(27, 110, 194, 0.2);
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

.btn-danger:hover {
    background-color: #bd2130;
    border-color: #b21f2d;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Badge improvements */
.badge {
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ============================================ */
/* HOME PAGE ENHANCEMENTS                      */
/* ============================================ */

/* Enhanced Category Sidebar */
.filter-sidebar,
.offcanvas-body {
    position: sticky;
    top: 100px;
}

.accordion-item {
    background: white;
    border-radius: var(--card-border-radius-sm);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.accordion-button:not(.collapsed) {
    background-color: var(--brand-gray-50);
    color: var(--brand-primary);
}

/* Category navigation links */
.nav-link {
    padding: 0.625rem 1rem;
    border-radius: var(--card-border-radius-sm);
    transition: all 0.2s ease;
    color: var(--brand-gray-700);
    position: relative;
}

.nav-link:hover {
    background: var(--brand-gray-50);
    color: var(--brand-primary);
    padding-left: 1.5rem;
}

.nav-link.active {
    background: var(--brand-primary);
    color: white !important;
    font-weight: 600;
    padding-left: 1.5rem;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 2px;
}

/* Search input enhancement */
.brands-search {
    padding-left: 2.5rem;
    border: 2px solid var(--brand-gray-200);
    border-radius: var(--card-border-radius-sm);
    transition: all 0.3s ease;
}

.brands-search:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

/* ============================================ */
/* FORM ENHANCEMENTS                           */
/* ============================================ */

/* Form inputs */
.form-floating > .form-control,
.form-floating > .form-select {
    border: 2px solid var(--brand-gray-200);
    border-radius: var(--card-border-radius-sm);
    padding: 1rem 0.75rem;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

/* Enhanced Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--brand-success) !important;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2328a745'><path d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.invalid {
    border-color: var(--brand-danger) !important;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dc3545'><path d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/><path d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.validation-message {
    color: var(--brand-danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.validation-message::before {
    content: '⚠';
    font-size: 1rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sectioned Forms */
.form-section {
    background: white;
    border: 1px solid var(--brand-gray-200);
    border-radius: var(--card-border-radius);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--card-shadow);
}

.form-section-header {
    background: linear-gradient(to right, var(--brand-gray-50), white);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--brand-gray-100);
}

.form-section-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--brand-gray-800);
}

.form-section-header h5::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--brand-primary);
    border-radius: 2px;
}

.form-section-body {
    padding: 1.5rem;
}

/* Checkbox styling */
.form-check-input {
    border: 2px solid var(--brand-gray-300);
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.form-check-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* ============================================ */
/* DASHBOARD WIDGETS                           */
/* ============================================ */

.dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-widget {
    background: white;
    border-radius: var(--card-border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--widget-color, var(--brand-primary));
}

.dashboard-widget:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.dashboard-widget-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--widget-color-light, rgba(0, 102, 204, 0.1));
    color: var(--widget-color, var(--brand-primary));
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.dashboard-widget-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-gray-600);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-widget-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-gray-900);
}

.dashboard-widget.primary {
    --widget-color: var(--brand-primary);
    --widget-color-light: rgba(0, 102, 204, 0.1);
}

.dashboard-widget.success {
    --widget-color: var(--brand-success);
    --widget-color-light: rgba(40, 167, 69, 0.1);
}

.dashboard-widget.warning {
    --widget-color: var(--brand-warning);
    --widget-color-light: rgba(255, 193, 7, 0.1);
}

.dashboard-widget.danger {
    --widget-color: var(--brand-danger);
    --widget-color-light: rgba(220, 53, 69, 0.1);
}

.dashboard-widget.info {
    --widget-color: var(--brand-info);
    --widget-color-light: rgba(23, 162, 184, 0.1);
}

/* ============================================ */
/* RESPONSIVE DESIGN                           */
/* ============================================ */

/* Mobile devices (< 768px) */
@media (max-width: 767px) {
    /* Typography adjustments */
    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    .display-4 {
        font-size: var(--font-size-3xl);
    }

    /* Hero section mobile */
    .hero-section {
        margin: 1rem;
    }

    .hero-section .display-4 {
        font-size: var(--font-size-2xl);
    }

    .hero-section .lead {
        font-size: var(--font-size-base);
    }

    /* Dashboard widgets - single column */
    .dashboard-widget-grid {
        grid-template-columns: 1fr;
    }

    /* Table wrapper for horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 800px;
    }

    /* Form actions full width */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Product cards - adjust grid */
    .row-cols-2 {
        --bs-gutter-x: 0.5rem;
    }

    /* Reduce padding on mobile */
    .card-body {
        padding: 1rem !important;
    }

    .admin-card-header {
        padding: 1rem !important;
    }

    .admin-card-header h2 {
        font-size: var(--font-size-xl);
    }
}

/* Tablet devices (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Dashboard widgets - 2 columns */
    .dashboard-widget-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Typography adjustments */
    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    .display-4 {
        font-size: var(--font-size-3xl);
    }
}

/* Large desktop (> 1920px) */
@media (min-width: 1921px) {
    .container {
        max-width: 1600px;
    }

    .dashboard-widget-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {
    .btn,
    .navbar,
    .offcanvas,
    .modal {
        display: none !important;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }

    body {
        font-size: 12pt;
    }
}

/* ============================================ */
/* ANIMATIONS & POLISH                         */
/* ============================================ */

/* Fade in animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Apply fade-in to main content */
.card,
.hero-section {
    animation: fadeIn 0.6s ease-out;
}

/* Stagger animation for dashboard widgets */
.dashboard-widget:nth-child(1) {
    animation: fadeIn 0.4s ease-out;
}

.dashboard-widget:nth-child(2) {
    animation: fadeIn 0.5s ease-out;
}

.dashboard-widget:nth-child(3) {
    animation: fadeIn 0.6s ease-out;
}

.dashboard-widget:nth-child(4) {
    animation: fadeIn 0.7s ease-out;
}

/* Button ripple effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-color: var(--brand-gray-200);
    }
    50% {
        background-color: var(--brand-gray-100);
    }
    100% {
        background-color: var(--brand-gray-200);
    }
}

.skeleton {
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Pulse animation for alerts/notifications */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth transitions everywhere */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* Disable transitions during page load */
.preload * {
    transition: none !important;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--brand-gray-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background-color: var(--brand-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--brand-primary);
    color: white;
}

/* ============================================ */
/* CART BADGE FIX                              */
/* ============================================ */

/* Fix cart badge clipping on rounded circle button */
.btn.rounded-circle {
    overflow: visible !important;
}

/* Ensure badge has enough space and padding */
.btn.rounded-circle .badge {
    min-width: 1.25rem;
    padding: 0.25em 0.45em;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}
