/* ============================================
   Elementor Product Carousel Pro — Styles
   ============================================ */

/* --- Variables --- */
.epc-wrapper {
  --epc-primary: #e8693c;       /* naranja badge estilo Promofarma */
  --epc-btn-green: #3ab26f;     /* verde botón carrito */
  --epc-btn-green-hover: #2e9a5e;
  --epc-dark: #1a2e2a;
  --epc-card-bg: #ffffff;
  --epc-radius: 8px;
  --epc-transition: 0.3s ease;
  --epc-shadow: 0 1px 6px rgba(0,0,0,0.10);
  --epc-shadow-hover: 0 4px 18px rgba(0,0,0,0.13);
  font-family: inherit;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* ============================================
   HEADER
   ============================================ */
.epc-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.epc-header__text {
  flex: 1;
  min-width: 0;
}

.epc-header__title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--epc-dark);
  margin: 0 0 6px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.epc-header__subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.epc-header__viewall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  color: var(--epc-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: gap var(--epc-transition);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
}

.epc-header__viewall:hover {
  gap: 9px;
  border-bottom-color: var(--epc-primary);
}

/* ============================================
   CAROUSEL CONTAINER
   ============================================ */
.epc-carousel-container {
  position: relative;
}

.epc-swiper {
  overflow: hidden;
  border-radius: var(--epc-radius);
}

.epc-swiper .swiper-wrapper {
  align-items: stretch;
}

.epc-swiper .swiper-slide {
  height: auto;
}

/* ============================================
   CARD — BASE
   ============================================ */
.epc-card {
  background: var(--epc-card-bg);
  border-radius: var(--epc-radius);
  border: 1px solid #e8ecef;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow var(--epc-transition), transform var(--epc-transition);
  box-shadow: var(--epc-shadow);
  position: relative;
}

.epc-hover-lift .epc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--epc-shadow-hover);
}

/* --- Image --- */
.epc-card__image-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f8f9fb;
}

.epc-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.epc-card:hover .epc-card__image {
  transform: scale(1.05);
}

/* --- Badge --- */
.epc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--epc-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0em;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1.4;
  z-index: 2;
  pointer-events: none;
}

.epc-badge del,
.epc-badge .woocommerce-Price-currencySymbol {
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

/* --- Wishlist --- */
.epc-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  transition: background var(--epc-transition), transform var(--epc-transition);
  backdrop-filter: blur(4px);
}

.epc-wishlist:hover {
  background: var(--epc-primary);
  transform: scale(1.1);
}

.epc-wishlist:hover svg {
  stroke: #fff;
}

.epc-wishlist.active svg {
  fill: var(--epc-primary);
  stroke: var(--epc-primary);
}

/* --- Card Body --- */
.epc-card__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

/* --- Category --- */
.epc-card__category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--epc-primary);
}

.epc-card__category a {
  color: inherit;
  text-decoration: none;
}

/* --- Title --- */
.epc-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
}

.epc-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--epc-transition);
}

.epc-card__title a:hover {
  color: var(--epc-primary);
}

/* --- Rating --- */
.epc-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.epc-stars {
  display: flex;
  gap: 1px;
}

.epc-star {
  font-size: 16px;
  line-height: 1;
  color: #e5e7eb;
}

.epc-star--filled {
  color: #f5a623;
}

.epc-rating-count {
  font-size: 12px;
  color: #888;
}

/* --- Price --- */
.epc-card__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.epc-price__old {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
}

.epc-price__old .woocommerce-Price-amount,
.epc-price__old del {
  color: inherit;
  text-decoration: none;
}

.epc-price__current {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
}

.epc-price__current .woocommerce-Price-amount,
.epc-price__current ins {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

/* --- Actions --- */
.epc-card__actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Precio + botón en la misma fila, como en las capturas */
.epc-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.epc-btn-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  background: var(--epc-btn-green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--epc-transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.epc-btn-cart:hover {
  background: var(--epc-btn-green-hover);
  color: #fff;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.epc-btn-cart span {
  display: none; /* Solo icono por defecto, igual que las capturas */
}

.epc-btn-cart svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.epc-btn-cart.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: epc-spin 0.7s linear infinite;
}

@keyframes epc-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   CARD LAYOUTS
   ============================================ */

/* Overlay layout */
.epc-layout--overlay .epc-card {
  position: relative;
}

.epc-layout--overlay .epc-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  color: #fff;
  padding: 48px 16px 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--epc-transition), transform var(--epc-transition);
}

