/* Custom CSS for sidebar enhancements */

/* ====== AUTH: QUICK LOGIN BUTTONS (match template social buttons) ====== */
.login-wrapper .login-content .form-sociallink ul li button {
    color: #212B36;
    width: 100%;
    border: 1px solid rgba(145, 158, 171, 0.23);
    background: #fff;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    justify-content: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    border-radius: 10px;
    margin: 0 10px 0 0;
    padding: 15px 53px;
    font-weight: 500;
}

.login-wrapper .login-content .form-sociallink ul li button:hover {
    background: #FF9F43;
    color: #fff;
}

.login-wrapper .login-content .form-sociallink ul li button.facebook-logo {
    border-radius: 10px;
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}

.login-wrapper .login-content .form-sociallink ul li button.apple-logo {
    border-radius: 10px;
    background: #000;
    border-color: #000;
    color: #fff;
}

/* ====== GLOBAL FIXES ====== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== SIDEBAR STRUCTURE ====== */
.sidebar,
.sidebars {
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    background: #fff;
    box-shadow: 0 0 13px 0 rgba(82, 63, 105, 0.05);
    transition: all 0.3s ease;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 1000;
}

/* Sidebar inner container */
.sidebar .sidebar-inner,
.sidebars .sidebar-inner {
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0;
    padding-right: 0 !important;
}

/* Slimscroll container - prevent scrollbar from cutting content */
.sidebar .sidebar-inner.slimscroll,
.sidebars .sidebar-inner.slimscroll {
    position: relative !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    height: 100% !important;
    /* Disable slimscroll plugin to use native CSS scrollbar */
    -webkit-overflow-scrolling: touch;
}

/* Hide default scrollbar and use custom one */
.sidebar .sidebar-inner::-webkit-scrollbar {
    width: 6px;
}

