:root {
  --shop-primary: #556b2f;
  --shop-primary-dark: #3f5123;
  --shop-bg: #f1f5ed;
  --shop-text: #222a31;
  --shop-muted: #5e6d78;
  --shop-border: #dce4d5;
  --shop-shadow-sm: 0 8px 24px rgba(28, 39, 22, 0.1);
  --shop-shadow-md: 0 14px 36px rgba(28, 39, 22, 0.18);
  --shop-radius: 12px;
  --shop-radius-sm: 8px;
  --shop-space-1: 8px;
  --shop-space-2: 16px;
  --shop-space-3: 24px;
  --shop-space-4: 32px;
}

body.ecommerce {
  background: linear-gradient(180deg, #ffffff 0%, #f6f7f9 88%);
  color: var(--shop-text);
}

body.ecommerce .header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}

body.ecommerce.shop-sticky-active .header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1060;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shop-shadow-sm);
}

body.ecommerce.shop-sticky-active {
  padding-top: var(--sticky-header-offset, 90px);
}

.header .site-logo img {
  max-height: 48px;
  width: auto;
}

.header-navigation > ul > li > a {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.menu-search .search-box {
  min-width: 320px;
  border-radius: var(--shop-radius-sm);
  box-shadow: var(--shop-shadow-sm);
  border: 1px solid var(--shop-border);
}

.menu-search .search-box .form-control {
  border-color: var(--shop-border);
}

.search-suggest-list {
  max-height: 260px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  background: #fff;
  box-shadow: var(--shop-shadow-sm);
}

.search-suggest-list li {
  border-bottom: 1px solid var(--shop-border);
}

.search-suggest-list li:last-child {
  border-bottom: 0;
}

.search-suggest-list a,
.search-suggest-list button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  text-align: left;
  color: var(--shop-text);
}

.search-suggest-list a:hover,
.search-suggest-list button:hover {
  background: #fff4ea;
  color: var(--shop-primary-dark);
}

.top-cart-block {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-cart-block .fa-shopping-cart {
  position: relative;
  top: auto;
  right: auto;
  background: var(--shop-primary);
  color: #fff;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex: 0 0 44px;
}

.top-cart-block .fa-shopping-cart:hover {
  transform: translateY(-2px);
}

.top-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  padding: 0 5px;
  height: 20px;
  border-radius: 999px;
  background: #232a35;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-cart-info {
  float: none;
  padding: 8px 13px 6px;
}

.shop-user-menu {
  float: right;
  margin-right: 14px;
  margin-top: 30px;
}

.shop-user-menu .btn {
  border-radius: var(--shop-radius-sm);
  border-color: var(--shop-border);
  color: var(--shop-text);
  font-weight: 600;
}

.shop-user-menu .dropdown-menu {
  border-radius: var(--shop-radius-sm);
  border: 1px solid var(--shop-border);
  box-shadow: var(--shop-shadow-sm);
}

.reduce-header .shop-user-menu {
  margin-top: 19px;
}

.page-slider {
  position: relative;
  overflow: hidden;
}

.page-slider .carousel .item {
  min-height: 380px;
}

.page-slider .carousel:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(35, 42, 53, 0.62) 8%, rgba(35, 42, 53, 0.1) 70%);
  z-index: 1;
  pointer-events: none;
}

.page-slider .carousel .item .container,
.page-slider .center-block {
  position: relative;
  z-index: 2;
}

.page-slider .carousel,
.page-slider .carousel-inner,
.page-slider .item {
  transition: opacity 0.65s ease;
}

