/* Optica Carousel v3.2 */

.oc-wrapper {
  --pur: #534AB7;
  --pur-mid: #7F77DD;
  --pur-pale: #ede9fb;
  --card-h: 420px;
  --img-h: 230px;
  --r: 16px;
  --speed: 0.55s;

  position: relative;
  width: 100%;
  padding: 10px 54px 54px;
  box-sizing: border-box;
  overflow: visible;
}

/* clip: recorta el track sin romper las flechas externas */
.oc-clip {
  overflow: hidden;
  width: 100%;
}

/* track: JS fija el ancho y el transform */
.oc-track {
  display: flex;
  gap: 18px;
  transition: transform 0.45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  flex-wrap: nowrap;
  align-items: stretch;
}

/* slide: JS fija el width, height fija aquí */
.oc-slide {
  flex-shrink: 0;
  height: var(--card-h);
  perspective: 1200px;
  box-sizing: border-box;
}

/* card — flip container */
.oc-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--speed) cubic-bezier(.4,0,.2,1),
              box-shadow var(--speed) ease;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: 0 3px 16px rgba(83,74,183,.12);
}

.oc-card:hover,
.oc-card.flipped {
  transform: rotateY(180deg);
  box-shadow: 0 20px 52px rgba(83,74,183,.22);
}

/* frente y dorso */
.oc-front,
.oc-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--r);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* ══ FRENTE ══ */
.oc-front {
  background: #fff;
  border: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
}

/* zona imagen — altura fija, clip interno */
.oc-img-wrap {
  position: relative;
  width: 100%;
  height: var(--img-h);
  flex-shrink: 0;
  overflow: hidden;
  background: #f4f4f4;
}

/* imagen blindada contra el tema */
.oc-img-wrap img.oc-img {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  max-width: none !important; max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  margin: 0 !important; padding: 0 !important;
  border: none !important; box-shadow: none !important;
  border-radius: 0 !important;
  display: block !important; float: none !important;
  transition: transform 0.5s ease !important;
}

.oc-card:hover .oc-img-wrap img.oc-img {
  transform: scale(1.05) !important;
}

.oc-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--pur);
  color: #fff;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 9px; border-radius: 5px;
  z-index: 3; line-height: 1.5;
}

/* cajita info */
.oc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 15px 15px;
  gap: 5px;
  background: #fff;
}

.oc-cat {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--pur-mid); line-height: 1;
}

.oc-title {
  font-size: 13px; font-weight: 700;
  color: #1a1a1a; line-height: 1.4;
  margin: 0; padding: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.oc-price {
  font-size: 15px; font-weight: 800;
  color: #1a1a1a; line-height: 1.3;
  margin-top: 2px;
}
.oc-price del { font-size: 11px; color: #aaa; font-weight: 400; margin-right: 4px; }
.oc-price ins { text-decoration: none; }
.oc-price .woocommerce-Price-amount { color: inherit; font-weight: inherit; font-size: inherit; }

.oc-hint {
  font-size: 10px; color: #bbb;
  text-align: right; margin: auto 0 0;
  letter-spacing: .04em;
}

/* ══ DORSO ══ */
.oc-back {
  transform: rotateY(180deg);
  background: #0a0818;
}

.oc-back-img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover; background-position: center;
  transition: transform 0.6s ease;
}

.oc-card.flipped .oc-back-img,
.oc-card:hover .oc-back-img { transform: scale(1.06); }

.oc-back-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top,
    rgba(10,8,40,.97) 0%,
    rgba(10,8,40,.72) 48%,
    rgba(10,8,40,.18) 82%,
    transparent 100%);
  z-index: 1;
}

.oc-back-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding: 22px 18px 24px; gap: 8px;
}

.oc-back-title {
  font-size: 14px; font-weight: 700;
  color: #fff; text-align: center; line-height: 1.35;
  margin: 0; text-shadow: 0 1px 6px rgba(0,0,0,.5);
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; width: 100%;
}

.oc-back-price {
  font-size: 26px; font-weight: 800;
  color: #fff; text-align: center; line-height: 1.2;
}
.oc-back-price del { font-size: 13px; color: rgba(255,255,255,.45); font-weight: 400; display: block; }
.oc-back-price ins { text-decoration: none; }
.oc-back-price .woocommerce-Price-amount { color: #fff; font-weight: 800; }

.oc-back-actions {
  display: flex; flex-direction: column;
  gap: 8px; width: 100%; margin-top: 4px;
}

.oc-btn-cart, .oc-btn-link, .oc-btn-ghost {
  display: block; width: 100%;
  padding: 11px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  text-align: center; text-decoration: none;
  cursor: pointer; box-sizing: border-box;
  line-height: 1.4;
  transition: background .2s, transform .15s;
}
.oc-btn-cart {
  background: #fff; color: var(--pur);
  border: none; box-shadow: 0 3px 12px rgba(0,0,0,.2);
}
.oc-btn-cart:hover { background: var(--pur-pale); transform: scale(1.03); }
.oc-btn-cart.loading { opacity: .6; pointer-events: none; }
.oc-btn-cart.added { background: #d4f5e2; color: #1a7a44; }

.oc-btn-link {
  background: #fff; color: var(--pur);
  border: none; box-shadow: 0 3px 12px rgba(0,0,0,.2);
}
.oc-btn-ghost {
  background: transparent; color: rgba(255,255,255,.8);
  border: 1.5px solid rgba(255,255,255,.3);
}
.oc-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

.oc-stock { font-size: 11px; color: rgba(255,255,255,.45); }

/* ══ Flechas ══ */
.oc-prev, .oc-next {
  position: absolute;
  top: calc(var(--img-h) / 2 + 10px - 20px);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff; border: 2px solid #ddd;
  box-shadow: 0 2px 14px rgba(0,0,0,.12);
  font-size: 18px; color: var(--pur);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; z-index: 20;
  padding: 0; line-height: 1;
}
.oc-prev { left: 6px; }
.oc-next { right: 6px; }
.oc-prev:hover, .oc-next:hover {
  background: var(--pur); color: #fff; border-color: var(--pur);
  box-shadow: 0 4px 20px rgba(83,74,183,.35);
}
.oc-prev:disabled, .oc-next:disabled { opacity: .22; pointer-events: none; }

/* ══ Dots ══ */
.oc-dots {
  position: absolute;
  bottom: 18px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.oc-dot {
  width: 7px; height: 7px; border-radius: 4px;
  background: #ccc; border: none; cursor: pointer; padding: 0;
  transition: width .3s, background .3s;
}
.oc-dot.active { width: 22px; background: var(--pur); }

/* ══ Progress bar ══ */
.oc-progress {
  position: absolute;
  bottom: 40px; left: 54px; right: 54px;
  height: 2px; background: rgba(83,74,183,.1);
  border-radius: 2px; overflow: hidden;
}
.oc-progress-bar {
  height: 100%; background: var(--pur-mid);
  border-radius: 2px; width: 0%; transition: width linear;
}

@media (hover: none) { .oc-hint { display: none; } }