.sidebar .sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.sidebar .sidebar-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Firefox scrollbar */
.sidebar .sidebar-inner {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

/* Sidebar menu container */
.sidebar .sidebar-menu,
.sidebar .sidebar-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .sidebar-menu > ul {
    padding-bottom: 20px;
}

/* ====== SUBMENU SECTIONS ====== */
.sidebar .sidebar-menu > ul > li.submenu-open {
    margin-bottom: 0;
}

/* Submenu header styling */
.sidebar .sidebar-menu .submenu-hdr {
    color: #B5B5C3;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 20px 24px 8px;
    margin: 0;
    display: block;
    background: transparent;
    line-height: 1.2;
}

/* First submenu header */
.sidebar .sidebar-menu > ul > li.submenu-open:first-child .submenu-hdr {
    padding-top: 16px;
}

/* ====== MENU ITEMS ====== */
.sidebar .sidebar-menu ul li {
    position: relative;
}

.sidebar .sidebar-menu ul li a {
    padding: 10px 24px;
    display: flex;
    align-items: center;
    color: #000 !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
    position: relative;
    text-decoration: none;
}

/* Hover (normal sidebar) */
body:not(.mini-sidebar) .sidebar .sidebar-menu ul li a:hover {
    background: rgba(254, 159, 67, 0.08);
    color: #000 !important;
    text-decoration: none;
    border-radius: 6px;
    margin: 0 12px;
    padding: 10px 18px;
}

/* Hover (mini sidebar - collapsed) */
body.mini-sidebar .sidebar .sidebar-menu ul li a:hover {
    background: rgba(254, 159, 67, 0.08);
    color: #000 !important;
    text-decoration: none;
}

.sidebar .sidebar-menu ul li a:hover i,
.sidebar .sidebar-menu ul li a:hover svg {
    color: #000 !important;
}

/* Show/paint label on hover only when label is actually visible.
   In mini-sidebar collapsed state, keep labels hidden to avoid white text on white background. */
body:not(.mini-sidebar) .sidebar .sidebar-menu ul li a:hover span {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #000 !important;
}

body.mini-sidebar .sidebar:hover .sidebar-menu ul li a:hover span,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a:hover span {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: #000 !important;
}

/* Menu icons */
.sidebar .sidebar-menu ul li a i,
.sidebar .sidebar-menu ul li a svg {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #B5B5C3;
    transition: all 0.2s ease;
}

/* Menu text */
.sidebar .sidebar-menu ul li a span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

/* ====== ACTIVE MENU STATE ====== */
.sidebar .sidebar-menu ul li a.active {
    background: rgba(254, 159, 67, 0.08);
    color: #000 !important;
    border-radius: 6px;
    margin: 0 12px;
    padding: 10px 18px;
    font-weight: 500;
}

.sidebar .sidebar-menu ul li a.active span {
    color: #000 !important;
}

.sidebar .sidebar-menu ul li a.active i,
.sidebar .sidebar-menu ul li a.active svg {
    color: #000 !important;
}

/* When the template toggles/opens menus it may add `.active` to parent <li>.
   Keep normal (non-active) links readable (black) in that state. */
body:not(.mini-sidebar) .sidebar .sidebar-menu > ul > li.active a:not(.active):not(:hover) {
    color: #000 !important;
}

body:not(.mini-sidebar) .sidebar .sidebar-menu > ul > li.active a:not(.active):not(:hover) span {
    color: #000 !important;
}

/* Same override for mini-sidebar (when the sidebar expands on hover) */
body.mini-sidebar .sidebar .sidebar-menu > ul > li.active a:not(.active):not(:hover) {
    color: #000 !important;
}

/* ====== TABLE FIXES ====== */
/* The template sets `td.action-table-data` to `display:flex`, which can break table-cell layout
   and cause row divider lines to look misaligned. Keep table semantics and flex only inside. */
.table tbody td.action-table-data {
    display: table-cell !important;
}

/* Product list thumbnail sizing (stabilize row height / borders) */
.table tbody td.productimgname a.product-img,
.table tbody td.productimgname a.stock-img.product-img {
    width: 45px;
    height: 45px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    justify-content: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    /* Minor visual nudge to match row divider alignment */
    margin-top: 5px;
}

.table tbody td.productimgname a.product-img img,
.table tbody td.productimgname a.stock-img.product-img img {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover;
    border-radius: 6px;
}

body.mini-sidebar .sidebar .sidebar-menu > ul > li.active a:not(.active):not(:hover) span {
    color: #000 !important;
}

/* ====== MINI SIDEBAR (COLLAPSED) ====== */
body.mini-sidebar .sidebar {
    width: 60px !important;
    min-width: 60px !important;
}

body.mini-sidebar .sidebar .sidebar-menu ul li a span {
    opacity: 0;
    visibility: hidden;
    display: none;
}

/* When DreamsPOS sets expand-menu (hovering sidebar/header while mini-sidebar), show labels again */
body.mini-sidebar.expand-menu .sidebar .sidebar-menu ul li a span {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

body.mini-sidebar.expand-menu .sidebar .sidebar-menu .submenu-hdr {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    padding: 20px 20px 10px !important;
    overflow: visible !important;
}

/* DreamsPOS sets line-height: 0 on labels in expand-menu; that can make our single <span> labels look "gone".
   Force a normal line-height so labels stay visible when expanded. */
.expand-menu .sidebar .sidebar-menu ul > li > a span {
    line-height: 1.5 !important;
}

body.mini-sidebar.expand-menu .sidebar .sidebar-menu ul li a span {
    line-height: 1.5 !important;
}

/* In mini-sidebar collapsed state, labels stay hidden.
   Labels become visible when the sidebar expands on hover (rules below). */

body.mini-sidebar .sidebar .sidebar-menu .submenu-hdr {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    overflow: hidden;
}

body.mini-sidebar .sidebar .sidebar-menu ul li a {
    padding: 12px;
    justify-content: center;
    margin: 0;
}

body.mini-sidebar .sidebar .sidebar-menu ul li a.active {
    margin: 0 5px;
    padding: 12px 8px;
}

body.mini-sidebar .sidebar .sidebar-menu ul li a i,
body.mini-sidebar .sidebar .sidebar-menu ul li a svg {
    margin-right: 0;
}

/* Mini sidebar hover expansion */
body.mini-sidebar .sidebar:hover,
body.mini-sidebar .sidebar.hover-expand {
    width: 260px !important;
    box-shadow: 0 0 20px 0 rgba(82, 63, 105, 0.1);
}

body.mini-sidebar .sidebar:hover .sidebar-menu ul li a span,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a span {
    opacity: 1;
    visibility: visible;
    display: block;
}

body.mini-sidebar .sidebar:hover .sidebar-menu .submenu-hdr,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu .submenu-hdr {
    opacity: 1;
    visibility: visible;
    height: auto;
    padding: 20px 20px 10px;
}

body.mini-sidebar .sidebar:hover .sidebar-menu ul li a,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a {
    padding: 12px 20px;
    justify-content: flex-start;
}

/* Hover styling while the mini sidebar is expanded */
body.mini-sidebar .sidebar:hover .sidebar-menu ul li a:hover,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a:hover {
    border-radius: 6px;
    margin: 0 10px;
    padding: 12px 15px;
}

body.mini-sidebar .sidebar:hover .sidebar-menu ul li a.active,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a.active {
    margin: 0 10px;
    padding: 12px 15px;
}

body.mini-sidebar .sidebar:hover .sidebar-menu ul li a i,
body.mini-sidebar .sidebar:hover .sidebar-menu ul li a svg,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a i,
body.mini-sidebar .sidebar.hover-expand .sidebar-menu ul li a svg {
    margin-right: 12px;
}

/* ====== SCROLLBAR STYLING ====== */
.sidebar .sidebar-inner::-webkit-scrollbar {
    width: 5px;
}

.sidebar .sidebar-inner::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.sidebar .sidebar-inner::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 10px;
}

.sidebar .sidebar-inner::-webkit-scrollbar-thumb:hover {
    background: #b1b1b1;
}

/* Filter section improvements */
#filter_inputs .input-blocks {
    margin-bottom: 15px;
}