.page-slider .carousel-btn,
.shop-cta-btn,
.btn.btn-primary,
.main .product-item .btn.add2cart,
.main .product-item .btn.js-add-to-cart {
  background: var(--shop-primary);
  border-color: var(--shop-primary);
  color: #fff;
  border-radius: var(--shop-radius-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}

.page-slider .carousel-btn:hover,
.shop-cta-btn:hover,
.btn.btn-primary:hover,
.main .product-item .btn.add2cart:hover,
.main .product-item .btn.js-add-to-cart:hover {
  background: var(--shop-primary-dark);
  border-color: var(--shop-primary-dark);
  color: #fff;
}

.main .product-list .product-item,
.main .owl-carousel .product-item {
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 39, 52, 0.03);
  overflow: hidden;
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

.main .product-list .product-item:hover,
.main .owl-carousel .product-item:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shop-shadow-md);
}

.main .product-item .pi-img-wrapper {
  background: #f6f7f9;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/5;
}

.main .product-item .pi-img-wrapper > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.main .product-item:hover .pi-img-wrapper > img {
  transform: scale(1.08);
}

.main .product-item .pi-img-wrapper > div {
  background: transparent;
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.main .product-item:hover .pi-img-wrapper > div {
  opacity: 1;
  pointer-events: auto;
}

.main .product-item .pi-img-wrapper > div .btn {
  border-radius: var(--shop-radius-sm);
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  color: #222a31 !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.main .product-item .pi-img-wrapper > div .btn:hover {
  background: var(--shop-primary) !important;
  border-color: var(--shop-primary) !important;
  color: #fff !important;
}

/* Clean hover actions for real DB-backed cards to prevent clipped controls */
.main .product-item[data-product-id] .pi-img-wrapper > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.main .product-item[data-product-id] .pi-img-wrapper > div .fancybox-button {
  display: none;
}

.main .product-item[data-product-id] .pi-img-wrapper > div .js-quick-view {
  margin: 0;
  min-width: 130px;
  text-align: center;
}

.main .product-item h3 {
  margin: 14px 14px 8px;
  min-height: 40px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.main .product-item h3 a {
  color: var(--shop-text);
  font-size: 15px;
  font-weight: 600;
}

.main .product-item .pi-price {
  margin: 0 14px 12px;
  color: var(--shop-primary);
  font-size: 20px;
  font-weight: 700;
}

.main .product-item .product-meta {
  margin: 0 14px 12px;
  font-size: 12px;
  color: var(--shop-muted);
}

.main .product-item .btn {
  margin: 0 14px 14px;
}

.main .product-item .wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #7d8796;
  box-shadow: var(--shop-shadow-sm);
  z-index: 3;
}

.main .product-item .wishlist-btn.active {
  background: #fff0e7;
  color: var(--shop-primary);
}

.sidebar,
.sidebar-filter,
.sidebar-products,
.product-page,
.goods-page {
  border-radius: var(--shop-radius);
}

.sidebar-filter {
  border: 1px solid var(--shop-border);
  background: #fff;
  padding: 16px;
}

.shop-filter-block .form-control,
.shop-filter-block .form-range,
.shop-filter-block select {
  border-radius: var(--shop-radius-sm);
}

.shop-filter-block .btn {
  width: 100%;
}

.shop-filter-empty {
  display: none;
  margin: 16px 0;
  padding: 18px;
  border: 1px dashed #cfd6df;
  border-radius: var(--shop-radius-sm);
  color: var(--shop-muted);
  background: #fcfdff;
}

.product-page {
  background: #fff;
  border: 1px solid var(--shop-border);
  padding: 20px;
  box-shadow: var(--shop-shadow-sm);
}

.product-main-image {
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  overflow: hidden;
  background: #f7f8fb;
}

.product-other-images a {
  border-radius: var(--shop-radius-sm);
  overflow: hidden;
  border: 1px solid var(--shop-border);
}

.product-page h1 {
  font-weight: 700;
  line-height: 1.3;
}

.product-page .price strong {
  color: var(--shop-primary);
}

.product-page-cart {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-page-cart .btn {
  min-height: 42px;
}

.product-page .availability strong {
  color: #2c9b53;
}

.goods-page {
  background: #fff;
  border: 1px solid var(--shop-border);
  box-shadow: var(--shop-shadow-sm);
  padding: 16px;
}

.shop-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 42, 52, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1080;
}

.shop-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(390px, 90vw);
  height: 100vh;
  background: #fff;
  box-shadow: -12px 0 36px rgba(26, 33, 43, 0.22);
  transform: translateX(110%);
  transition: transform 0.3s ease;
  z-index: 1090;
  display: flex;
  flex-direction: column;
}

