/* ==========================================================================
   OTOBUS.RU - WooCommerce & DFLEX Plugin Style Overrides
   Exact match to original header layout (Screenshot 2)
   ========================================================================== */

/* 1. Header Search Form ([dflex_search_form]) */
.hero-overlay-header .dflex-search-form-wrap,
.header-search-wrap .dflex-search-form-wrap,
.dflex-search-form-wrap {
  width: 260px !important;
  max-width: 260px !important;
  margin: 0 !important;
}

.hero-overlay-header .dflex-search-form-inner,
.dflex-search-form-inner {
  position: relative !important;
  width: 100% !important;
}

.hero-overlay-header .dflex-search-form,
.dflex-search-form {
  display: flex !important;
  flex-direction: row-reverse !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 9px !important;
  padding: 0 10px !important;
  height: 36px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.hero-overlay-header .dflex-search-form:focus-within,
.dflex-search-form:focus-within {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: none !important;
}

.hero-overlay-header .dflex-search-input,
.dflex-search-input {
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  padding: 0 0 0 6px !important;
  margin: 0 !important;
}

.hero-overlay-header .dflex-search-input::placeholder,
.dflex-search-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

.hero-overlay-header .dflex-search-submit,
.dflex-search-submit {
  flex-shrink: 0 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.hero-overlay-header .dflex-search-submit svg,
.dflex-search-submit svg,
.hero-overlay-header .dflex-search-submit i,
.dflex-search-submit i {
  width: 15px !important;
  height: 15px !important;
  font-size: 14px !important;
  color: #94a3b8 !important;
  stroke: #94a3b8 !important;
  stroke-width: 2.2 !important;
}

.dflex-search-submit:hover svg,
.dflex-search-submit:hover i {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/* 2. Header Action Icons ([dflex_header_icons]) */
.hero-overlay-header .dflex-header-icons,
.dflex-header-icons {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
}

.hero-overlay-header .dflex-header-icon,
.dflex-header-icon {
  position: relative !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.hero-overlay-header .dflex-header-icon:hover,
.dflex-header-icon:hover {
  background: rgba(230, 34, 68, 0.18) !important;
  border-color: var(--echo-red-accent, #e62244) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.hero-overlay-header .dflex-header-icon svg,
.dflex-header-icon svg,
.hero-overlay-header .dflex-header-icon i,
.dflex-header-icon i {
  width: 17px !important;
  height: 17px !important;
  font-size: 16px !important;
  color: #ffffff !important;
  stroke-width: 2 !important;
}

.dflex-cart-icon-wrap {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.hero-overlay-header .dflex-header-icon .dflex-badge,
.dflex-header-icon .dflex-badge,
.hero-overlay-header .dflex-header-icon .dflex-wishlist-count,
.dflex-header-icon .dflex-wishlist-count,
.hero-overlay-header .dflex-header-icon .dflex-cart-count,
.dflex-header-icon .dflex-cart-count,
.dflex-cart-icon-wrap .dflex-cart-count {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  background: #e62244 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  min-width: 17px !important;
  height: 17px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 2px !important;
  box-shadow: 0 2px 6px rgba(230, 34, 68, 0.6) !important;
  line-height: 1 !important;
  border: 1.5px solid #0b1222 !important;
  z-index: 10 !important;
}

/* 3. Filter Search Box Overrides (Inside Catalog Sidebar) */
.filter-search-box .dflex-search-form-wrap {
  width: 100% !important;
  max-width: 100% !important;
}

.filter-search-box .dflex-search-form {
  flex-direction: row !important;
  background: #ffffff !important;
  border: 1px solid var(--ignavo-border, #e2e8f0) !important;
  border-radius: 10px !important;
  height: 40px !important;
  padding: 0 12px !important;
}

.filter-search-box .dflex-search-input {
  color: var(--ignavo-text-dark, #0f172a) !important;
  padding: 0 6px 0 0 !important;
}

.filter-search-box .dflex-search-input::placeholder {
  color: #94a3b8 !important;
}

/* 4. Floating Apply Filter Popover (#dflex-floating-apply) */
.catalog-sidebar,
.dflex-filters-sidebar {
  position: relative !important;
}

#dflex-floating-apply,
.dflex-floating-apply-popover {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  left: calc(100% + 8px) !important;
  right: auto !important;
  transform: translateY(-50%) !important;
  z-index: 9999 !important;
  background: var(--echo-red-accent, #e62244) !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 18px rgba(230, 34, 68, 0.4) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: opacity 0.2s ease, top 0.15s ease !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

#dflex-floating-apply.visible,
.dflex-floating-apply-popover.visible {
  display: inline-flex !important;
  align-items: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#dflex-floating-apply::before,
.dflex-floating-apply-popover::before {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: -5px !important;
  transform: translateY(-50%) !important;
  border-width: 5px 5px 5px 0 !important;
  border-style: solid !important;
  border-color: transparent var(--echo-red-accent, #e62244) transparent transparent !important;
  width: 0 !important;
  height: 0 !important;
}

@media (max-width: 992px) {

  #dflex-floating-apply,
  .dflex-floating-apply-popover,
  #dflex-floating-apply.visible,
  .dflex-floating-apply-popover.visible {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

.filter-search-box .dflex-search-submit svg,
.filter-search-box .dflex-search-submit i {
  color: #94a3b8 !important;
  stroke: #94a3b8 !important;
}


/* ==========================================================================
   6. Premium Product Card Overrides (.dflex-product-card)
   Uniform image heights, sleek typography, modern buttons & wishlist
   ========================================================================== */
.dflex-product-card {
  background: #ffffff !important;
  border: 1px solid #eef2f6 !important;
  border-radius: 20px !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
  position: relative !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.dflex-product-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04) !important;
  border-color: #cbd5e1 !important;
}

/* Image Wrapper (Фиксированная высота и фон для одинакового отображения всех фото) */
.dflex-product-card .dflex-card-image {
  width: 100% !important;
  height: 180px !important;
  max-height: 180px !important;
  aspect-ratio: auto !important;
  background: #f8fafc !important;
  border-radius: 14px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 14px !important;
  flex-shrink: 0 !important;
}

.dflex-product-card .dflex-card-img-link {
  width: 100% !important;
  height: 100% !important;
  padding: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
}

.dflex-product-card .dflex-card-image img,
.dflex-product-card .dflex-card-img-main {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  mix-blend-mode: multiply !important;
  transition: transform 0.35s ease !important;
  margin: auto !important;
  display: block !important;
}

.dflex-product-card:hover .dflex-card-image img {
  transform: scale(1.06) !important;
}

/* Wishlist Heart Icon (Круглая белая кнопка с мягкой тенью) */
.dflex-product-card .dflex-card-wishlist {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 32px !important;
  height: 32px !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  z-index: 5 !important;
}

.dflex-product-card .dflex-card-wishlist:hover {
  color: var(--echo-red-accent, #e62244) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 4px 12px rgba(230, 34, 68, 0.2) !important;
}

.dflex-product-card .dflex-card-wishlist.active,
.dflex-product-card .dflex-card-wishlist.active i {
  color: var(--echo-red-accent, #e62244) !important;
}

/* Card Body Content */
.dflex-product-card .dflex-card-content {
  padding: 0 2px !important;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
}

/* Product Title (2-строчное ограничение с фиксированной min-height для идеальной сетки) */
.dflex-product-card .dflex-card-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: #0f172a !important;
  margin: 0 0 6px 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  min-height: 40px !important;
}

.dflex-product-card .dflex-card-title a {
  color: #0f172a !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

.dflex-product-card .dflex-card-title a:hover {
  color: var(--echo-red-accent, #e62244) !important;
}

/* Product Description / OEM / Article */
.dflex-product-card .dflex-card-desc {
  font-size: 12px !important;
  color: #8c9ba5 !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  margin: 0 0 16px 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Card Footer: Price & Add to Cart button */
.dflex-product-card .dflex-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-top: auto !important;
  padding-top: 6px !important;
  border-top: none !important;
}

/* Price Typography */
.dflex-product-card .dflex-card-price {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.1 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
}

.dflex-product-card .dflex-card-price ins {
  text-decoration: none !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  background: transparent !important;
}

.dflex-product-card .dflex-card-price .woocommerce-Price-amount {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 18px !important;
}

.dflex-product-card .dflex-card-price .woocommerce-Price-currencySymbol {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-left: 2px !important;
}

.dflex-product-card .dflex-card-price del {
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
  text-decoration: line-through !important;
  margin-bottom: 2px !important;
}

/* Add to Cart Button */
.dflex-product-card .dflex-card-btn-wrap {
  flex-shrink: 0 !important;
}

.dflex-product-card .dflex-btn-add_to_cart {
  height: 38px !important;
  padding: 0 16px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12) !important;
  white-space: nowrap !important;
}

.dflex-product-card .dflex-btn-add_to_cart:hover {
  background: #1e293b !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2) !important;
}

.dflex-product-card .dflex-btn-add_to_cart:active {
  transform: translateY(0) !important;
}

/* Shopping Bag SVG Icon on Button */
.dflex-product-card .dflex-btn-add_to_cart::before {
  content: "" !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  flex-shrink: 0 !important;
}

/* Button State: Already Added to Cart (is-added) */
.dflex-product-card .dflex-btn-add_to_cart.is-added {
  background: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}

.dflex-product-card .dflex-btn-add_to_cart.is-added:hover {
  background: #059669 !important;
}

.dflex-product-card .dflex-btn-add_to_cart.is-added::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Out of Stock Button State */
.dflex-product-card .dflex-btn-add_to_cart.is-out-of-stock,
.dflex-product-card button.is-out-of-stock {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.dflex-product-card .dflex-btn-add_to_cart.is-out-of-stock::before {
  display: none !important;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 767px) {
  .dflex-product-card {
    padding: 10px !important;
    border-radius: 16px !important;
  }

  .dflex-product-card .dflex-card-image {
    height: 135px !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
  }

  .dflex-product-card .dflex-card-title {
    font-size: 13px !important;
    min-height: 35px !important;
    margin-bottom: 4px !important;
  }

  .dflex-product-card .dflex-card-desc {
    font-size: 11px !important;
    margin-bottom: 8px !important;
  }

  .dflex-product-card .dflex-card-price,
  .dflex-product-card .dflex-card-price .woocommerce-Price-amount {
    font-size: 15px !important;
  }

  .dflex-product-card .dflex-btn-add_to_cart {
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    gap: 5px !important;
    border-radius: 8px !important;
  }

  .dflex-product-card .dflex-btn-add_to_cart::before {
    width: 12px !important;
    height: 12px !important;
  }
}

.dflex-filter-widget {
  border: 0 !important;
}

/* 7. Catalog Toolbar DFLEX Overrides */
.catalog-active-filters-wrap .dflex-active-filters-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 0 !important;
}

.catalog-products-count .dflex-products-count {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--ignavo-text-muted, #64748b) !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.catalog-ordering-wrap .dflex-catalog-ordering-select-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.catalog-ordering-wrap .dflex-custom-orderby {
  background: #ffffff !important;
  border: 1px solid var(--ignavo-border, #e2e8f0) !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--ignavo-text-dark, #0f172a) !important;
  outline: none !important;
  cursor: pointer !important;
  transition: var(--transition-fast) !important;
}

.catalog-ordering-wrap .dflex-custom-orderby:focus {
  border-color: var(--echo-red-accent, #e62244) !important;
}

/* ==========================================================================
   8. Wishlist Panel & Drawer Actions Overrides
   ========================================================================== */
.dflex-wishlist-item-actions {
  display: block !important;
  width: 100% !important;
  margin-top: 8px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dflex-wishlist-action-wrap {
  position: relative !important;
  width: 100% !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart {
  width: 100% !important;
  height: 38px !important;
  padding: 0 16px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12) !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart:hover {
  background: #1e293b !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2) !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart:active {
  transform: translateY(0) !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart::before {
  content: "" !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  flex-shrink: 0 !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart.is-added {
  background: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart.is-added:hover {
  background: #059669 !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart.is-added::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart.disabled,
.dflex-wishlist-item-actions .dflex-btn-add_to_cart[disabled] {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.dflex-wishlist-item-actions .dflex-btn-add_to_cart.disabled::before,
.dflex-wishlist-item-actions .dflex-btn-add_to_cart[disabled]::before {
  display: none !important;
}

/* ==========================================================================
   9. Checkout Page Spacing Overrides
   ========================================================================== */
.woocommerce-checkout .dflex-checkout-page-wrap,
.dflex-checkout-page-wrap {
  margin-top: 0 !important;
}

/* ==========================================================================
   10. User Account Overrides
   ========================================================================== */
.dflex-account-content {
  background: transparent !important;
}