html {
    box-sizing: border-box;
    /** Scroll */
    -ms-overflow-style: 8px;
    /* IE and Edge */
    scrollbar-width: 8px;
    /* Firefox */
    scrollbar-track-color: var(--secondary);
    scrollbar-base-color: var(--primary);
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary);
    /* color of the tracking area */
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 2px;
    /* color of the scroll thumb */
}

body {
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: "Cairo";
    font-size: 16px;
    font-weight: 500;
    background: var(--body-bg);
    color: var(--body-clr);
}

.container {
    width: 300px;
    min-width: 98%;
}

h1,
h2,
h3 {
    line-height: 40px;
}

h4 {
    line-height: 35px;
}

h5 {
    line-height: 30px;
}

h2,
h3,
h4,
h5,
p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

a,
a:hover {
    text-decoration: none;
    color: inherit;
}

i,
a:hover,
a.show,
a.active {
    color: var(--primary);
}

.btn,
table th,
.nowrap {
    white-space: nowrap;
}

.btn,
select:not([multiple]),
.form-control {
    border-radius: 0 !important;
    font-size: 14px !important;
    height: 38px;
}

textarea.form-control {
    height: unset;
}

.btn-sm {
    font-size: 12px !important;
    height: 25px;
    padding: 3px;
}

i {
    min-width: 25px;
    line-height: 1em;
    text-align: center;
    vertical-align: middle !important;
}

.btn i {
    min-width: 0;
    color: unset !important;
}

.btn-sm i {
    width: unset;
}

.form-control,
select {
    background-color: var(--body-bg) !important;
    color: var(--body-clr) !important;
}

.form-control:focus,
select:focus {
    box-shadow: unset !important;
    border-color: var(--secondary) !important;
    background-color: var(--body-bg);
    color: var(--body-clr);
}

hr,
.vr {
    opacity: 0.15;
}

