:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #1e1e1e;
  --surface: #1c1c1c;
  --border: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #bfbfbf;
  --muted: #888888;
  --accent: var(--theme-color);
  --accent-hover: var(--theme-color);
  --shadow: 0px 4px 20px rgba(0, 0, 0, 0.5);
}

body.dark-theme {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
}

body.dark-theme #page_wrapper {
  background: var(--bg-primary) !important;
}

body.dark-theme a {
  color: var(--text-primary);
}

body.dark-theme a:hover {
  color: var(--accent);
}

body.dark-theme p,
body.dark-theme span,
body.dark-theme li,
body.dark-theme small {
  color: var(--text-secondary);
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
  color: var(--text-primary);
}

/* Remove light backgrounds */
body.dark-theme .bg-white,
body.dark-theme .bg-light,
body.dark-theme .bg-gray,
body.dark-theme .bg-secondary {
  background-color: var(--bg-secondary) !important;
}

body.dark-theme section,
body.dark-theme .full-row,
body.dark-theme .container,
body.dark-theme .container-fluid {
  background-color: transparent;
}

body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-bottom,
body.dark-theme .border-start,
body.dark-theme .border-end {
  border-color: var(--border) !important;
}

/* Common text utilities in theme files */
body.dark-theme .text-dark {
  color: var(--text-primary) !important;
}

body.dark-theme .text-muted {
  color: var(--text-secondary) !important;
}

body.dark-theme .text-secondary {
  color: var(--text-secondary) !important;
}

body.dark-theme .text-white {
  color: var(--text-primary) !important;
}

/* Header / Navbar */
body.dark-theme .ecommerce-header,
body.dark-theme .main-nav,
body.dark-theme .header-sticky {
  background: #121212 !important;
}

body.dark-theme .navbar .nav-link,
body.dark-theme .navbar-nav .nav-link,
body.dark-theme .top-header a,
body.dark-theme .top-links a {
  color: var(--text-primary) !important;
}

body.dark-theme .navbar-nav .active > .nav-link,
body.dark-theme .navbar-nav .nav-item.active > .nav-link,
body.dark-theme .navbar-nav .nav-link.active {
  color: var(--accent) !important;
}

body.dark-theme .navbar .nav-link:hover,
body.dark-theme .navbar-nav .nav-link:hover,
body.dark-theme .top-links a:hover {
  color: var(--accent) !important;
}

body.dark-theme .my-account-dropdown > a.has-dropdown {
  background-color: #1c1c1c;
  color: #ffffff !important;
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.1;
  transition: all 0.3s ease;
}

body.dark-theme .my-account-dropdown > a.has-dropdown i,
body.dark-theme .my-account-dropdown > a.has-dropdown [class*="flaticon-"]::before {
  color: inherit !important;
}

body.dark-theme .my-account-dropdown > a.has-dropdown:hover {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000000 !important;
}

/* Header icons (wishlist/cart/compare/search) */
body.dark-theme .header-cart-1 .cart-icon i,
body.dark-theme .search-view i,
body.dark-theme .language-selector i {
  color: #cccccc !important;
}

