/* ====================================================
   Slider
   ==================================================== */

/* Reduce from full-screen height to a proportional banner height */
@media (min-width: 1200px) {
    .banner-wrapper-item {
        min-height: 500px !important;
        margin-left: 0 !important;
    }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .banner-wrapper-item {
        min-height: 420px !important;
    }
}

/* Text position: right */
.banner-wrapper-item.text-right .banner-content {
    text-align: right;
    margin-left: auto;
    margin-right: 0;
}

/* Text position: center */
.banner-wrapper-item.text-center .banner-content {
    text-align: center;
    margin: 0 auto;
}

/* Text position: left */
.banner-wrapper-item.text-left .banner-content {
    text-align: left;
    margin-right: auto;
    margin-left: 0;
}

/* ====================================================
   Base font size for entire client/front panel */
html, body,
p, li, div,
input, select, textarea, button,
h1, h4, h5, h6 {
    font-size: 13px !important;
    font-family: var(--main-font), sans-serif !important;
}

/* Badge font size — override the global span rule */
.badge {
    font-size: 11px !important;
}

/* Login/user avatar icon in header — make it smaller */
.sign-in > a {
    width: 32px !important;
    height: 32px !important;
}
img.img-fluid.user {
    width: 32px !important;
    height: 32px !important;
    object-fit: cover;
}

/* Button icons — inherit size from button, don't let global rule force 13px */
.btn i, .btn svg {
    font-size: inherit !important;
    line-height: 1 !important;
}

/* Select2 Styling */
.select2-container .select2-selection--single {
    height: 35px !important;
    padding: 0px 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 35px !important;
    padding-left: 0;
    padding-right: 40px;
    color: #0b0b0b;
    font-size: 13px;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 33px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    margin-top: -1px;
}

/* Fix Select2 clear button alignment */
.select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    height: auto;
    padding: 0;
    margin: 0;
}

.select2-container--default.select2-container--allowclear .select2-selection--single .select2-selection__rendered {
    padding-right: 60px;
}


/* Admin-style form controls */
.form-control {
    height: 35px;
    padding: 0.375rem 0.75rem;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Admin-style add button */
.add-btn {
    background: #2d3274 !important;
    padding: 7px 15px;
    color: #fff !important;
    font-size: 14px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
}

.add-btn:hover {
    background: #2d3274 !important;
    color: #fff !important;
    text-decoration: none;
    opacity: 0.9;
}

/* Form labels */
.form-group label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 14px;
}

/* Button height fix */
.btn {
    height: 35px;
    padding: 0.375rem 0.75rem;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Badge color classes (Bootstrap 4 compatibility for Bootstrap 5) */
.badge-secondary {
    background-color: #868e96 !important;
    color: #fff !important;
}

.badge-primary {
    background-color: #7367f0 !important;
    color: #fff !important;
}

.badge-success {
    background-color: #28c76f !important;
    color: #fff !important;
}

.badge-danger {
    background-color: #ea5455 !important;
    color: #fff !important;
}

.badge-warning {
    background-color: #f99f0b !important;
    color: #fff !important;
}

.badge-info {
    background-color: #1e9ff2 !important;
    color: #fff !important;
}

.badge-dark {
    background-color: #192a56 !important;
    color: #fff !important;
}

/* Pagination fix (override theme styles.php conflicts) */
.page-item.active .page-link {
    background-color: #2d3274 !important;
    border-color: #2d3274 !important;
    color: #fff !important;
}

a.page-link:hover {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #2d3274 !important;
}

a.page-link {
    color: #2d3274 !important;
}

/* Select2 dropdown list — fix font size & family for open dropdown options */
.select2-dropdown,
.select2-results__option,
.select2-results__option--highlighted,
.select2-search--dropdown .select2-search__field {
    font-size: 13px !important;
    font-family: var(--main-font), sans-serif !important;
}

/* Table font fix — covers plain Bootstrap tables and DataTables */
table,
table th,
table td,
table.dataTable,
table.dataTable th,
table.dataTable td,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    font-size: 13px !important;
    font-family: var(--main-font), sans-serif !important;
}

/* Dropdown fix for mobile — override template.css transparent background */
@media (max-width: 991.98px) {
    .table-responsive .dropdown-menu,
    .table .dropdown-menu {
        background-color: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
        padding: 0.25rem 0;
    }
    .table-responsive .dropdown-item,
    .table .dropdown-item {
        color: #1f2937;
    }
    .table-responsive .dropdown-item:hover,
    .table-responsive .dropdown-item:focus,
    .table .dropdown-item:hover,
    .table .dropdown-item:focus {
        color: #111827;
        background-color: #f3f4f6;
    }
}

