:root {
    --bg: #f4f7ff;
    --bg-2: #eef3ff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #3b82f6;
    --primary-2: #2563eb;
    --card: rgba(255, 255, 255, 0.86);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 14px 40px rgba(37, 99, 235, 0.18);
    --radius: 18px;
    --sidebar-width: 280px;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background:
        radial-gradient(circle at 10% 10%, #dbeafe 0%, transparent 30%),
        radial-gradient(circle at 90% 0%, #d1fae5 0%, transparent 35%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

#page-content-wrapper main {
    animation: pageFade 0.45s ease;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Styles */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 999;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
}

#sidebar-wrapper .sidebar-heading a {
    color: white !important;
    font-size: 1.2rem;
}

#sidebar-wrapper .list-group {
    width: var(--sidebar-width);
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    color: var(--text);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#sidebar-wrapper .list-group-item:hover {
    background: #f8fafc;
    border-left-color: var(--primary);
    padding-left: 1.5rem;
}

#sidebar-wrapper .list-group-item.active {
    background: #eff6ff;
    color: var(--primary-2);
    border-left-color: var(--primary);
    font-weight: 600;
}

#sidebar-wrapper .list-group-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-user-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1));
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

#page-content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
}

/* Toggled State */
#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(var(--sidebar-width) * -1);
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0;
}

/* Top Bar */
#page-content-wrapper .navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
    padding: 0.75rem 1.5rem;
}

#sidebarToggle {
    border: 1px solid #1d4ed8;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

#sidebarToggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
}

#sidebarToggle:focus,
#sidebarToggle:active {
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    border-color: #1e3a8a;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.35);
}

/* Guest Top Navigation */
.navbar.sticky-top {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.navbar-brand {
    letter-spacing: 0.2px;
}

.navbar .nav-link {
    border-radius: 10px;
    transition: all 0.22s ease;
}

.navbar .nav-link:hover {
    background: #eaf2ff;
    color: var(--primary-2) !important;
}

.card-soft {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius);
    background: var(--card);
    backdrop-filter: blur(7px);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-soft:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.hero {
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.2), transparent 30%),
        linear-gradient(130deg, #2563eb, #3b82f6 40%, #0ea5e9);
    color: #fff;
    border-radius: calc(var(--radius) + 2px);
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3);
}

.sidebar {
    min-height: calc(100vh - 90px);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.rating-stars {
    color: #ffb703;
}

.chatbot-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    z-index: 1000;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    border: 0;
    background: linear-gradient(145deg, #2563eb, #0ea5e9);
    animation: fabPulse 2.2s ease-in-out infinite;
}

.modal-dialog-bottom-right {
    position: fixed;
    right: 18px;
    bottom: 92px;
    margin: 0;
    width: min(360px, calc(100vw - 24px));
    max-width: 360px;
}

#chatbotModal .modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
}

@keyframes fabPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.chat-messages {
    height: 320px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    animation: msgIn 0.25s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.user {
    background: #dbeafe;
    text-align: right;
}

.chat-msg.bot {
    background: #e2e8f0;
}

.category-tile {
    cursor: pointer;
    user-select: none;
    display: block;
}

.category-card {
    border-radius: 16px !important;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.category-tile:hover .category-card {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
}

.category-tile.active .category-card {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.08));
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.category-icon {
    font-size: 2.5rem;
    line-height: 1;
    transform: translateY(0);
    transition: transform 0.2s ease;
}

.category-tile:hover .category-icon {
    transform: translateY(-3px) scale(1.1);
}

.category-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.category-tile.active .category-name {
    color: var(--primary-2);
}

.featured-image {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.product-image-wrap {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.product-desc {
    min-height: 40px;
}

.empty-state {
    border-style: dashed;
}

.empty-emoji {
    font-size: 3.2rem;
    margin-bottom: 8px;
}

.register-shell {
    padding-top: 8px;
}

.register-card {
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.business-head {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(14, 165, 233, 0.10));
    border: 1px solid rgba(59, 130, 246, 0.22);
}

.accordion-item {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 10px;
}

.accordion-button {
    font-weight: 600;
    background: #f8fbff;
}

.accordion-button:not(.collapsed) {
    color: #1d4ed8;
    background: #edf4ff;
    box-shadow: inset 0 -1px 0 rgba(59, 130, 246, 0.1);
}

.accordion-body {
    background: #fff;
}

.btn {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.table {
    border-radius: 14px;
    overflow: hidden;
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
        box-shadow: 8px 0 30px rgba(2, 6, 23, 0.25);
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }

    #wrapper.toggled .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    .hero {
        padding: 2rem 1.25rem;
    }

    .card-soft:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    #page-content-wrapper main {
        padding: 1rem !important;
    }

    #sidebar-wrapper {
        min-width: 250px;
        max-width: 250px;
    }

    #sidebar-wrapper .list-group {
        width: 250px;
    }

    #page-content-wrapper .navbar {
        padding: 0.6rem 0.75rem;
    }

    #sidebarToggle {
        padding: 0.45rem 0.65rem;
        font-size: 1.15rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .card-soft {
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        padding: 0.9rem !important;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 0.98rem;
    }

    .chatbot-fab {
        width: 58px;
        height: 58px;
        right: 14px;
        bottom: 14px;
    }

    .modal-dialog-bottom-right {
        right: 10px;
        bottom: 82px;
        width: calc(100vw - 20px);
        max-width: 360px;
    }

    .chat-messages {
        height: 270px;
    }

    .table {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        white-space: nowrap;
        vertical-align: middle;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 4px;
    }

    .category-icon {
        font-size: 1.7rem;
    }

    .category-name {
        font-size: 0.78rem;
    }

    .featured-image {
        height: 150px;
    }

    .hero {
        padding: 1.25rem !important;
    }

    .hero .display-6,
    .hero h1 {
        font-size: 1.35rem;
        line-height: 1.25;
    }

    .alert {
        font-size: 0.92rem;
        padding: 0.7rem 0.8rem;
    }

    .d-flex.justify-content-between {
        gap: 0.5rem;
    }

    .product-image-wrap {
        height: 140px;
    }

    form.d-flex {
        flex-wrap: wrap;
    }

    form.d-flex .form-control {
        min-width: 100%;
    }

    .badge {
        font-size: 0.72rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .accordion-button {
        font-size: 0.95rem;
        padding: 0.8rem 0.9rem;
    }
}

@media (max-width: 576px) {
    #sidebar-wrapper {
        min-width: 230px;
        max-width: 230px;
    }

    #sidebar-wrapper .list-group {
        width: 230px;
    }

    .card-soft {
        border-radius: 12px;
    }

    .table {
        font-size: 0.84rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
        font-size: 0.93rem;
    }

    .chatbot-fab {
        width: 54px;
        height: 54px;
    }

    .category-icon {
        font-size: 1.45rem;
    }

    .featured-image {
        height: 130px;
    }

    .product-image-wrap {
        height: 130px;
    }

    .avatar-circle {
        width: 36px;
        height: 36px;
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

