/**
 * BH Favorites - Styles
 *
 * Styles for favorites page and toast notifications
 *
 * Note: Vehicle card styles (.bhcar__slider-card, etc.) are loaded from
 * bhcar-slider.css to ensure consistency between slider and favorites page.
 * This file contains only favorites-specific styles (tabs, grid, toast, etc.)
 */

/* ==========================================================================
   Favorites Container
   ========================================================================== */

/* Remove WooCommerce default border on favorites page */
.woocommerce-MyAccount-content:has(.bh-favorites-container) {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.bh-favorites-container {
  max-width: 1440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Title */
.bh-favorites-title {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2rem 0;
  text-transform: uppercase;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */

.bh-favorites-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.bh-favorites-tab {
  max-width: 196px;
  width: 100%;
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 120%;
  letter-spacing: 0.03em;
  text-align: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.bh-favorites-tab.active {
  border: 1px solid #e22415;
}

.bh-favorites-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.bh-favorites-tab.active .bh-favorites-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ==========================================================================
   Tab Panels
   ========================================================================== */

.bh-favorites-panels {
  position: relative;
}

.bh-favorites-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.bh-favorites-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* ==========================================================================
   Empty State
   ========================================================================== */

.bh-favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.bh-favorites-empty svg {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.bh-favorites-empty h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.bh-favorites-empty p {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 2rem;
}

.bh-favorites-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #e22415;
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.bh-favorites-cta:hover {
  background: #0077a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 150, 207, 0.3);
}

/* ==========================================================================
   Favorites Grid
   ========================================================================== */

.bh-favorites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

/* Ensure all cards have the same width - Override slider styles */
.bh-favorites-grid .bhcar__slider-card.bh-favorite-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: none !important;
}

.bh-favorites-grid
  .bhcar__slider-card.bh-favorite-card
  .bhcar__slider-card-wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

/* Force all direct children of grid to take full width */
.bh-favorites-grid > .bhcar__slider-card {
  width: 100% !important;
  max-width: 100% !important;
}

/* Remove any flex properties from slider cards in grid */
.bh-favorites-grid .bhcar__slider-card {
  display: block !important;
}

/* Products grid - ensure product cards display correctly */
.bh-favorites-products-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bh-favorites-products-grid .bh-product-card {
  width: 100% !important;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Remove underline from all links in product cards */
.bh-favorites-products-grid .bh-product-card a {
  text-decoration: none;
}

/* Ensure add to cart buttons are visible and styled correctly */
.bh-favorites-products-grid .bh-product-card-content {
  padding: 0 1rem 1rem;
  width: 100%;
}

.bh-favorites-products-grid .bh-product-card-content .button {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  position: relative;
}

/* Add chevron arrow to all product buttons */
.bh-favorites-products-grid .bh-product-card-content .button::after {
  display: block;
  content: "";
  width: 8px;
  height: 14px;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='9' height='14' viewBox='0 0 9 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.934409 1.57535L1.99541 0.515352L7.77441 6.29235C7.86756 6.38492 7.94149 6.495 7.99194 6.61625C8.04239 6.7375 8.06836 6.86753 8.06836 6.99885C8.06836 7.13018 8.04239 7.26021 7.99194 7.38146C7.94149 7.50271 7.86756 7.61278 7.77441 7.70535L1.99541 13.4854L0.935409 12.4254L6.35941 7.00035L0.934409 1.57535Z' fill='white'/%3E%3C/svg%3E%0A");
}

.bh-favorites-products-grid .bh-product-card-content .button:hover::after {
  transform: translateX(4px);
}

@media (max-width: 1024px) {
  .bh-favorites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .bh-favorites-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Favorite Card (reuse slider card styles)
   ========================================================================== */

.bh-favorite-card {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bh-favorite-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Additional styles to ensure consistency with slider */
.bh-favorite-card .bhcar__slider-mileage,
.bh-favorite-card .bhcar__slider-mileage > span,
.bh-favorite-card .bhcar__slider-year,
.bh-favorite-card .bhcar__slider-fuel,
.bh-favorite-card .bhcar__slider-transmission {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 10px;
  line-height: 175%;
  letter-spacing: -0.01em;
  text-align: center;
  color: #010101;
  margin: 8px 0 0;
}

.bh-favorite-card .bhcar__slider-placeholder {
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: 8px;
  line-height: 125%;
  letter-spacing: 0.03em;
  text-align: center;
  color: #414141;
  margin: 4px 0 0;
}

.bh-favorite-card .bhcar__slider-car-name {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 16px;
  line-height: 112%;
  letter-spacing: 0.03em;
  color: #050505;
  margin: 0 0 4px;
}

.bh-favorite-card .bhcar__slider-description {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: 120%;
  letter-spacing: 0.03em;
  color: #414141;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.bh-favorite-card .bhcar__slider-fuel {
  white-space: nowrap;
  height: 18px;
  width: 66%;
  text-overflow: ellipsis;
  overflow: hidden;
}

.bh-favorite-card .bhcar__slider-mileage {
  white-space: nowrap;
}

/* ==========================================================================
   Favorite Button Animation
   ========================================================================== */

.bhcar-favorite-icon {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bhcar-favorite-icon svg {
  transition: all 0.3s ease;
}

.bhcar-favorite-icon.bh-white-icon.is-favorite svg path {
  fill: #fff;
}

.bhcar-favorite-icon.bh-black-icon.is-favorite svg path {
  fill: #050505;
}

.bhcar-favorite-icon.bh-favorite-animate {
  animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
  0%,
  100% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.3);
  }

  50% {
    transform: scale(0.9);
  }

  75% {
    transform: scale(1.2);
  }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.bh-favorites-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  color: #111827;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  border-left: 4px solid #e22415;
}

.bh-favorites-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bh-favorites-toast-success {
  border-left-color: #10b981;
}

.bh-favorites-toast-info {
  border-left-color: #e22415;
}

.bh-favorites-toast-error {
  border-left-color: #ef4444;
}

@media (max-width: 768px) {
  .bh-favorites-toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    text-align: center;
  }
}

/* ==========================================================================
   Products Grid (future)
   ========================================================================== */

.bh-favorites-products-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.bh-favorite-product-card {
  position: relative;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.bh-favorite-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.bh-favorite-product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.bh-favorite-product-card h3 {
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.bh-favorite-product-card .price {
  padding: 0 1rem 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #e22415;
  margin: 0;
}

.bh-favorite-remove {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bh-favorite-remove:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ==========================================================================
   Product Card Favorite Button
   ========================================================================== */

.bh-product-card {
  position: relative;
}

.bh-product-card .bhcar-favorite-icon.bh-product-favorite {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.bh-product-card .bhcar-favorite-icon.bh-product-favorite:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.bh-product-card .bhcar-favorite-icon.bh-product-favorite svg {
  width: 20px;
  height: 20px;
}

/* Single product page favorite button */
.bh-single-product-main .bhcar-favorite-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bh-single-product-main .bhcar-favorite-icon:hover {
  transform: scale(1.1);
}

.bh-single-product-main .bhcar-favorite-icon svg {
  width: 31px;
  height: 31px;
  transition: all 0.3s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .bh-favorites-tabs {
    flex-direction: row;
  }

  .bh-favorites-tab {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .bh-favorites-container {
    padding: 1rem;
  }
}
@media (max-width: 340px) {
  .bh-favorites-tabs {
    flex-direction: column;
  }
  .bh-favorites-tab {
    max-width: 100%;
  }
}