.epc-layout--overlay .epc-card:hover .epc-card__body {
  opacity: 1;
  transform: translateY(0);
}

.epc-layout--overlay .epc-card__title a,
.epc-layout--overlay .epc-card__category,
.epc-layout--overlay .epc-price__current {
  color: #fff;
}

.epc-layout--overlay .epc-card__image-wrap {
  padding-bottom: 130% !important;
}

/* Horizontal layout */
.epc-layout--horizontal .epc-card {
  flex-direction: row;
}

.epc-layout--horizontal .epc-card__image-wrap {
  flex: 0 0 110px;
  width: 110px;
  padding-bottom: 0 !important;
  min-height: 110px;
}

.epc-layout--horizontal .epc-card__image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 110px;
}

.epc-layout--horizontal .epc-card__body {
  flex: 1;
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */
.epc-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--epc-dark);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transition: background var(--epc-transition), color var(--epc-transition), transform var(--epc-transition), box-shadow var(--epc-transition);
  outline: none;
}

.epc-nav-btn:hover {
  background: var(--epc-primary);
  color: #fff;
  box-shadow: 0 6px 24px rgba(233, 30, 140, 0.35);
  transform: translateY(-50%) scale(1.05);
}

.epc-nav-prev {
  left: -20px;
}

.epc-nav-next {
  right: -20px;
}

/* Top/bottom navigation */
.epc-nav-pos--top .epc-nav-outer,
.epc-nav-pos--bottom .epc-nav-outer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.epc-nav-pos--bottom .epc-nav-outer {
  margin-bottom: 0;
  margin-top: 16px;
}

.epc-nav-pos--top .epc-nav-btn,
.epc-nav-pos--bottom .epc-nav-btn {
  position: static;
  transform: none;
}

.epc-nav-pos--top .epc-nav-btn:hover,
.epc-nav-pos--bottom .epc-nav-btn:hover {
  transform: scale(1.05);
}

.epc-nav-btn.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ============================================
   PAGINATION
   ============================================ */
.epc-pagination {
  position: static !important;
  margin-top: 20px !important;
}

.epc-pagination.swiper-pagination-bullets {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.epc-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #d1d5db;
  opacity: 1;
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: pointer;
}

.epc-pagination .swiper-pagination-bullet-active {
  background: var(--epc-primary) !important;
  width: 24px;
  border-radius: 4px;
}

.epc-pagination.swiper-pagination-fraction {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.epc-pagination.swiper-pagination-progressbar {
  background: #e5e7eb;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.epc-pagination .swiper-pagination-progressbar-fill {
  background: var(--epc-primary) !important;
  border-radius: 2px;
}

/* ============================================
   COVERFLOW EFFECT
   ============================================ */
.epc-swiper.swiper-3d .swiper-slide-shadow-left,
.epc-swiper.swiper-3d .swiper-slide-shadow-right {
  background: linear-gradient(to right, rgba(0,0,0,0.12), transparent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .epc-nav-prev { left: -14px; }
  .epc-nav-next { right: -14px; }
}

@media (max-width: 768px) {
  .epc-nav-btn { width: 36px; height: 36px; }
  .epc-nav-prev { left: -4px; }
  .epc-nav-next { right: -4px; }
  .epc-header__title { font-size: 20px; }
}

@media (max-width: 480px) {
  .epc-nav-prev, .epc-nav-next { display: none; }
  .epc-wrapper { overflow: hidden; }
}

/* ============================================
   WC CART ADD ANIMATION
   ============================================ */
@keyframes epc-added {
  0%   { background: var(--epc-primary); }
  80%  { background: #10b981; }
  100% { background: var(--epc-dark); }
}

.epc-btn-cart.added {
  animation: epc-added 1.5s ease forwards;
}
