:root {
    --hb-ink: #22324a;
    --hb-muted: #667085;
    --hb-brand: #c4471d;
    --hb-brand-hover: #ae3915;
    --hb-pale: #fff3df;
    --hb-line: #f5e4d7;
    --hb-radius: 16px;
    --hb-shadow: 0 8px 26px rgb(190 103 43 / 9%);
    --hb-nav-gradient: linear-gradient(155deg, #fff3df 0%, #ffecd2 45%, #ffe0ad 100%);
    --hb-action-gradient: linear-gradient(110deg, #ff512f, #ffb347);
}

body {
    background: linear-gradient(135deg, #fff, #fff8f1);
    color: var(--hb-ink);
    font-family: "Segoe UI", system-ui, sans-serif;
}

@media (hover: hover) and (pointer: fine) {
    body {
        cursor: url("../images/homebites-chef-cursor.svg?v=2") 6 2, auto;
    }

    :is(a[href], button, summary, [role="button"], .nav-link, .add-btn):not(:disabled):not([aria-disabled="true"]) {
        cursor: url("../images/homebites-chef-cursor.svg?v=2") 6 2, pointer;
    }

    :is(input, textarea, [contenteditable="true"]) {
        cursor: auto;
    }

    :is(button, input, select, textarea):disabled,
    [aria-disabled="true"] {
        cursor: not-allowed;
    }
}

:is(.main-content, .layout > main, .dashboard-container > main) {
    min-width: 0;
}

:is(.sidebar, .guest-navbar) {
    background: var(--hb-nav-gradient);
    border-right: 1px solid #f5dfc2;
    box-shadow: 4px 0 24px rgb(18 78 73 / 5%);
}

.sidebar {
    background: var(--hb-nav-gradient);
    border-right-color: #f5dfc2;
    box-shadow: none;
}

.dashboard-container:has(.cart-sidebar) > .sidebar {
    background: var(--hb-nav-gradient) !important;
}

.sidebar :is(.nav-link, .nav a) {
    --hb-icon-color: #c86213;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--hb-ink);
    display: flex;
    font-size: 13px;
    font-weight: 500;
    gap: 12px;
    line-height: 1.5;
    min-height: 48px;
    padding: 10px 14px;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.sidebar :is(.nav-link, .nav a):hover {
    background: #ffffff80;
    border-color: transparent;
    color: var(--hb-brand);
}

.sidebar :is(.nav-link, .nav a).active {
    background: var(--hb-action-gradient);
    border-color: transparent;
    box-shadow: 0 5px 14px rgb(255 104 42 / 20%);
    color: #fff;
    font-weight: 650;
}

.sidebar :is(.nav-menu, .nav) {
    display: grid;
    gap: 4px;
    list-style: none;
    padding: 8px 0 16px;
}

.sidebar .nav-item {
    margin: 0;
}

.sidebar .nav-menu .nav-link {
    margin: 0 10px;
}

.sidebar :is(.nav-link > i:first-child, .nav a > i:first-child, .nav-icon) {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--hb-icon-color);
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 15px;
    height: 24px;
    justify-content: center;
    margin: 0;
    width: 22px;
}

.sidebar :is(.nav-link.active > i:first-child, .nav a.active > i:first-child, .nav-link.active .nav-icon) {
    background: transparent;
    border-color: transparent;
    color: #fff;
}

.sidebar :is(.nav-link:not(.active):hover > i:first-child, .nav a:not(.active):hover > i:first-child, .nav-link:not(.active):hover .nav-icon) {
    color: var(--hb-icon-color);
}

.sidebar :is(.nav-link, .nav a) .nav-arrow {
    color: #c86213;
    font-size: 9px;
    margin-left: auto;
    opacity: .65;
}

.sidebar :is(.nav-link, .nav a).active .nav-arrow {
    color: #fff;
}

.sidebar :is(.nav-link, .nav a):not(.active):hover .nav-arrow {
    color: var(--hb-brand);
}

.sidebar .sidebar-header {
    border-bottom-color: #f5dfc2;
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.sidebar :is(.sidebar-logo, .brand-logo) img {
    max-width: 100%;
    object-fit: contain;
}

.sidebar :is(.sidebar-logo, .brand-logo) {
    position: relative;
}

.sidebar :is(.sidebar-logo, .brand-logo)::before,
.sidebar :is(.sidebar-logo, .brand-logo)::after {
    background: #ff9a30;
    clip-path: polygon(50% 0%, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0% 50%, 38% 36%);
    content: "";
    height: 14px;
    pointer-events: none;
    position: absolute;
    right: 15%;
    top: 12%;
    width: 14px;
}

.sidebar :is(.sidebar-logo, .brand-logo)::after {
    background: #f7bb66;
    height: 9px;
    left: 16%;
    right: auto;
    top: 65%;
    width: 9px;
}

.sidebar.is-collapsed :is(.sidebar-logo, .brand-logo)::before,
.sidebar.is-collapsed :is(.sidebar-logo, .brand-logo)::after {
    display: none;
}

.sidebar :is(.customer-name, .owner-name, .store-info-title) {
    color: #526078;
}

.sidebar .customer-name {
    color: #526078;
}

.sidebar :is(.store-info, .store-card) {
    background: #ffffff80;
    border: 1px solid #f5dfc2;
    border-radius: 10px;
    box-shadow: none;
    margin-bottom: 18px;
    padding: 16px;
}

.sidebar .store-info-title {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.sidebar .store-name {
    color: var(--hb-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.sidebar .owner-name {
    font-size: 12px;
    margin-top: 5px;
}

.sidebar :is(.store-card small, .store-card em) {
    color: #526078;
}

.auth-sidebar :is(.sidebar-logo p, .benefit-content p) {
    color: var(--hb-muted);
}

.auth-sidebar .benefit-content h3 {
    color: var(--hb-ink);
}

.guest-navbar .navbar-brand {
    color: var(--hb-ink);
}

.sidebar .logout-section {
    background: #ffe0ad;
    border-top-color: #f5dfc2;
}

.sidebar :is(.btn-logout, .logout-btn, .logout) {
    background: var(--hb-action-gradient);
    border-color: transparent;
    color: #fff;
}

.sidebar :is(.btn-logout, .logout-btn, .logout):hover {
    background: linear-gradient(110deg, #e84625, #f49b32);
    color: #fff;
}

.sidebar .app-sidebar-toggle {
    border-color: #eadfcf;
    color: #aa4f2b;
    right: 8px;
}

.sidebar .app-sidebar-toggle:hover {
    background: #aa4f2b;
    color: #fff;
}

:is(.main-content, .layout > main) :is(h1, .content-title, .header-title) {
    color: var(--hb-ink);
    font-size: clamp(25px, 2.6vw, 34px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.2;
}

:is(.welcome-message, .heading > p, .page-subtitle, .form-subtitle) {
    color: var(--hb-muted);
    line-height: 1.6;
}

:is(.main-content, .layout > main) :is(.section, .panel, .stat-card, .menu-section, .form-container, .order-card, .menu-card) {
    background-color: #fff;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
}

.main-content > .header {
    background: #fff;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
}

.stat-card {
    position: relative;
}

.stat-card .stat-icon {
    color: var(--hb-brand);
}

.stat-card :is(.stat-value, .stat-number) {
    color: var(--hb-ink);
    letter-spacing: -.025em;
}

:is(.stat-label, .info-label) {
    color: var(--hb-muted);
}

:is(.section-title, .menu-title, .panel-heading strong) {
    color: var(--hb-ink);
    letter-spacing: -.015em;
}

:is(.panel-heading, .menu-header, .card-header) {
    border-bottom-color: var(--hb-line);
}

:is(.btn-primary, .btn-login, .btn-register, .btn-submit, .btn-save, .checkout-btn, .btn-confirm) {
    background: var(--hb-action-gradient);
    border-color: transparent;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgb(185 67 32 / 12%);
    color: #fff;
    font-weight: 650;
    min-height: 44px;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

:is(.btn-primary, .btn-login, .btn-register, .btn-submit, .btn-save, .checkout-btn, .btn-confirm):hover {
    background: var(--hb-brand-hover);
    border-color: var(--hb-brand-hover);
    box-shadow: 0 6px 16px rgb(185 67 32 / 18%);
    color: #fff;
}

:is(.btn-secondary, .button, .filter-toggle, .filter-select, .filter-date) {
    border-color: var(--hb-line);
    border-radius: 9px;
}

:is(.btn-logout, .logout-btn, .logout) {
    background: #fff8ec;
    border: 1px solid #dfc8a8;
    border-radius: 10px;
    color: #774b2c;
    min-height: 44px;
}

:is(.btn-logout, .logout-btn, .logout):hover {
    background: #f6e5cc;
    color: #774b2c;
}

:is(.form-control, .form-select, .search-input, .location-search-input, .form-group input:not([type="checkbox"]):not([type="radio"]), .form-group select, .form-group textarea) {
    border: 1px solid #dfd6c8;
    border-radius: 10px;
    font: inherit;
    min-height: 44px;
    min-width: 0;
}

:is(.form-control, .form-select, .search-input, .location-search-input, .form-group input, .form-group select, .form-group textarea):focus {
    border-color: #c18e58;
    box-shadow: 0 0 0 3px rgb(193 142 88 / 12%);
}

:is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid #ac7646;
    outline-offset: 3px;
}

:is(.filters, .menu-filter-bar) {
    border-color: var(--hb-line);
    border-radius: 12px;
}

.filters a.active,
.menu-filter-btn.active {
    background: var(--hb-action-gradient);
    color: #fff;
}

.main-content .menu-container {
    background: linear-gradient(135deg, #fff, #fff8f1);
    box-shadow: none;
}

.main-content .store-header {
    background: linear-gradient(120deg, #fff, #fff3df);
    color: var(--hb-ink);
    box-shadow: 0 4px 18px rgb(190 103 43 / 8%);
    padding: 24px 24px;
}

.main-content .store-header h1 {
    gap: 12px;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.main-content .store-header :is(.store-cuisine-tags, .store-status-social-row, .store-social-links) {
    margin-top: 10px;
}

.main-content .store-header .store-social-link {
    height: 44px;
    width: 44px;
}

.main-content .store-header p {
    color: var(--hb-muted);
}

.main-content .store-cuisine-tag {
    background: #fff3df;
    border-color: #efc99c;
    color: var(--hb-ink);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.main-content .menu-section,
.cart-sidebar .cart-section {
    border-left: 4px solid #ff922b;
}

.main-content :is(.category-title, .menu-item-name) {
    color: var(--hb-ink);
}

.main-content .menu-item {
    background: linear-gradient(110deg, #fffaf5, #fff5eb);
    border: 1px solid var(--hb-line);
    border-radius: 12px;
}

.main-content .pickup-date-group {
    background: #fff8f1;
    border-color: var(--hb-line);
}

.main-content .pickup-date-group > summary {
    color: var(--hb-brand);
}

.cart-sidebar .cart-section {
    background: #fff;
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
}

:is(.cart-header, .cart-total, .add-btn:not(:disabled):not(.sold-out-button)) {
    background: var(--hb-action-gradient);
    color: #fff;
}

.cart-header .cart-item-count {
    color: var(--hb-brand);
}

.cart-empty {
    color: var(--hb-muted);
}

.checkout-btn:disabled,
.checkout-btn:disabled:hover {
    background: #d9d9d9;
    box-shadow: none;
    color: #59616c;
    cursor: not-allowed;
}

.food-preview-trigger {
    padding: 0;
    font: inherit;
}

.food-preview-trigger:focus-visible {
    outline: 3px solid var(--hb-brand);
    outline-offset: 3px;
}

.food-image-preview {
    background: #fff8f1;
    border: 1px solid var(--hb-line);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgb(34 50 74 / 25%);
    color: var(--hb-ink);
    margin: 0;
    max-height: calc(100dvh - 24px);
    max-width: calc(100vw - 24px);
    overflow: auto;
    padding: 0;
    position: fixed;
    width: 360px;
    z-index: 10000;
}

.food-image-preview:modal {
    margin: auto;
    width: 480px;
}

.food-image-preview::backdrop {
    background: rgb(20 30 45 / 60%);
}

.food-image-preview-close {
    background: #fff;
    border: 1px solid var(--hb-line);
    border-radius: 50%;
    color: var(--hb-ink);
    font-size: 26px;
    height: 44px;
    position: absolute;
    right: 8px;
    top: 8px;
    width: 44px;
}

.food-image-preview-media {
    align-items: center;
    background: var(--hb-pale);
    display: flex;
    justify-content: center;
    min-height: 160px;
}

.food-image-preview-media img {
    display: block;
    max-height: 45dvh;
    object-fit: contain;
    width: 100%;
}

.food-image-preview-media span {
    font-size: 80px;
}

.food-image-preview-details {
    overflow-wrap: anywhere;
    padding: 16px;
}

.food-image-preview-details h2 {
    font-size: 20px;
    margin: 0 0 8px;
}

.food-image-preview-details p {
    color: var(--hb-muted);
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}

.pickup-schedule {
    background: #fff8f1;
    border: 1px solid var(--hb-line);
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 16px;
}

.pickup-schedule label {
    color: var(--hb-ink);
    display: block;
    font-weight: 650;
    margin-bottom: 8px;
}

.pickup-schedule p {
    color: var(--hb-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0;
}

.pickup-schedule input,
.pickup-schedule select {
    background: #fff;
    border: 1px solid #dfd6c8;
    border-radius: 8px;
    color: var(--hb-ink);
    font: inherit;
    min-height: 44px;
    min-width: 0;
    padding: 10px;
    width: 100%;
}

.pickup-schedule #pickupScheduleError,
.pickup-schedule #orderAheadPickupConflict {
    color: #a52c21;
}

:is(.menu-card, .order-card, .form-container, .modal-content, .payment-modal-content) {
    border-radius: var(--hb-radius);
}

:is(.order-card, .menu-card):hover {
    box-shadow: 0 12px 30px rgb(28 43 69 / 9%);
}

:is(.login-form, .auth-form-container, .register-form) {
    background: linear-gradient(135deg, #fff, #fff8f1);
}

.auth-sidebar {
    background: var(--hb-nav-gradient);
    color: var(--hb-ink);
}

:is(.form-title, .form-header h2) {
    color: var(--hb-ink);
    letter-spacing: -.035em;
}

.bottom-nav {
    border-top-color: var(--hb-line);
    box-shadow: 0 -4px 20px rgb(28 43 69 / 6%);
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .main-content .store-header {
        padding: 18px 16px;
    }

    .dashboard-container:has(> main.main-content) {
        flex-direction: column;
    }

    @media (max-width: 480px) {
        .main-content .store-header {
            padding: 16px 12px;
        }

        .main-content .store-header h1 {
            font-size: 24px;
            gap: 8px;
        }

        .main-content .store-header .store-image-header {
            height: 48px;
            width: 48px;
        }

        .main-content .store-header :is(.store-cuisine-tags, .store-status-social-row, .store-social-links) {
            gap: 6px;
            margin-top: 8px;
        }
    }

    @media (min-width: 481px) and (max-width: 1024px) {
        .dashboard-container:has(.cart-sidebar) > .main-content {
            flex: 0 1 auto !important;
            min-width: 0;
            width: calc(100% - 250px);
        }

        .dashboard-container:has(.cart-sidebar) .menu-container {
            grid-template-columns: minmax(0, 1fr);
        }

        .dashboard-container:has(.cart-sidebar) .cart-sidebar {
            height: auto !important;
            min-height: 0 !important;
            position: static !important;
            width: 100% !important;
        }

    }

    :is(.content-header, .main-content > .header, .heading) {
        flex-wrap: wrap;
        gap: 14px;
    }

    :is(.content-header, .main-content > .header, .heading) > * {
        min-width: 0;
    }

    :is(.header-actions, .menu-search) {
        flex-wrap: wrap;
        min-width: 0;
    }

    .main-content :is(.section, .panel, .stat-card, .form-container) {
        border-radius: 12px;
    }

    .main-content .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    }

    .main-content .profile-info {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    }

    .bottom-nav :is(a, button) {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