body.dark-theme .sign-in > a,
body.dark-theme .wishlist-view > a,
body.dark-theme .refresh-view > a,
body.dark-theme .search-view > a {
  background-color: #2a2a2a;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

body.dark-theme .header-cart-1 .cart-icon {
  background-color: #2a2a2a !important;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

body.dark-theme .header-cart-1 .cart-icon i,
body.dark-theme .search-view a i,
body.dark-theme .wishlist-view a i,
body.dark-theme .refresh-view a i,
body.dark-theme .sign-in a i {
  color: #ffffff !important;
}

body.dark-theme .sign-in > a:hover,
body.dark-theme .wishlist-view > a:hover,
body.dark-theme .refresh-view > a:hover,
body.dark-theme .search-view > a:hover,
body.dark-theme .header-cart-1 a:hover .cart-icon {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  transform: scale(1.05);
}

body.dark-theme .sign-in > a:hover i,
body.dark-theme .wishlist-view > a:hover i,
body.dark-theme .refresh-view > a:hover i,
body.dark-theme .search-view > a:hover i,
body.dark-theme .header-cart-1 a:hover .cart-icon i {
  color: #000000 !important;
}

body.dark-theme .wishlist-view span.header-wishlist-count,
body.dark-theme .refresh-view span.header-compare-count,
body.dark-theme [class*="header-cart-"] .cart .cart-icon .header-cart-count,
body.dark-theme .header-cart-1 .cart-wrap .header-cart-count {
  background-color: var(--accent) !important;
  color: #000000 !important;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

body.dark-theme .header-cart-1 a:hover .cart-icon i,
body.dark-theme .search-view a:hover i {
  color: var(--accent) !important;
}

@media (max-width: 991.98px) {
  body.dark-theme .header-sticky .navbar-brand {
    display: block !important;
    margin-left: 10px;
  }

  body.dark-theme .header-sticky img.nav-logo {
    width: auto;
    min-width: 0;
    height: 28px;
  }
}

/* Dropdown menus */
body.dark-theme .dropdown-menu,
body.dark-theme .my-account-popup {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
}

body.dark-theme .dropdown-item {
  color: var(--text-primary) !important;
}

body.dark-theme .dropdown-item.active,
body.dark-theme .dropdown-item:active,
body.dark-theme .dropdown-item[aria-current="page"] {
  color: var(--text-primary) !important;
  background-color: rgba(245, 197, 24, 0.16) !important;
}

/* Some theme scripts mark the first dropdown <li> as active by default.
   Don't render that as a selected state in dark mode. */
body.dark-theme .dropdown-menu li.active > a,
body.dark-theme .dropdown-menu li.active > .dropdown-item {
  color: var(--text-primary) !important;
  background-color: transparent !important;
}

body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu li > a,
body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu li > a.dropdown-item {
  color: var(--text-primary) !important;
  background-color: transparent !important;
}

body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu li > a:hover {
  color: var(--accent) !important;
}

body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu li > a:focus {
  color: var(--text-primary) !important;
  background-color: transparent !important;
}

body.dark-theme .dropdown-menu > li > .dropdown-item:not(:hover):not(:active):not(.active) {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

body.dark-theme .dropdown-menu > li:first-child > .dropdown-item:not(:hover):not(:active):not(.active) {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

body.dark-theme .dropdown-item:hover {
  background-color: rgba(245, 197, 24, 0.12) !important;
  color: var(--accent) !important;
}

body.dark-theme .dropdown-item:focus {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

body.dark-theme .dropdown-item:focus-visible {
  outline: 2px solid rgba(245, 197, 24, 0.35);
  outline-offset: 2px;
}

/* Mega menu section titles and first rows */
body.dark-theme .dropdown-menu.mega-dropdown-menu,
body.dark-theme .dropdown-menu.mega-dropdown-menu .mega-container,
body.dark-theme .dropdown-menu.mega-dropdown-menu .row,
body.dark-theme .dropdown-menu.mega-dropdown-menu .col {
  background-color: var(--bg-secondary) !important;
}

body.dark-theme .dropdown-menu.mega-dropdown-menu span,
body.dark-theme .dropdown-menu.mega-dropdown-menu .text-secondary {
  color: var(--text-primary) !important;
}

/* Mega menu width: avoid blank right-side area when there are only a few columns */
@media (min-width: 992px) {
  body.dark-theme .navbar .navbar-nav li.mega-dropdown {
    position: relative !important;
  }

  body.dark-theme .navbar .navbar-nav li.mega-dropdown > ul.dropdown-menu.mega-dropdown-menu {
    left: 0 !important;
    right: auto !important;
    top: 100% !important;
  }

  body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu.mega-dropdown-menu {
    width: fit-content !important;
    max-width: calc(100vw - 40px);
  }

  body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu.mega-dropdown-menu .mega-container {
    width: auto;
  }

  body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu.mega-dropdown-menu .dropdown-item,
  body.dark-theme .navbar .navbar-nav li > ul.dropdown-menu.mega-dropdown-menu span {
    white-space: nowrap !important;
  }
}

/* Search bar */
body.dark-theme .product-search-one .search-form,
body.dark-theme .search-pill-shape {
  background: var(--bg-tertiary) !important;
  border: 1px solid #333333 !important;
}

body.dark-theme .product-search-one input.search-field,
body.dark-theme .product-search-one .form-control {
  background: transparent !important;
  color: var(--text-primary) !important;
  border-color: transparent !important;
}

body.dark-theme .product-search-one input.search-field::placeholder {
  color: var(--muted) !important;
}

body.dark-theme .product-search-one .search-submit {
  background: var(--accent) !important;
  color: #000000 !important;
}

body.dark-theme .product-search-one .search-submit i {
  color: #000000 !important;
}

@media (max-width: 991.98px) {
  body.dark-theme .nav-leftpush-overlay .navbar-expand-lg .navbar-slide-push {
    background-color: var(--bg-secondary) !important;
  }

  body.dark-theme .nav-leftpush-overlay .navbar-expand-lg .navbar-slide-push .login-signup {
    background-color: #121212 !important;
  }

  body.dark-theme #menu-and-category .nav-link,
  body.dark-theme #menu-and-category2 .nav-link {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
  }

  body.dark-theme #menu-and-category .nav-link.active,
  body.dark-theme #menu-and-category2 .nav-link.active {
    background-color: var(--accent) !important;
    color: #000000 !important;
  }

  body.dark-theme #menu-and-category .nav-item,
  body.dark-theme #menu-and-category2 .nav-item {
    width: 100% !important;
  }

  body.dark-theme .navbar-slide-push .navbar-nav .nav-item .nav-link,
  body.dark-theme .categories-menu ul.menu li a {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border) !important;
    background-color: transparent !important;
  }

  body.dark-theme .push-navbar .mobile-menu-arrow {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
  }

  body.dark-theme .push-navbar .mobile-menu-arrow::before {
    content: "\25B6";
    font-size: 11px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
  }

  body.dark-theme .push-navbar .mobile-shop-toggle[aria-expanded="true"] .mobile-menu-arrow::before {
    transform: rotate(90deg);
  }

  body.dark-theme .push-navbar .mobile-submenu {
    list-style: none;
    padding: 8px 0 10px 12px;
    margin: 0;
    border-bottom: 1px solid var(--border);
  }

  body.dark-theme .push-navbar .mobile-submenu-heading {
    color: var(--accent) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 0 6px;
  }

  body.dark-theme .push-navbar .mobile-submenu-link {
    display: block;
    padding: 8px 0;
    color: var(--text-primary) !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.dark-theme .push-navbar .mobile-submenu li:last-child .mobile-submenu-link {
    border-bottom: 0;
  }

  body.dark-theme .push-navbar .mobile-submenu-link:hover {
    color: var(--accent) !important;
  }
}

/* Select2 */
body.dark-theme .select2-container--default .select2-selection--single {
  background-color: transparent !important;
  border: 0 !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary) !important;
}

body.dark-theme .select2-dropdown {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
}

body.dark-theme .select2-results__option {
  color: var(--text-primary) !important;
}

body.dark-theme .select2-results__option--highlighted[aria-selected] {
  background-color: rgba(245, 197, 24, 0.12) !important;
  color: var(--accent) !important;
}

/* Hero slider overlay + text */
body.dark-theme .banner-slide-item {
  position: relative;
}

body.dark-theme .banner-slide-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

body.dark-theme .banner-slide-item .container,
body.dark-theme .banner-slide-item .banner-wrapper-item,
body.dark-theme .banner-slide-item .banner-content {
  position: relative;
  z-index: 1;
}

body.dark-theme .banner-content p {
  color: #dddddd !important;
}

@media (max-width: 991.98px) {
  body.dark-theme .banner-slide-item {
    background: none !important;
  }

  body.dark-theme .banner-slide-mobile-img {
    width: 100%;
    height: auto;
    display: block;
  }

  body.dark-theme .banner-slide-item .container {
    position: absolute;
    inset: 0;
  }

  body.dark-theme .banner-wrapper-item {
    min-height: auto !important;
    height: 100%;
    padding: 24px 0 !important;
    display: flex;
    align-items: center;
  }

  body.dark-theme .banner-content {
    max-width: 92% !important;
    padding: 0 14px;
  }

  body.dark-theme .banner-content .subtitle {
    font-size: 16px !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
  }

  body.dark-theme .banner-content .title {
    font-size: 28px !important;
    line-height: 1.15 !important;
    margin-bottom: 10px !important;
  }

  body.dark-theme .banner-content p {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-bottom: 16px !important;
  }

  body.dark-theme .banner-content .cmn--btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    line-height: 22px !important;
  }
}

/* Category banners */
body.dark-theme .coustom-categories-banner-1 .product-wrapper {
  background: var(--surface) !important;
}

@media (max-width: 575.98px) {
  body.dark-theme .product-style-1.row {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  body.dark-theme .product-style-1 .product-wrapper {
    border-radius: 10px;
    overflow: hidden;
  }

  body.dark-theme .product-style-1 .product-image img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
  }

  body.dark-theme .product-style-1 .product-info {
    padding: 10px 10px 12px;
  }

  body.dark-theme .product-style-1 .product-title {
    margin-bottom: 6px;
  }

  body.dark-theme .product-style-1 .product-title a {
    font-size: 13px;
    line-height: 1.25;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.dark-theme .product-style-1 .price,
  body.dark-theme .product-style-1 .product-price {
    font-size: 13px;
  }
}

/* Cards / product items */
body.dark-theme .card,
body.dark-theme .product,
body.dark-theme .product-wrapper,
body.dark-theme .product-info,
body.dark-theme .banner-wrapper,
body.dark-theme .cart-wrap,
body.dark-theme .cookie-bar,
body.dark-theme .cookie-bar-wrap {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
}

body.dark-theme .product-title a {
  color: var(--text-primary) !important;
}

body.dark-theme .price,
body.dark-theme .product-price,
body.dark-theme .amount,
body.dark-theme .up-to-sale {
  color: var(--accent) !important;
}

body.dark-theme .product,
body.dark-theme .card {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

body.dark-theme .product:hover,
body.dark-theme .card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

/* Buttons */
body.dark-theme .btn-primary,
body.dark-theme .cmn--btn,
body.dark-theme button.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000000 !important;
}

body.dark-theme .btn-primary:hover,
body.dark-theme .cmn--btn:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  color: #000000 !important;
}

body.dark-theme .btn-outline-primary,
body.dark-theme .btn.btn-outline-primary {
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
}

body.dark-theme .btn-outline-primary:hover,
body.dark-theme .btn.btn-outline-primary:hover {
  background: var(--accent) !important;
  color: #000000 !important;
}

body.dark-theme .offer-product h1,
body.dark-theme .offer-product h2,
body.dark-theme .offer-product h3,
body.dark-theme .offer-product .text-dark {
  color: var(--text-primary) !important;
}

body.dark-theme .offer-product p {
  color: var(--text-secondary) !important;
}

body.dark-theme .offer-product .btn.btn-dark {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000000 !important;
}

body.dark-theme .offer-product .product-info .product-title {
  text-align: center;
}

body.dark-theme .offer-product .product-info .product-title,
body.dark-theme .offer-product .product-info .product-title * {
  color: #ffffff !important;
}

body.dark-theme .offer-product .product-price .on-sale,
body.dark-theme .offer-product .product-price .on-sale span {
  color: #000000 !important;
}

body.dark-theme .offer-product .product-price .on-sale {
  background-color: var(--accent) !important;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

body.dark-theme footer,
body.dark-theme footer.bg-white {
  background-color: #121212 !important;
  border-top-color: var(--border) !important;
}

body.dark-theme footer .widget-title,
body.dark-theme footer .footer-widget .widget-title {
  color: #ffffff !important;
}

body.dark-theme footer .footer-widget a {
  color: #ffffff !important;
}

body.dark-theme footer .footer-widget a:hover {
  color: var(--accent) !important;
}

body.dark-theme footer .widget-ecommerce-contact .text-dark,
body.dark-theme footer .widget-ecommerce-contact .h4,
body.dark-theme footer .widget-ecommerce-contact .h6 {
  color: #ffffff !important;
}

body.dark-theme footer .widget-ecommerce-contact .text-general,
body.dark-theme footer .widget-nav .date {
  color: var(--text-secondary) !important;
}

body.dark-theme .yith-wcwl-add-to-wishlist .wishlist-button a,
body.dark-theme .yith-wcwl-add-to-wishlist .compare-button a {
  color: #ffffff !important;
}

body.dark-theme .yith-wcwl-add-to-wishlist .wishlist-button a:hover,
body.dark-theme .yith-wcwl-add-to-wishlist .compare-button a:hover {
  color: var(--accent) !important;
}

body.dark-theme .summary .price .on-sale,
body.dark-theme .summary .price .on-sale span,
body.dark-theme .summary .price .on-sale * {
  color: #000000 !important;
}

body.dark-theme .summary .price .on-sale {
  background-color: var(--accent) !important;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

body.dark-theme .pagination-style-one .page-item .page-link {
  background-color: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

body.dark-theme .pagination-style-one .page-item .page-link:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #000000;
}

body.dark-theme .pagination-style-one .page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #000000;
}

body.dark-theme .page-center ul.pagination li {
  background: #2a2a2a !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

body.dark-theme .page-center ul.pagination li a {
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

body.dark-theme .page-center ul.pagination li.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000000 !important;
}

body.dark-theme .page-center ul.pagination li.active a {
  color: #000000 !important;
}

/* Forms */
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .form-control {
  background-color: var(--bg-tertiary) !important;
  border-color: #333333 !important;
  color: var(--text-primary) !important;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: var(--muted) !important;
}

body.dark-theme input:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus,
body.dark-theme .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 0.2rem rgba(245, 197, 24, 0.15) !important;
}

/* Modals */
body.dark-theme .modal-content {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
}

body.dark-theme .modal-header {
  border-bottom-color: var(--border) !important;
}

body.dark-theme .modal-footer {
  border-top-color: var(--border) !important;
}

/* Footer */
body.dark-theme footer,
body.dark-theme .footer,
body.dark-theme .footer-section {
  background: #0a0a0a !important;
}

body.dark-theme footer,
body.dark-theme footer * {
  color: #cccccc;
}

body.dark-theme footer a {
  color: #aaaaaa !important;
}

body.dark-theme footer a:hover {
  color: var(--accent) !important;
}

/* Misc */
body.dark-theme .shadow,
body.dark-theme .box-shadow,
body.dark-theme .shadow-sm,
body.dark-theme .shadow-lg {
  box-shadow: var(--shadow) !important;
}

body.dark-theme hr {
  border-color: var(--border) !important;
}