.shop-cart-drawer.open {
  transform: translateX(0);
}

.shop-cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.shop-cart-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--shop-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-cart-drawer-body {
  padding: 14px;
  overflow: auto;
  flex: 1;
}

.shop-cart-drawer-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius-sm);
  margin-bottom: 10px;
}

.shop-cart-drawer-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--shop-radius-sm);
}

.shop-cart-drawer-item h5 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.shop-qty-control {
  display: inline-flex;
  border: 1px solid var(--shop-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.shop-qty-control button {
  border: 0;
  background: #fff;
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.shop-qty-control span {
  min-width: 28px;
  text-align: center;
  line-height: 28px;
  font-weight: 600;
}

.shop-cart-drawer-footer {
  border-top: 1px solid var(--shop-border);
  padding: 14px;
}

.shop-cart-drawer-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 12px;
}

.shop-cart-drawer .btn {
  width: 100%;
  margin-bottom: 8px;
}

.shop-toast-stack {
  position: fixed;
  right: 16px;
  top: 90px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-toast {
  min-width: 230px;
  padding: 12px 14px;
  border-radius: var(--shop-radius-sm);
  background: #1f2937;
  color: #fff;
  box-shadow: var(--shop-shadow-sm);
  transform: translateY(-8px);
  opacity: 0;
  animation: shopToastIn 0.25s ease forwards;
}

.shop-toast.success {
  background: #20774a;
}

.shop-toast.info {
  background: #1f2937;
}

@keyframes shopToastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.product-item.is-skeleton {
  position: relative;
  overflow: hidden;
}

.product-item.is-skeleton * {
  visibility: hidden;
}

.product-item.is-skeleton:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f2f4f7 25%, #e5e9ef 45%, #f2f4f7 65%);
  background-size: 300% 100%;
  animation: shopSkeleton 1.2s ease infinite;
}

@keyframes shopSkeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.pre-footer {
  margin-top: 48px;
}

.pre-footer .pre-footer-col {
  margin-bottom: 20px;
}

.pre-footer h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.pre-footer .pre-footer-subscribe-box .form-control {
  border-radius: var(--shop-radius-sm) 0 0 var(--shop-radius-sm);
}

.pre-footer .pre-footer-subscribe-box .btn-primary {
  border-radius: 0 var(--shop-radius-sm) var(--shop-radius-sm) 0;
}

@media (max-width: 991px) {
  .sidebar {
    margin-bottom: 20px;
  }

  .shop-user-menu {
    float: right;
    margin-top: 30px;
    margin-right: 10px;
  }

  .page-slider .carousel .item {
    min-height: 320px;
  }

  .menu-search .search-box {
    min-width: 270px;
  }
}

@media (max-width: 767px) {
  body.ecommerce.shop-sticky-active {
    padding-top: var(--sticky-header-offset-mobile, 68px);
  }

  .shop-user-menu {
    display: none;
  }

  .top-cart-block {
    margin-right: 10px;
  }

  .page-slider .carousel .item {
    min-height: 260px;
  }

  .page-slider .carousel-title-v3,
  .page-slider .carousel-subtitle-v2,
  .page-slider .carousel-title-v1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  }

  .product-page-cart.mobile-sticky-cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1070;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid var(--shop-border);
    box-shadow: 0 -10px 26px rgba(24, 31, 41, 0.12);
  }

  .menu-search .search-box {
    min-width: 100%;
  }
}