#filter_inputs .input-blocks label.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1B2559;
}

#filter_inputs .input-blocks .select2-container {
    width: 100% !important;
}

#filter_inputs .input-blocks select.select {
    width: 100%;
    padding-left: 12px;
}

/* Remove info-img icons in filter */
#filter_inputs .input-blocks .info-img {
    display: none;
}

/* Button group styling */
#filter_inputs .btn-filters,
#filter_inputs .btn-danger {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#filter_inputs .btn-filters {
    background: #FE9F43;
    border-color: #FE9F43;
    color: #fff;
}

#filter_inputs .btn-filters:hover {
    background: #ff8c1a;
    border-color: #ff8c1a;
}

#filter_inputs .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

#filter_inputs .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

#filter_inputs .d-flex.gap-2 {
    gap: 10px !important;
}

/* Ensure Select2 dropdown doesn't have icon overlap */
.select2-container--default .select2-selection--single {
    padding-left: 12px;
    height: 42px;
    border: 1px solid #E5E5E5;
    border-radius: 5px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* POS modal: keep Select2 within modal and sized correctly */
.pos-modal .select2-container {
    width: 100% !important;
}

.pos-modal .select2-container {
    flex: 1 1 auto;
    min-width: 0;
}

.pos-modal .select2-dropdown {
    z-index: 1060;
}

/* POS modal: keep dropdown list from overflowing the modal */
.pos-modal .select2-results__options {
    max-height: 220px;
    overflow-y: auto;
}

/* POS payment methods: show active selection (theme matches hover state) */
aside.product-order-list .payment-method .methods .default-cover.active {
    background-color: #eff2f7;
    border-color: #FF9F43;
}

aside.product-order-list .payment-method .methods .default-cover.active a {
    border: 1px solid #FF9F43;
    border-radius: 8px;
}

aside.product-order-list .payment-method .methods .default-cover.active img {
    filter: invert(75%) sepia(66%) saturate(1955%) hue-rotate(327deg) brightness(103%) contrast(102%);
}

/* POS: compact right panels (cart + payment) */
.pos-design .pos-wrapper {
    align-items: stretch;
}

.pos-design aside.product-order-list {
    display: flex;
    flex-direction: column;
}

/* Sticky panels on desktop to avoid needing to scroll to checkout */
@media (min-width: 992px) {
    .pos-design aside.product-order-list {
        position: sticky;
        top: 12px;
    }
}

/* Make the cart list scroll inside its panel */
.pos-design aside.product-order-list .pos-cart-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pos-design aside.product-order-list .pos-cart-section #cartWrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Payment column: allow content to scroll if very short screen */
.pos-design aside.product-order-list.pos-payment-panel .pos-checkout-footer {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Payment methods: single-row (horizontal) and compact */
.pos-design aside.product-order-list .pos-payment-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pos-design aside.product-order-list .pos-payment-row .payment-method-item a {
    gap: 6px;
    padding: 8px 10px;
}

.pos-design aside.product-order-list .pos-payment-row .payment-method-item img {
    width: 18px;
    height: 18px;
}

.pos-design aside.product-order-list .pos-payment-row .payment-method-item a span {
    white-space: nowrap;
}

/* Ensure sidebar maintains full width when submenu is open */
.sidebar.submenu-open,
.sidebars.submenu-open {
    width: 260px !important;
    min-width: 260px !important;
}

/* Ensure main menu items with active submenu have proper styling */
.sidebar .sidebar-menu > ul > li.submenu-open > a {
    background: rgba(254, 159, 67, 0.08);
    color: #FE9F43;
    border-radius: 5px;
}

.sidebar .sidebar-menu > ul > li.submenu-open > a svg {
    color: #FE9F43;
}

.sidebar .sidebar-menu > ul > li.submenu-open > a span {
    color: #FE9F43;
}

/* Ensure submenu items maintain full width */
.sidebar .sidebar-menu > ul > li.submenu ul {
    width: 100%;
}

/* Active submenu item with background highlight */
.sidebar .sidebar-menu > ul > li.submenu ul li a.active {
    background: rgba(254, 159, 67, 0.05);
    color: #092C4C;
    font-weight: 600;
}

.sidebar .sidebar-menu > ul > li.submenu ul li a.active:after {
    background: #FE9F43;
    border: 2px solid #FDB;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar.submenu-open,
    .sidebars.submenu-open {
        width: 100% !important;
    }
}

@media (max-width: 575px) {
    .sidebar.submenu-open,
    .sidebars.submenu-open {
        width: 100% !important;
    }
}

/* POS: keep product thumbnails small (avoid full-card cover) */
.pos-design .pos-product-thumb {
    width: 50px !important;
    height: 96px !important;
    object-fit: contain !important;
}

/* POS: ensure category carousel nav (prev/next) is visible/clickable */
.pos-design .pos-category .owl-nav {
    top: -45px !important;
    right: 0 !important;
    z-index: 50;
    display: flex !important;
    gap: 6px;
}

/* Owl may add .disabled and hide it; keep buttons visible so user can navigate back */
.pos-design .pos-category .owl-nav.disabled {
    display: flex !important;
}

.pos-design .pos-category .owl-nav button.owl-prev,
.pos-design .pos-category .owl-nav button.owl-next {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* POS: Print Receipt modal should print cleanly (only receipt content) */
@media print {
    /* Thermal receipt defaults (commonly 80mm). Note: actual output also depends on browser/printer driver paper size. */
    @page {
        size: 80mm auto;
        margin: 0;
    }

    body.print-receipt-active * {
        visibility: hidden !important;
    }

    body.print-receipt-active #print-receipt,
    body.print-receipt-active #print-receipt * {
        visibility: visible !important;
    }

    body.print-receipt-active .modal-backdrop {
        display: none !important;
    }

    body.print-receipt-active #print-receipt {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    body.print-receipt-active #print-receipt .modal-dialog {
        width: 80mm;
        max-width: 80mm;
        margin: 0 auto;
    }

    body.print-receipt-active #print-receipt .modal-content {
        border: 0 !important;
        box-shadow: none !important;
    }

    body.print-receipt-active #print-receipt .modal-body {
        padding: 0 !important;
    }

    body.print-receipt-active #print-receipt .thermal-receipt {
        width: 80mm;
        padding: 4mm;
        font-size: 11px;
        line-height: 1.25;
    }

    body.print-receipt-active #print-receipt .thermal-receipt h6 {
        margin-bottom: 4px;
    }

    body.print-receipt-active #print-receipt .thermal-receipt .tax-invoice {
        margin-top: 6px;
        margin-bottom: 6px;
    }

    body.print-receipt-active #print-receipt .thermal-receipt table {
        font-size: 11px;
    }

    body.print-receipt-active #print-receipt .thermal-receipt .btn {
        display: none !important;
    }

    body.print-receipt-active #print-receipt .close {
        display: none !important;
    }
}

/* POS: Add Item modal - make Add to Cart button more defined */
.pos-design #addItemModal .btn.btn-added {
    border: 1px solid #FF9F43;
}