/* ====================================================
   DataTables Overrides — User Panel
   ==================================================== */

/* Fix dark blue thead forced by datatables.css (background: #0275d8) */
.table-responsive .table thead tr,
.dataTables_wrapper .table thead tr {
    background: #f8f9fa !important;
}
.table-responsive .table thead tr th,
.dataTables_wrapper .table thead tr th {
    color: #495057 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

/* Fix checkboxes hidden by style.css (color: transparent hides checkmark) */
.dataTables_wrapper input[type="checkbox"],
input[type="checkbox"].order-checkbox,
#select-all-orders {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    color: inherit !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

/* DataTables Export/Print buttons — match admin style (outlined, not big blue) */
.dt-buttons .btn.btn-primary {
    background: #f0f0f0 !important;
    color: #495057 !important;
    border: 1px solid #ced4da !important;
    box-shadow: none !important;
    font-size: 13px !important;
    height: 32px !important;
    padding: 0 12px !important;
}
.dt-buttons .btn.btn-primary:hover {
    background: #e2e6ea !important;
    color: #212529 !important;
    border-color: #b8bcc0 !important;
}

/* =============================================================
   Mega Menu - Global improvements (main nav + sticky header)
   ============================================================= */

/* 5 columns on XL+ instead of four */
@media (min-width: 1200px) {
    .dropdown-menu.mega-dropdown-menu .row > * {
        flex: 0 0 20% !important;
        max-width: 20% !important;
    }
}

/* Breathing room on sub-category links + transition for hover nudge */
.dropdown-menu.mega-dropdown-menu .row .col > ul > li > a.dropdown-item {
    padding: 7px 12px;
    line-height: 1.5;
    display: block;
    transition: color .15s ease, padding-left .15s ease;
}

/* Hover: left nudge on sub-items; color comes from styles.php a:hover */
.dropdown-menu.mega-dropdown-menu .row .col > ul > li > a.dropdown-item:hover {
    padding-left: 20px;
    background-color: transparent !important;
}

/* Category heading hover — inherit the real theme color from a:hover (styles.php) */
.dropdown-menu.mega-dropdown-menu .row .col > a {
    transition: color .15s ease;
}
.dropdown-menu.mega-dropdown-menu .row .col > a:hover span {
    color: inherit !important;
}

/* Title Case instead of ALL CAPS on category headings */
.dropdown-menu.mega-dropdown-menu .row .col > a span.text-uppercase {
    text-transform: none !important;
    font-weight: 600;
    letter-spacing: 0;
}

/* Limit the inner grid width on very wide screens */
.dropdown-menu.mega-dropdown-menu .mega-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Main nav dropdown — red top border on hover (matches sticky header) */
@media screen and (min-width: 992px) {
    .main-nav .navbar-nav li:hover > ul.dropdown-menu {
        border-top: 2px solid var(--theme-primary-color) !important;
    }
}

/* =============================================================
   Sticky header - remove white from dropdown / header area
   ============================================================= */
@media screen and (min-width: 992px) {
    /* styles.php sets background-color:#fff on .nav-link:hover via
       .nav-primary-hover — override so the header bar stays clean */
    .header-sticky .navbar-nav .nav-link:hover,
    .header-sticky .navbar-nav .nav-link:focus {
        background-color: transparent !important;
    }

    /* Fix: mega-dropdown-menu has margin-top:-4px which causes it to
       overlap the header bar — override to clear the header fully */
    .header-sticky .navbar .navbar-nav li > ul.dropdown-menu.mega-dropdown-menu {
        margin-top: 1px !important;
    }

    /* Hidden state: fully transparent so nothing bleeds into the header */
    .header-sticky .navbar .navbar-nav li > ul.dropdown-menu {
        background-color: transparent !important;
        border-top-color: transparent !important;
        box-shadow: none !important;
        -webkit-transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out !important;
        transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out !important;
    }

    /* Visible state: solid white background, clearly separated from header */
    .header-sticky .navbar .navbar-nav li:hover > ul.dropdown-menu {
        background-color: #ffffff !important;
        border-top: 2px solid var(--theme-primary-color) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    }
}
