/* OrderFresh Global Styles - World-Class Design System */

:root {
    /* ===== COLOR PALETTE ===== */
    /* Primary Brand Colors */
    --primary: #FF0000;
    --primary-dark: #CC0000;
    --primary-light: #FF3333;
    --primary-lighter: #FF6666;
    --primary-alpha-10: rgba(255, 0, 0, 0.1);
    --primary-alpha-20: rgba(255, 0, 0, 0.2);

    /* Secondary Brand Colors */
    --secondary: #0E8345;
    --secondary-dark: #0A6234;
    --secondary-light: #10B981;
    --secondary-alpha-10: rgba(14, 131, 69, 0.1);

    /* Accent Colors */
    --accent: #FFC043;
    --accent-dark: #FFB020;

    /* Text Colors */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --text-disabled: #9aa0a6;
    --text-inverse: #FFFFFF;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F1F3F4;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* Border Colors */
    --border-light: #F1F3F4;
    --border-medium: #DADCE0;
    --border-dark: #5f6368;

    /* Status Colors */
    --success: #0E8345;
    --success-bg: #D1FAE5;
    --warning: #FFC043;
    --warning-bg: #FEF3C7;
    --error: #FF0000;
    --error-bg: #FEE2E2;
    --info: #2563EB;
    --info-bg: #DBEAFE;

    /* ===== SPACING SCALE (EM UNITS) ===== */
    --space-0: 0;
    --space-1: 0.25em;
    --space-2: 0.5em;
    --space-3: 0.75em;
    --space-4: 1em;
    --space-5: 1.25em;
    --space-6: 1.5em;
    --space-8: 2em;
    --space-10: 2.5em;
    --space-12: 3em;
    --space-16: 4em;
    --space-20: 5em;
    --space-24: 6em;

    /* ===== TYPOGRAPHY ===== */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75em;
    --font-size-sm: 0.875em;
    --font-size-base: 1em;
    --font-size-lg: 1.125em;
    --font-size-xl: 1.25em;
    --font-size-2xl: 1.5em;
    --font-size-3xl: 1.875em;
    --font-size-4xl: 2.25em;
    --font-size-5xl: 3em;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 800;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* ===== BORDERS ===== */
    --radius-sm: 0.375em;
    --radius-md: 0.75em;
    --radius-lg: 1em;
    --radius-xl: 1.25em;
    --radius-2xl: 1.5em;
    --radius-full: 50em;

    /* ===== SHADOWS ===== */
    --shadow-xs: 0 0.0625em 0.125em rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 0.0625em 0.1875em rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.25em 0.75em rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 0.5em 1.5em rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 1em 3em rgba(0, 0, 0, 0.16);
    --shadow-2xl: 0 1.5em 4em rgba(0, 0, 0, 0.2);

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* ===== Z-INDEX LAYERS ===== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-4) 0;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-black);
}

h2 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-black);
}

h3 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

h4 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

h5 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

p {
    margin: 0 0 var(--space-4) 0;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

a:focus-visible {
    outline: 0.125em solid var(--primary);
    outline-offset: 0.125em;
    border-radius: var(--radius-sm);
}

.container {
    max-width: 75em;
    margin: 0 auto;
    padding: 0 var(--space-4);
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-4);
}

/* Navbar styles moved to navbar.css */

.btn {
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    white-space: nowrap;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    box-shadow:
        0 0.25em 0.75em rgba(255, 0, 0, 0.3),
        var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-normal);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #990000 100%);
    transform: translateY(-0.1875em);
    box-shadow:
        0 0.5em 1.25em rgba(255, 0, 0, 0.4),
        var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(-0.0625em);
    box-shadow:
        0 0.125em 0.5em rgba(255, 0, 0, 0.3),
        var(--shadow-sm);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--text-inverse);
    box-shadow:
        0 0.25em 0.75em rgba(14, 131, 69, 0.3),
        var(--shadow-sm);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #0A6234 100%);
    transform: translateY(-0.1875em);
    box-shadow:
        0 0.5em 1.25em rgba(14, 131, 69, 0.4),
        var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 0.125em solid var(--primary);
    color: var(--primary);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-normal);
    z-index: -1;
}

.btn-outline:hover {
    color: var(--text-inverse);
    border-color: var(--primary-dark);
}

.btn-outline:hover::before {
    width: 100%;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--secondary-dark) 100%);
    color: var(--text-inverse);
    box-shadow:
        0 0.25em 0.75em rgba(14, 131, 69, 0.3),
        var(--shadow-sm);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #0A6234 100%);
    transform: translateY(-0.1875em);
    box-shadow:
        0 0.5em 1.25em rgba(14, 131, 69, 0.4),
        var(--shadow-lg);
}


.btn-danger {
    background: var(--error);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--primary-dark);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:focus-visible {
    outline: 0.125em solid var(--primary);
    outline-offset: 0.125em;
}

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    border: 0.0625em solid var(--border-light);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25em;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow:
        0 1em 2.5em rgba(0, 0, 0, 0.12),
        0 0.5em 1em rgba(0, 0, 0, 0.08);
    transform: translateY(-0.375em);
    border-color: var(--border-medium);
}

.card:hover::before {
    opacity: 1;
}

.card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    flex: 1;
}

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(18.75em, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(15.625em, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(12.5em, 1fr));
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 0.0625em solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--border-dark);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.1875em var(--primary-alpha-10);
}

.form-textarea {
    min-height: 7.5em;
    resize: vertical;
}

.form-error {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
    display: block;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400E;
}

.badge-danger {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.loading {
    text-align: center;
    padding: var(--space-12);
}

.spinner {
    border: 0.25em solid var(--border-light);
    border-top: 0.25em solid var(--primary);
    border-radius: var(--radius-full);
    width: 3.125em;
    height: 3.125em;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4) auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 0.0625em solid var(--success);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 0.0625em solid var(--error);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 0.0625em solid var(--info);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 0.0625em solid var(--warning);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(0.25em);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-4);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 31.25em;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
    padding: 0;
    width: 1.5em;
    height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.footer {
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: var(--space-12) 0 var(--space-4);
    margin-top: var(--space-16);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.625em, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h4 {
    margin-bottom: var(--space-4);
    color: var(--text-inverse);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--text-inverse);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 0.0625em solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.align-start {
    align-items: flex-start;
}

.align-center {
    align-items: center;
}

.align-end {
    align-items: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-1 {
    margin-bottom: var(--space-1);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: var(--space-1);
}

.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-grid {
    display: grid;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.font-weight-normal {
    font-weight: var(--font-weight-normal);
}

.font-weight-medium {
    font-weight: var(--font-weight-medium);
}

.font-weight-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-weight-bold {
    font-weight: var(--font-weight-bold);
}

@media (max-width: 64em) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 var(--space-3);
    }

    h1 {
        font-size: var(--font-size-4xl);
    }

    h2 {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 48em) {
    html {
        font-size: 14px;
    }

    .navbar {
        flex-wrap: wrap;
    }

    .nav-links {
        gap: var(--space-4);
        font-size: var(--font-size-sm);
    }

    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: var(--space-6);
    }

    .btn {
        width: 100%;
    }

    .btn-group .btn {
        width: auto;
    }
}

@media (max-width: 30em) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-2);
    }

    .navbar {
        padding: var(--space-3) 0;
    }

    .logo {
        font-size: var(--font-size-xl);
    }

    .footer {
        padding: var(--space-8) 0 var(--space-4);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}