img {
    direction: ltr;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown {
    position: static;
}

a,
img,
.dropdown-toggle,
.dropdown-item,
.date_picker,
.checkbox {
    cursor: pointer
}

.dropdown-toggle::after {
    content: none;
}

.dropend .dropdown-toggle::after {
    float: inline-end;
    margin: 15px 0;
}

.dropdown-menu {
    background: #fff;
    box-shadow: var(--shadow);
    border: 0;
}

.dropdown-menu,
.dropdown-menu li {
    min-width: min-content !important;
    max-width: 100% !important;
    overflow-wrap: break-word;
}

.dropdown-item {
    color: var(--body-clr) !important;
    min-width: 250px;
    font-size: 14px;
    line-height: 33px;
}

.dropdown-item:hover,
.dropdown-item.active,
.dropdown-item>a:hover,
.dropdown-item>a.active,
.dropdown-item:hover>span,
.dropdown-item:active>span,
.dropdown-item:hover>i,
.dropdown-item.active>i,
.dropend:hover>.dropdown-toggle>i,
.dropend.active>.dropdown-toggle>i,
.dropdown-item:has(.dropdown-item:hover)>i,
.dropdown-item:has(.dropdown-item.active)>i{
    color: var(--body-bg) !important;
    background: var(--primary) !important;
}

.card {
    background: var(--container-bg-primary);
    box-shadow: var(--shadow);
    border: var(--border);
    margin: 1px;
    margin-bottom: 10px !important;
}

.card .card-body {
    padding: 15px 10px;
}

/** Layout **/

.grid-container {
    display: grid;
    grid-template-areas:
        "header"
        "main"
        "footer";
    grid-template-columns: 1fr;
    height: 100%;
}

/** Header **/
header {
    grid-area: header;
    font-size: 15px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1010;
}

header:has(.mystore) {
    background: var(--blue);
    border: var(--blue);
}


header:has(.admin) {
    background: var(--primary);
    border: var(--primary);
}

header:has(.admin),
header:has(.mystore),
header:has(.admin) a:hover,
header:has(.mystore) a:hover,
header:has(.admin) a.show,
header:has(.mystore) a.show {
    color: white;
}


header>div,
header ul:not(.dropdown-menu)>li {
    padding: 0 10px;
    line-height: 55px;
}

header .vr {
    height: 55px;
    vertical-align: bottom;
}

/** Header / Footer **/

header,
footer {
    background: var(--container-bg-primary);
    border: var(--border);
}

header ul:not(.dropdown-menu)>li,
footer ul:not(.dropdown-menu)>li {
    display: inline-block;
}

/** Footer **/

footer {
    grid-area: footer;
    font-size: 15px;
    box-shadow: var(--shadow);
}

footer a:not(.dropdown-item) i {
    border: 1px solid;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 35px !important;
    background: #8a2be2;
    color: #fff !important;
    margin: 5px;
}

/** Main **/
main {
    grid-area: main;
}

main .header {
    font-size: 15px;
    background-color: var(--container-bg-primary);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    padding: 0 10px;
    top: 55px;
    z-index: 1009;
}

main .header div {
    line-height: 50px;
    min-height: 50px;
}

main .header div>div>a {
    padding: 5px 10px;
    text-wrap: nowrap;
}

main .header .dropend:hover>.dropdown-menu {
    display: block;
    top: 0;
}

main .header div>div>a:hover,
main .header div>div>a.show,
main .header div>div>a.active {
    background: var(--body-bg);
    border-bottom: 2px solid;
}

.dark-mode main .header div>div>a:hover,
.dark-mode main .header div>div>a.show,
.dark-mode main .header div>div>a.active {
    background: var(--body-clr);
    color: var(--primary);
}

/* Product Card */
.product .card {
    max-width: 300px;
    min-width: 200px;
}

.product .card .product-image {
    border-radius: 0.375rem 0.375rem 0 0;
}

.product .card .product-code {
    position: absolute;
    border-radius: 0 0 0.375rem 0.375rem;
    top: -1px;
    background-color: var(--secondary);
    width: max-content;
    padding: 5px;
}

.product .card .product-action {
    position: absolute;
    bottom: 0;
    left: 4px;
}

.product .card .product-action .btn {
    height: 50px;
    opacity: 0.95;
}

.product .card .product-view {
    position: absolute;
    bottom: 14px;
    right: 4px;
}

.product .card .product-view small {
    background: rgb(255 255 255 / 80%);
    border-radius: 30px;
    padding: 3px 7px;
    border: 1px solid #adb5bd;
    font-size: 12px;
}

.product .card .product-name {
    font-size: 14.5px;
    height: 48px;
}

.product .card .product-price {
    font-size: 22px;
    height: 30px;
}

.old-price {
    font-size: 12px;
    color: red;
    font-weight: 200;
    text-decoration: line-through;
}

.product .card .product-code,
.product .card .product-qty {
    font-size: 13px;
}

/** Image */
.rounded {
    border-radius: 50% !important;
}

.image-scale-effect {
    position: relative;
    overflow: hidden;
    padding-bottom: 100%;
}

.image-scale-effect img {
    position: absolute;
    max-width: 100%;
    /*max-height: 100%;*/
    top: 50%;
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(-50%);
    -moz-transform: translateX(-50%) translateY(-50%);
    -ms-transform: translateX(-50%) translateY(-50%);
    -o-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
    transition: all 0.4s;
}

.image-scale-effect img:hover {
    -webkit-transform: scale(1.1) translateX(-45%) translateY(-45%);
    -moz-transform: scale(1.1) translateX(-45%) translateY(-45%);
    -ms-transform: scale(1.1) translateX(-45%) translateY(-45%);
    -o-transform: scale(1.1) translateX(-45%) translateY(-45%);
    transform: scale(1.1) translateX(-45%) translateY(-45%);
}

.modal-header {
    background-color: var(--secondary);
}

.modal-content {
    background-color: var(--container-bg-primary);
}

/* Table */
table {
    border-collapse: collapse;
}

table * {
    border-color: var(--primary);
    vertical-align: middle !important;
}

table th,
table td {
    min-width: 50px !important;
    overflow: hidden;
    word-wrap: break-word;
    background: none !important;
}

table img,
.modal img {
    border: var(--border);
}


/* Canvas */
.offcanvas {
    min-width: 100%;
}

.rtl .offcanvas {
    left: 0;
    right: auto;
}


/** Search */
.search-input input {
    padding: 0 55px;
    border: 1px solid var(--secondary);
}

.search-input input:focus {
    /*border-color: #0d6efd !important;*/
}

.search-input i {
    position: absolute;
    z-index: 10;
    top: 50%;
}

.search-input i.remove {
    cursor: pointer;
}

.rtl .form-control.is-invalid,
.rtl .was-validated .form-control:invalid,
.rtl .form-select.is-invalid:not([multiple]):not([size]),
.rtl .form-select.is-invalid:not([multiple])[size="1"],
.rtl .was-validated .form-select:invalid:not([multiple]):not([size]),
.rtl .was-validated .form-select:invalid:not([multiple])[size="1"] {
    padding-right: 0.75rem;
}

/** RTL
.rtl .form-control.is-invalid,
.rtl .was-validated .form-control:invalid {
    background-position: right calc(0.375em + 0.1875rem) center;
}

.rtl .form-select.is-invalid:not([multiple]):not([size]),
.rtl .form-select.is-invalid:not([multiple])[size="1"],
.rtl .was-validated .form-select:invalid:not([multiple]):not([size]),
.rtl .was-validated .form-select:invalid:not([multiple])[size="1"] {
    background-position: right 0.75rem center, center right 2.25rem;
}
*/

/* Paginate */

ul.pagination .page-link,
ul.pagination .active .page-link {
    font-size: 15px;
    padding: 7px 17px !important;
    min-width: 40px !important;
    text-align: center;
    vertical-align: middle;
}

.page-item .page-link {
    background: var(--body-bg);
    color: var(--body-clr);
    border-radius: 0 !important;
    border: var(--border);
}

.page-item.active .page-link {
    background: var(--primary);
    color: var(--body-bg);
}

@media (max-width: 768px) {
    li.page-item {
        display: none;
    }

    .page-item:first-child,
    .page-item:last-child,
    .page-item:nth-child(2),
    .page-item:nth-last-child(2),
    .page-item:has(+ .page-item.active),
    .page-item.active,
    .page-item.active+.page-item,
    .page-item.disabled {
        display: block;
    }

    .page-link {
        padding: 10px !important;
        min-width: 35px !important;
    }
}

/** Custom Checkbox **/
label.checkbox {
    border: 0;
}

input[type="checkbox"] {
    appearance: none;
    background: #fff;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid;
    display: inline-grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
}

input[type="checkbox"]:checked::before {
    background: var(--primary);
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"].text-primary:checked::before {
    background: var(--bs-primary);
}

input[type="checkbox"].text-secondary:checked::before {
    background: var(--bs-secondary);
}

input[type="checkbox"].text-success:checked::before {
    background: var(--bs-success);
}

input[type="checkbox"].text-info:checked::before {
    background: var(--bs-info);
}

input[type="checkbox"].text-warning:checked::before {
    background: var(--bs-warning);
}

input[type="checkbox"].text-danger:checked::before {
    background: var(--bs-danger);
}

input[type="checkbox"].text-dark:checked::before {
    background: var(--bs-dark);
}

input[type="checkbox"].text-violet:checked::before {
    background: var(--primary);
}

/** alert **/
.alert-dismissible .btn-close {
    right: auto;
    font-size: 12px;
}

/** owl-carousel **/
.owl-carousel {
    width: 95%;
    margin: auto;
}

.owl-nav {
    font-size: 70px;
    position: absolute;
    top: calc(50% - 60px);
    width: calc(100% + 60px);
    right: 0;
    display: flex;
    justify-content: space-between;
    margin: 0 -30px;
    z-index: -1;
}

.owl-next,
.owl-prev {
    line-height: 120px;
}

.owl-dots {
    display: none;
}
