/*
 * OFCIP Side-cart — Presentation-Layer Sovereignty
 * SPR-COMM-SIDECART-001 — Cardwest Commercial Experience Parity
 *
 * Single source of truth for side-cart presentation. All new classes
 * (ofcip-sc-*), zero dependency on legacy .of-cs-*/OF Mini Cart v7.x
 * selectors, which are retired from Additional CSS as part of this
 * sprint's zero-accretion mandate.
 *
 * The one unavoidable exception: .cart-widget-side is WoodMart's own
 * sliding drawer container (JS-driven open/close, backdrop) that this
 * template renders inside of -- there is no way to set the drawer's
 * required 800px total width without touching its own container. This
 * is the single, documented, minimal override kept in this file (not
 * scattered across Additional CSS).
 */

.cart-widget-side {
  width: 800px !important;
  max-width: 98vw !important;
}

/* ── Root: 2-column grid, 260px left / remainder right ────────────── */
.ofcip-sc-root {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: start;
  background: #ffffff;
  min-height: 100%;
}

/* ── LEFT COLUMN — Te puede interesar... ───────────────────────────── */
.ofcip-sc-left {
  background: #fafafa;
  border-right: 1px solid #e5e7eb;
  padding: 16px 12px;
  box-sizing: border-box;
}

.ofcip-sc-left__title {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
  margin: 0 0 12px;
}

.ofcip-sc-rec {
  margin-bottom: 14px;
}
.ofcip-sc-rec:last-child {
  margin-bottom: 0;
}

.ofcip-sc-rec__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.ofcip-sc-rec__img-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 6px;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ofcip-sc-rec__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ofcip-sc-rec__name {
  font-size: 12px;
  font-weight: 500;
  color: #111111;
  line-height: 1.3;
  text-align: center;
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ofcip-sc-rec__price {
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  text-align: center;
  display: block;
}
.ofcip-sc-rec__price del {
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  margin-right: 4px;
  text-decoration: line-through;
}
.ofcip-sc-rec__price ins {
  text-decoration: none;
  color: #111111;
}

.ofcip-sc-rec__cta {
  display: block;
  text-align: center;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-decoration: none;
  color: #111111;
  background: transparent;
  border-radius: 999px;
  border: 1px solid #111111;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ofcip-sc-rec__cta:hover {
  background: #111111;
  color: #ffffff;
}

/* ── RIGHT COLUMN — Carrito del cliente ────────────────────────────── */
.ofcip-sc-right {
  padding: 20px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Shipping info slot: real truthful copy, not a fabricated free-
   shipping progress bar (no shipping-zone threshold exists in this
   store's WooCommerce configuration -- verified live). */
.ofcip-sc-shipinfo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555555;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 14px;
}
.ofcip-sc-shipinfo svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #111111;
}

.ofcip-sc-empty {
  font-size: 14px;
  color: #6b7280;
  margin: 20px 0;
}

.ofcip-sc-items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.ofcip-sc-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.ofcip-sc-item:last-child {
  border-bottom: none;
}

.ofcip-sc-item__img-wrap {
  flex-shrink: 0;
  width: 90px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 6px;
  overflow: hidden;
}
.ofcip-sc-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ofcip-sc-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ofcip-sc-item__title {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.ofcip-sc-item__variation {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin-bottom: 4px;
}
.ofcip-sc-item__variation p {
  margin: 0;
}

.ofcip-sc-item__price {
  font-size: 15px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 8px;
}

.ofcip-sc-item__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.ofcip-sc-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 4px;
  position: relative;
  z-index: 2;
}
.ofcip-sc-stepper__btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #111111;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.ofcip-sc-stepper__btn:hover {
  background: #f2f2f2;
}
.ofcip-sc-stepper__value {
  min-width: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.ofcip-sc-stepper--busy {
  opacity: .5;
  pointer-events: none;
}

.ofcip-sc-item__remove {
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  padding: 4px;
}
.ofcip-sc-item__remove:hover {
  color: #111111;
}

/* ── Footer: subtotal + actions, always visually attached ──────────── */
.ofcip-sc-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.ofcip-sc-footer__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 12px;
}

.ofcip-sc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.ofcip-sc-btn--secondary {
  background: #ffffff;
  border: 1px solid #111111;
  color: #111111;
}
.ofcip-sc-btn--primary {
  background: #111111;
  border: 1px solid #111111;
  color: #ffffff;
  height: 48px;
  margin-bottom: 0;
}
.ofcip-sc-btn--secondary:hover {
  background: #f5f5f5;
  color: #111111;
}
.ofcip-sc-btn--primary:hover {
  background: #000000;
  color: #ffffff;
}

/* Suppress the redundant global floating support bubble only while the
   drawer is open, so it never covers the footer/stepper. */
body:has(.cart-widget-side.wd-opened) .ofcip-unified-entry {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE (< 768px) — cart-first vertical stack, not the desktop grid
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .cart-widget-side {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .ofcip-sc-root {
    display: flex;
    flex-direction: column;
  }

  /* Cart-first: recommendations come AFTER the cart column entirely. */
  .ofcip-sc-left {
    order: 2;
    border-right: none;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
  }
  .ofcip-sc-left__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888888;
    width: 100%;
  }
  /* Compact horizontal carousel: the two recommendation cards sit
     side by side, each roughly half the drawer width. */
  .ofcip-sc-left__cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }
  .ofcip-sc-rec {
    flex: 0 0 46%;
    margin-bottom: 0;
  }

  .ofcip-sc-right {
    order: 1;
    padding: 16px;
  }
  .ofcip-sc-item__img-wrap {
    width: 80px;
    height: 90px;
  }
}
