/* Yalda dark theme: isolated overrides. The light theme and original styles remain untouched. */


html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--yalda-canvas) !important;
    color: var(--yalda-text);
}

html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6, p,strong, a, label, .nav-link, .breadcrumb-item, .dropdown-item) {
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(.text-dark, .text-black, .text-body, .text-body-emphasis, .def-color) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(.text-muted, .text-secondary, .text-body-secondary, .text-muted-two, .breadcrumb-item.active, .form-text, .old-price) {
    color: var(--yalda-muted) !important;
}
html[data-theme="dark"] :is(.text-primary, .main-color-one-color, .main-color-one-color-light) {
    color: var(--main-color-one) !important;
}
html[data-theme="dark"] :is(.text-success, .main-color-three-color) {
    color: #78d990 !important;
}

/* Common elevated surfaces used throughout storefront, checkout and customer dashboard. */
html[data-theme="dark"] :is(
    header, footer, .mobile-footer, .offcanvas, .modal-content, .dropdown-menu,
    .card, .card-header, .card-body, .card-footer, .content-box, .product-box,
    .slider-parent, .blog-item, .filter-items, .feature-item, .ui-box-item,
    .ui-box-white .ui-box-item-desc, .payment-status .pay-table,
    .profile__sidebar__info > div, .auth-form, .table-responsive,
    .blog-menu-level-3, .tab-panel-tbl .nav-tabs button.active,
    .comment .comment-body, .comment .title, .alert-box, .cart-canvas-foots,
    .accordion-item, .accordion-button, .accordion-style .btn-link,
    .top-menu-menu ul.main-menu > li > ul.main-menu-sub, .top-menu-menu ul.level-one > li > ul.level-two
) {
    background-color: var(--yalda-surface) !important;
    border-color: var(--yalda-border);
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(
    .bg-white, .bg-light, .bg-body, .bg-body-secondary, .bg-body-tertiary,
    .btn-white, .bg-ul-f7, .bs-bg-gray-100, .bs-bg-gray-200, .bs-bg-gray-300,
    .bs-bg-gray-400, .accordion-style .btn-link.collapsed, .detail-order,
    .tab-panel-tbl, .box_users_comment.reply, .product-meta-info, .product-header-btn a,
    .product-box .product-action .link, .offer .countdown-container .countdown-value,
    .blog-menu-level-2, .border_right_custom2, .td-head, .form-counter
) {
    background-color: var(--yalda-surface-alt) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .bg-gray, .bg-secondary-subtle, .bs-bg-gray-500, .bs-bg-gray-600,
    .top-menu-menu ul.main-menu > li, .top-menu-menu ul.main-menu li:hover,
    .header-btn-group, .tab-panel-tbl, .comment .title
) {
    background-color: var(--yalda-surface-soft) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .border, .border-top, .border-bottom, .border-start, .border-end,
    .border-light, .border-muted, .border-ui, .border-dashed, .header-btn-group,
    .product-box, .card, .filter-items, .table-bordered, .dropdown-menu,
    .form-control, .form-select, .accordion-item, .comment .comment-body
) {
    border-color: var(--yalda-border) !important;
}

/* The responsive header uses a separately declared solid white background. */
@media (max-width: 992px) {
    html[data-theme="dark"] header {
        background: var(--yalda-surface) !important;
    }
    html[data-theme="dark"] .search-filed .search-input {
        background-color: var(--yalda-surface-alt) !important;
    }
}
html[data-theme="dark"] :is(.search-filed .search-input, .filter-range li input[type="text"]) {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .form-control, .form-select, .form-control:focus, .form-select:focus,
    .form-counter, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    .input-group-text, .tagify, .tagify__input
) {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
    caret-color: var(--yalda-text);
}
html[data-theme="dark"] :is(input, textarea)::placeholder {
    color: var(--yalda-placeholder) !important;
    opacity: 1;
}
html[data-theme="dark"] :is(.form-check-input, .btn-check) {
    accent-color: var(--main-color-one);
}
html[data-theme="dark"] :is(.form-check-input, .form-check-input:not(:checked)) {
    background-color: var(--yalda-surface-alt);
    border-color: var(--yalda-border);
}
html[data-theme="dark"] .form-check-input:checked {
    background-color: var(--main-color-one);
    border-color: var(--main-color-one);
}

/* Bootstrap navigation, tabs, floating panels, dialogs and popovers. */
html[data-theme="dark"] :is(.dropdown-item, .nav-link, .list-group-item, .accordion-button, .modal-title, .offcanvas-title) {
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(.dropdown-item:hover, .dropdown-item:focus, .nav-link:hover, .list-group-item:hover, .accordion-button:not(.collapsed), .page-link:hover) {
    background-color: var(--yalda-surface-soft) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(.list-group, .list-group-item, .page-link, .pagination .page-link, .popover, .toast, .tooltip .tooltip-inner) {
    background-color: var(--yalda-surface) !important;
    border-color: var(--yalda-border);
    color: var(--yalda-text);
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1);
}
html[data-theme="dark"] :is(.nav-tabs, .dropdown-divider, hr, .modal-header, .modal-footer, .offcanvas-header) {
    border-color: var(--yalda-border) !important;
}
html[data-theme="dark"] :is(.btn-light, .btn-outline-light) {
    background-color: var(--yalda-surface-alt);
    border-color: var(--yalda-border);
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(.btn-light:hover, .btn-white:hover, .btn-outline-light:hover) {
    background-color: var(--yalda-surface-soft) !important;
    color: var(--yalda-text) !important;
}

/* Tables and dashboard data: retain row contrast without altering markup. */
html[data-theme="dark"] :is(table, .table, .table-custom table, .main-table, .compare table) {
    --bs-table-bg: var(--yalda-surface);
    --bs-table-color: var(--yalda-text);
    --bs-table-border-color: var(--yalda-border);
    --bs-table-striped-bg: var(--yalda-surface-alt);
    --bs-table-striped-color: var(--yalda-text);
    --bs-table-hover-bg: var(--yalda-surface-soft);
    --bs-table-hover-color: var(--yalda-text);
    color: var(--yalda-text);
    border-color: var(--yalda-border);
}
html[data-theme="dark"] :is(table, .table) :is(th, td) {
    background-color: var(--yalda-surface);
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(.td-head, .main-table tr td.title, .roundedTable th, .compare table tr td:nth-child(1)) {
    background-color: var(--yalda-surface-alt) !important;
    color: var(--yalda-text) !important;
}

/* Product pages, mega menu, profile, reviews, blog and checkout. */
html[data-theme="dark"] :is(
    .product-meta-info, .product-meta-feature, .product-desc, .product-desc-tab-content,
    .filter-item, .filter-price, .shop-feature, .comment-reply, .box-content,
    .single_address, .mini-blog-item, .blog-post-card, .blog-post-card-description,
    .blog-single-content, .blog-card-items, .profile__sidebar, .orders,
    .payment-detail, .cart-canvas-add, .cart-canvas, .order-list--empty,
    .ui-boxs, .product-row-item, .footer-app, .time-work
) {
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(
    .comment-item label.label-float, .product-desc-tab ul li button, .my-paginate li a,
    .pagination.pagination-2 a, .box_users_comment.reply, .box_comment .bc1,
    .product-meta-color-items label:hover, .delivary-payment-bank-item,
    .offer-title, .payment-detail, .comment .title
) {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .profile__sidebar__navigation li a.active, .profile__sidebar__navigation li a:hover,
    .product-desc-tab ul li button.active, .box-tabs .nav-tabs .nav-link.active
) {
    background-color: var(--yalda-surface-soft) !important;
    color: var(--main-color-one) !important;
}
html[data-theme="dark"] :is(.top-menu-menu ul.main-menu li:hover, .rm-item-menu li a:hover, .blog-menu-level-2 a:hover) {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] :is(.rm-item-menu li a, .top-menu-menu ul.level-one li a i, .main-menu-sub-active-li > a, .top-menu-menu ul > li > ul > li > a.title) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(.product-header-btn a:hover, .my-paginate li a:hover, .top-menu-menu ul.main-menu > li:hover) {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] :is(.home-slider .swiper-button-prev, .home-slider .swiper-button-next,
    .free-mode .swiper-button-next, .free-mode .swiper-button-prev,
    .site-slider .swiper-button-next, .site-slider .swiper-button-prev,
    .sugget-Moment .swiper-button-next, .sugget-Moment .swiper-button-prev) {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] :is(.home-slider .swiper-button-prev::after, .home-slider .swiper-button-next::after,
    .free-mode .swiper-button-prev::after, .free-mode .swiper-button-next::after,
    .site-slider .swiper-button-prev::after, .site-slider .swiper-button-next::after) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"] {
    background-color: var(--yalda-surface) !important;
}
html[data-theme="dark"] :is(.tagify, .tagify__dropdown, .tagify__dropdown__wrapper) {
    --tags-border-color: var(--yalda-border);
    --tag-bg: var(--yalda-surface-soft);
    --tag-text-color: var(--yalda-text);
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border);
    color: var(--yalda-text);
}
html[data-theme="dark"] :is(.noUi-target, .noUi-base, .noUi-handle) {
    background-color: var(--yalda-surface-soft);
    border-color: var(--yalda-border);
}
html[data-theme="dark"] :is(.subtitle, .steps .step .step-title, .comment .comment-meta, p.copyright) {
    color: var(--yalda-muted) !important;
}
/* Keep invoices readable on paper regardless of the selected screen theme. */
@media print {
    .yalda-theme-toggle { display: none !important; }
    html[data-theme="dark"] body.bg-white {
        background: #fff !important;
        color: #111 !important;
    }
    html[data-theme="dark"] body.bg-white :is(table, th, td, div, p, span, h1, h2, h3, h4, h5, h6) {
        background-color: transparent !important;
        color: #111 !important;
        border-color: #bbb !important;
    }
}
/* Button is injected into the existing header actions without changing header markup. */
.yalda-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-inline-end: 9px;
    background: #fff;
    border: 1px solid #d6e0eb;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    color: #27364a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}
.yalda-theme-toggle:hover { background: #eef5ff; color: #175bba; }
.yalda-theme-toggle:focus-visible {
    outline: 3px solid #78b0ff;
    outline-offset: 2px;
}
html[data-theme="dark"] .yalda-theme-toggle {
    background: var(--yalda-surface-soft);
    color: #ffcc73;
    border-color: var(--yalda-border);
    box-shadow: none;
}
html[data-theme="dark"] .yalda-theme-toggle:hover { background: #35445b; }
.yalda-theme-toggle--floating {
    position: fixed;
    z-index: 1055;
    top: 16px;
    left: 16px;
    margin: 0;
}
@media (max-width: 576px) {
    .yalda-theme-toggle {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 20px;
        margin-inline-end: 6px;
    }
    .yalda-theme-toggle--floating { top: 10px; left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .yalda-theme-toggle { transition: none; }
}

/* Contrast and authentication refinements */
html[data-theme="dark"] body.bg-auth {
    background-image: linear-gradient(rgba(11, 18, 29, .82), rgba(11, 18, 29, .87)), url("../image/auth-bg.jpg") !important;
    background-size: cover;
}
html[data-theme="dark"] :is(.main-color-one-bg, .btn-primary, .btn-primary-pill) {
    background-color: var(--main-color-one) !important;
    border-color: var(--main-color-one) !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.main-color-one-bg:hover, .btn-primary:hover, .btn-primary-pill:hover) {
    background-color: var(--main-color-one) !important;
    border-color: var(--main-color-one) !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.bootstrap-touchspin-up, .bootstrap-touchspin-down) {
    background-color: var(--main-color-one) !important;
    border-color: var(--main-color-one) !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.main-color-two-bg) {
    background-color: #995309 !important;
    border-color: #995309 !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.main-color-three-bg, .btn-login, .main-color-green) {
    background-color: #216e3d !important;
    border-color: #216e3d !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.main-color-three-bg:hover, .btn-login:hover, .main-color-green:hover) {
    background-color: #195b32 !important;
    border-color: #195b32 !important;
    color: #fff !important;
}


/* Surface audit remediation for all template sections.
   These selectors correspond to original explicit white/light backgrounds that
   cannot be replaced through Bootstrap variables alone. No light-mode rules. */
html[data-theme="dark"] :is(
    .category-card-item, .product-row-item, .quick-select-item-select,
    .offer, .copy-right, .rss_input, .profile__sidebar,
    .single-address-parent, .comment, .comment-replay .title,
    .comments_likes .btn-like, .accordion-style .card-body,
    .bc1 .row, .box_questions .bq2, .nav-tabs-custom,
    .tags.tagify.commentTags, .blog-menu-level-2, .blog-menu-level-3,
    .ui-box-item, .single_address i, .my-paginate li a,
    .blog-post-card, .mini-blog-item,
    .product-desc-tab, .responsive-table, .table-product
) {
    background-color: var(--yalda-surface) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .offer-item-link-item, .offer-title, .ui-box-white .ui-box-item-title,
    .ui-box-item-desc, .input-range-filter,
    .product-meta-color-items label, .product-gallery .swiper-button-next,
    .product-gallery .swiper-button-prev, .icon-product-box-item,
    .box_questions .bq2, .rating:not(:checked) > label::before,
    .steps .step .step-icon, .bg-faded, .comment .title, .comment .comment-body,
    .tab-panel-tbl, .detail-order, .my-paginate li.disabled a,
    .comments_likes .btn-like, .filter-item,
    .rm-items, .rm-item-search input.search-txt
) {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .quick-select-item-select:hover, .product-row-item:hover,
    .category-card-item:hover, .offer-item-link-item:hover,
    .comments_likes .btn-like:hover
) {
    border-color: var(--main-color-one) !important;
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] :is(
    .single_address p, .comment .comment-meta, .comments_likes span,
    .loginTermsDesc, .blog-item-date span, .pagination.pagination-2 a,
    .pagination.pagination-2 span, .offer .countdown-container .countdown-value
) {
    color: var(--yalda-muted) !important;
}
html[data-theme="dark"] :is(
    .product-box-suggest-title, .offer-item-link-item h6,
    .box_questions .bq2, .mini-blog-item .title, .blog-item-date h6
) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .offer .countdown-container .countdown-value, .offer-item-link-item,
    .my-paginate li.disabled a, .my-paginate li a,
    .product-meta-color-items label,
    .delivary-payment-bank-item.active
) {
    background-color: var(--yalda-surface-alt) !important;
}
html[data-theme="dark"] .my-paginate li.active a {
    background-color: var(--main-color-one) !important;
    color: #fff !important;
}
html[data-theme="dark"] .comment.active .comment-body {
    background-color: #203b33 !important;
    border-color: #3a6b52 !important;
}
html[data-theme="dark"] .comment .comment-body {
    background-color: var(--yalda-surface) !important;
}
html[data-theme="dark"] :is(.accordion-style .card-body, .comment-replay .title) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] .image-selector label::before {
    background-color: var(--yalda-surface-alt);
    border-color: var(--yalda-border);
}
html[data-theme="dark"] .image-selector :checked + label::before {
    background-color: var(--main-color-one);
    border-color: var(--main-color-one);
}
/* White-light highlights from the original layout are adapted, but photos,
   product images and decorative brand banners are deliberately never filtered. */
html[data-theme="dark"] .amazing {
/*    background-color: #194274 !important;*/
}
html[data-theme="dark"] .pro-slider::before {
   /* background-color: #194274 !important;*/
}
html[data-theme="dark"] .offer .swiper-pagination-bullet-active {
    background-color: #5d9fff !important;
}
html[data-theme="dark"] .success-label {
    background-color: #193b2c !important;
    color: #97e7b7 !important;
}
html[data-theme="dark"] .danger-label {
    background-color: #4c282b !important;
    color: #ffa2a7 !important;
}
html[data-theme="dark"] .warning-label {
    background-color: #483923 !important;
    color: #ffd99a !important;
}
html[data-theme="dark"] :is(.border, .border-top, .border-bottom, .border-end, .border-start) {
    --bs-border-color: var(--yalda-border);
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background-color: var(--yalda-canvas);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    border-color: var(--yalda-canvas);
}


/* Readability, colored tiles and alert state fixes based on browser audit. */
:root[data-theme="dark"] {
    --bs-gray-600: #b6c3d5;
    --bs-gray-700: #d2dce9;
    --bs-gray-800: #e3eaf4;
    --bs-gray-900: #f5f7fc;
}
html[data-theme="dark"] .mini-box {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(
    .feature-item .feature-desc h6, .offer-title h4,
    .tab-title, .box-tabs ul li a, .box-content h4, .box-content span,
    .box-content .box_list .title, .box_params_list p,
    .box_questions .bq1 .span1, .bq2 .date, .box_list .title,
    .product-rateing .number h2, .comment .comment-title,
    .profile__sidebar__navigation li a, .offer .countdown-container .countdown-heading,
    .countdown-heading, .my-paginate li a i,
    .product-box-suggest-price ins, .cap-icon i,
    .sugget-Moment .swiper-button-prev, .sugget-Moment .swiper-button-next,
    .steps .step .step-icon, .comment .reply-link
) {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] :is(.filter-range li, .product-meta-price .old-price, .box_questions .bq1 .span2) {
    color: var(--yalda-muted) !important;
}
html[data-theme="dark"] :is(.payment-status .title h3, .payment-status .title p, .payment-status .icon i, .order-item-status-item i) {
    color: #6bde91 !important;
}
html[data-theme="dark"] :is(.payment-status.fail-pay .title h3, .payment-status.fail-pay .title p, .payment-status.fail-pay .icon i) {
    color: #ff8b7d !important;
}
html[data-theme="dark"] .sugget-Moment :is(.swiper-button-next, .swiper-button-prev) {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] .feature-icon img {
    filter: brightness(1.65) saturate(1.08);
}
html[data-theme="dark"] .footer-app {
    background-color: #194274 !important;
}
html[data-theme="dark"] .offer-discount span {
    background-color: #24578e !important;
    color: #fff !important;
}
html[data-theme="dark"] .badge.bg-warning {
    background-color: #74500b !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.main-color-two-light-bg, .btn.main-color-two-light-bg) {
    background-color: #87500b !important;
    border-color: #87500b !important;
    color: #fff !important;
}
html[data-theme="dark"] :is(.alert-warning, .alert-success, .alert-danger, .alert-info) {
    border-width: 1px;
    border-style: solid;
}
html[data-theme="dark"] .alert-warning {
    --bs-alert-color: #ffe2a7;
    --bs-alert-bg: #3d3423;
    --bs-alert-border-color: #765d2e;
    background-color: #3d3423 !important;
    color: #ffe2a7 !important;
    border-color: #765d2e !important;
}
html[data-theme="dark"] .alert-success {
    --bs-alert-color: #b4efc6;
    --bs-alert-bg: #21392e;
    --bs-alert-border-color: #3c7053;
    background-color: #21392e !important;
    color: #b4efc6 !important;
    border-color: #3c7053 !important;
}
html[data-theme="dark"] .alert-danger {
    --bs-alert-color: #ffbbc1;
    --bs-alert-bg: #43292e;
    --bs-alert-border-color: #814148;
    background-color: #43292e !important;
    color: #ffbbc1 !important;
    border-color: #814148 !important;
}
html[data-theme="dark"] .alert-info {
    --bs-alert-color: #b8dfff;
    --bs-alert-bg: #23374a;
    --bs-alert-border-color: #41617b;
    background-color: #23374a !important;
    color: #b8dfff !important;
    border-color: #41617b !important;
}
html[data-theme="dark"] .writing .topbar {
    background-color: var(--yalda-surface-soft) !important;
}


/* Final footer / mobile account controls
   The original footer.png belongs exclusively to the light theme. */
html[data-theme="dark"] footer {
    background-image: none !important;
    background-color: var(--yalda-surface) !important;
}
html[data-theme="dark"] .copy-right {
    background-image: none !important;
    background-color: var(--yalda-canvas) !important;
}

/* Compact account control on tablets and phones, in both light and dark modes.
   Keep the original dropdown trigger and items unchanged. */
@media (max-width: 991.98px) {
    header .header-btn-group {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        min-width: 0;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    header .header-btn-group > .dropdown {
        width: 100%;
        height: 100%;
    }
    header .header-btn-group .header-register {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 0 !important;
        border-radius: 50% !important;
        white-space: nowrap;
    }
    header .header-btn-group .header-register > span {
        display: none !important;
    }
    header .header-btn-group .header-register > i {
        display: inline-block;
        margin: 0 !important;
        font-size: 20px;
        line-height: 1;
    }
}
@media (max-width: 576px) {
    header .col-lg-4.col-6.order-lg-3.order-2 > .d-flex {
        flex-wrap: nowrap;
        gap: 4px;
        min-width: 0;
    }
    header .col-lg-4.col-6.order-lg-3.order-2 > .d-flex > .position-relative.me-3 {
        flex: 0 0 36px;
        margin: 0 2px 0 0 !important;
    }
    header .btn-float-cart {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        line-height: 1;
    }
    header .header-btn-group {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }
    header .yalda-theme-toggle {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        margin: 0 !important;
    }
    header .header-logo img {
        max-width: min(26vw, 125px);
        height: auto;
    }
}

/* Dark surfaces for the classic hover dropdown and the floating contact widget.
   Keep all original plugin and menu styles intact in light mode. */
html[data-theme="dark"] :is(
    .mega.active, .mega-menu, .top-menu-menu ul.level-one,
    .top-menu-menu ul.level-one > li > ul.level-two,
    .top-menu-menu ul > li > ul:not(.bg-transparent)
) {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
}
html[data-theme="dark"] .top-menu-menu ul.level-one > li > a,
html[data-theme="dark"] .top-menu-menu ul.level-one > li > a i,
html[data-theme="dark"] .top-menu-menu ul.level-one > li > ul.level-two > li > a,
html[data-theme="dark"] .top-menu-menu ul.level-one > li > ul.level-two > li > a i {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] .top-menu-menu ul.level-one li:hover {
    background-color: var(--yalda-surface-alt) !important;
}
html[data-theme="dark"] .top-menu-menu ul.level-one li:hover > a,
html[data-theme="dark"] .top-menu-menu ul.level-one li:hover > a i {
    color: #ffffff !important;
}
html[data-theme="dark"] .top-menu-menu ul.level-one > li > ul.level-two {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22) !important;
}
html[data-theme="dark"] #btncollapzion ul._child_collapzion {
    background-color: var(--yalda-surface-alt) !important;
    border: 1px solid var(--yalda-border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] #btncollapzion ul._child_collapzion li {
    border-bottom-color: var(--yalda-border) !important;
}
html[data-theme="dark"] #btncollapzion ul._child_collapzion li:hover {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] #btncollapzion ul._child_collapzion li a,
html[data-theme="dark"] #btncollapzion ul._child_collapzion li .float-contact ._title {
    color: var(--yalda-text) !important;
}
/* Retain the contact icon's distinct telephone/Telegram/WhatsApp colors. */
html[data-theme="dark"] #btncollapzion ul._child_collapzion .float-contact .icon i {
    color: #ffffff !important;
}

/* Complete dark megamenu: the original mega-menu.css gives the outer panel,
   column backdrop, active row and inline-image subpanels separate light surfaces. */
html[data-theme="dark"] .top-menu-menu ul.main-menu {
    background-color: var(--yalda-surface-alt) !important;
    border-color: var(--yalda-border) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu > li {
    background-color: var(--yalda-surface-soft) !important;
    border-bottom-color: var(--yalda-border) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu > li > ul.main-menu-sub {
    background-color: var(--yalda-surface) !important;
    background-image: none !important;
    border-color: var(--yalda-border) !important;
}
html[data-theme="dark"] .top-menu-menu li:hover ul.main-menu::before {
    background-color: var(--yalda-surface-soft) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu .main-menu-sub-active-li,
html[data-theme="dark"] .top-menu-menu ul.main-menu > li:hover {
    background-color: #33465c !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu li > a,
html[data-theme="dark"] .top-menu-menu ul.main-menu li > a i,
html[data-theme="dark"] .top-menu-menu ul.main-menu > li:hover > a,
html[data-theme="dark"] .top-menu-menu ul.main-menu > li:hover > a i,
html[data-theme="dark"] .top-menu-menu ul.main-menu .main-menu-sub-active-li > a {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu li > ul.main-menu-sub li > a {
    color: var(--yalda-muted) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu li > ul.main-menu-sub li > a.title,
html[data-theme="dark"] .top-menu-menu ul.main-menu li > ul.main-menu-sub li > a:hover {
    color: var(--yalda-text) !important;
}
html[data-theme="dark"] .top-menu-menu ul.main-menu li > ul.main-menu-sub li > a.title::before {
    background-color: var(--main-color-one) !important;
}

/* Unify every Swiper arrow (hero, product, blog, gallery and small carousels).
   The original arrow pseudo-elements sometimes keep a dark foreground even
   when the dark theme has already changed their circular background. */
html[data-theme="dark"] {
    --swiper-navigation-color: #edf4ff;
    --swiper-theme-color: #72b7ff;
}
html[data-theme="dark"] :is(.swiper-button-next, .swiper-button-prev) {
    background-color: var(--yalda-surface-soft) !important;
    border-color: var(--yalda-border) !important;
    color: #edf4ff !important;
    --swiper-navigation-color: #edf4ff;
}
html[data-theme="dark"] :is(.swiper-button-next, .swiper-button-prev)::after {
    color: #edf4ff !important;
    opacity: 1;
}
html[data-theme="dark"] :is(.swiper-button-next, .swiper-button-prev) :is(i, svg) {
    color: #edf4ff !important;
    stroke: currentColor;
}
html[data-theme="dark"] :is(.swiper-button-next, .swiper-button-prev):hover:not(.swiper-button-disabled) {
    background-color: #395477 !important;
    border-color: #628ab4 !important;
}
html[data-theme="dark"] :is(.swiper-button-next, .swiper-button-prev).swiper-button-disabled {
    opacity: .7 !important;
}
html[data-theme="dark"] .swiper-pagination-bullet {
    background-color: #87a4c5 !important;
    opacity: .65;
}
html[data-theme="dark"] .swiper-pagination-bullet-active {
    background-color: #80bdff !important;
    opacity: 1 !important;
}

/* Profile sidebar: dark shaped avatar surround and restrained card shadow.
   The original inline SVG has a hard-coded pale fill, which the ordinary
   background-color overrides cannot reach. Both desktop and offcanvas sidebars. */
html[data-theme="dark"] .profile__sidebar {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
}
html[data-theme="dark"] .profile__sidebar .box__shaped-title > svg > path {
    fill: var(--yalda-surface) !important;
}
html[data-theme="dark"] .profile__sidebar__navigation li:last-child a::after {
    background-color: var(--yalda-border) !important;
}
@media (max-width: 991.98px) {
    html[data-theme="dark"] .profile__sidebar {
        box-shadow: none !important;
    }
}

html[data-theme="dark"].btn-responsive-menu svg {

    background: #fff;
}


html[data-theme="dark"] .rm-item-menu li i {
     color: #fff;
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
}

html[data-theme="dark"]  .rm-item-menu ul {
    height: auto;
    width: 100%;
    background: var(--yalda-surface-alt) ;
}

@media (max-width: 1024px) {
    html[data-theme="dark"] .navbar-nav > .nav-item:hover .nav-link,
    html[data-theme="dark"] .navbar-nav > .nav-item:hover i {
        color: #fff !important;
    }
}

