:root {
    --primary-blue: #1DA1F2;
    --primary-hover: #1A91DA;
    --background: #F5F8FA;
    --surface: #FFFFFF;
    --text-main: #14171A;
    --text-muted: #657786;
    --border-color: #E1E8ED;
    --radius: 12px;
    --radius-pill: 12px;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[lang="ar"],
html[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}

html[lang="fr"],
html[lang="fr"] body {
    font-family: 'candi', 'Candara', sans-serif;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: 1rem 2.2rem;
    font-size: 1.15rem;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: none !important;
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: 1rem 2.2rem;
    font-size: 1.15rem;
}

.btn-sm {
    padding: 0.6rem 1.4rem !important;
    font-size: 1.05rem !important;
}


.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.form-control,
.form-select {
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(29, 161, 242, 0.25);
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
}

.nav-link {
    color: var(--text-main);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(29, 161, 242, 0.1);
    color: var(--primary-blue);
}

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

/* POS Specific */
.pos-product-card {
    cursor: pointer;
    text-align: center;
    overflow: hidden;
}

.pos-product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.pos-product-card .card-body {
    padding: 8px 10px 10px;
}

.pos-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 161, 242, 0.18);
    border-color: var(--primary-blue) !important;
}

.category-scroll {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.category-scroll::-webkit-scrollbar {
    height: 6px;
}

.category-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.order-panel {
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

.order-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.order-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px;
}

/* Ristora Custom Branding */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 5px 0;
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, #FFB75E 0%, #ED8F03 100%);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(237, 143, 3, 0.35);
    transform: rotate(-5deg);
    transition: all 0.3s ease;
}

.brand-logo:hover .brand-icon-wrapper {
    transform: rotate(5deg) scale(1.05);
}

.brand-icon-wrapper i {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    font-style: italic;
    background: linear-gradient(135deg, #FFB75E, #ED8F03);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    line-height: 1;
}

/* RTL Support */
[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .order-panel {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

/* ============================
   MOBILE SLIDE-IN SIDEBAR
   ============================ */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    z-index: 1055;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
}

.mobile-sidebar.open {
    left: 0;
}

[dir="rtl"] .mobile-sidebar {
    left: auto;
    right: -280px;
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
}

[dir="rtl"] .mobile-sidebar.open {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1054;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ============================
   MOBILE BOTTOM NAVIGATION
   ============================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 1050;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    gap: 4px;
    transition: color 0.2s;
}

.mobile-nav-item i {
    font-size: 1.3rem;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary-blue);
}

/* Add bottom padding to main content on mobile to avoid overlap with bottom nav */
@media (max-width: 767px) {
    body {
        padding-bottom: 70px;
    }

    main {
        padding-bottom: 0;
    }

    /* Smaller brand text on mobile */
    .brand-text {
        font-size: 1.5rem !important;
    }

    .brand-icon-wrapper {
        width: 34px !important;
        height: 34px !important;
    }

    /* Tables - card style on mobile */
    .table-responsive table thead {
        display: none;
    }

    .table-responsive table,
    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 12px;
        background: var(--surface);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    }

    .table-responsive td {
        text-align: right !important;
        padding: 6px 8px !important;
        border: none !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-align: left;
    }

    /* Action buttons row on mobile */
    .table-responsive td:last-child {
        justify-content: flex-end;
        padding-top: 10px !important;
    }

    /* Buttons smaller on mobile */
    .btn-icon {
        width: 40px !important;
        height: 40px !important;
    }

    /* Page headers on mobile */
    .border-bottom.pt-3 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    /* Cards on dashboard */
    .card .card-body h2 {
        font-size: 1.8rem !important;
    }

    /* Report filters on mobile */
    .row.g-3 .col-md-3,
    .row.g-3 .col-md-4,
    .row.g-3 .col-md-2 {
        margin-bottom: 8px;
    }

    /* POS layout on mobile */
    .order-panel {
        height: auto !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color);
    }
}

/* ============================
   RESPONSIVE UTILITIES
   ============================ */
@media (max-width: 576px) {

    .btn-primary,
    .btn-outline-primary {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }

    .btn-sm {
        padding: 0.5rem 1rem !important;
        font-size: 0.95rem !important;
    }

    .modal-dialog {
        margin: 8px;
    }

    .modal-body {
        padding: 1rem !important;
    }

    h1.h2,
    h1 {
        font-size: 1.4rem !important;
    }
}