/* ============================================================
   grafs_stickycart v15 — Panel minimalista + Sticky bar
   ============================================================ */

:root {
  --gsac-green:  #889926;
  --gsac-green2: #6d7a1e;
  --gsac-white:  #ffffff;
  --gsac-gray:   #f5f5f5;
  --gsac-border: #e5e5e5;
  --gsac-text:   #333333;
  --gsac-speed:  0.32s;
}

/* Suprimir modal nativo de PS y su backdrop */
#blockcart-modal { display: none !important; }
.modal-backdrop   { display: none !important; }

/* Evitar que Bootstrap bloquee el scroll */
body.modal-open {
  overflow: auto !important;
  overflow-y: scroll !important;
  padding-right: 0 !important;
}

/* ============================================================
   OVERLAY
   ============================================================ */
.gsac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.gsac-overlay.gsac-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* ============================================================
   PANEL LATERAL
   ============================================================ */
.gsac-panel {
  position: fixed;
  top: 0; right: 0;
  width: 420px;
  max-width: 96vw;
  height: 100%;
  background: var(--gsac-white);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--gsac-speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.14);
  will-change: transform;
}
.gsac-panel.gsac-open { transform: translateX(0); }

/* ── Header ── */
.gsac-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gsac-border);
  flex-shrink: 0;
}
.gsac-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gsac-text);
  letter-spacing: -0.2px;
}

.gsac-panel-close {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  border-radius: 4px;
}
.gsac-panel-close:hover { color: var(--gsac-text); }
.gsac-panel-close .material-icons { font-size: 24px; }

/* ── Notificación añadido ── */
.gsac-added-product {
  display: none;
  background: #eef5ec;
  border-bottom: 1px solid #c8dfc9;
  padding: 10px 24px;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}
.gsac-added-inner { display: flex; align-items: center; gap: 10px; width: 100%; }
.gsac-check-icon  { color: var(--gsac-green); font-size: 20px !important; }
.gsac-added-label { font-size: 11px; color: #666; margin: 0; text-transform: uppercase; letter-spacing: 0.4px; }
.gsac-added-name  { font-size: 13px; font-weight: 600; color: var(--gsac-text); margin: 2px 0 0; }

/* ── Cabeceras de columna ── */
.gsac-col-headers {
  display: flex;
  justify-content: space-between;
  padding: 7px 24px;
  background: var(--gsac-gray);
  border-bottom: 1px solid var(--gsac-border);
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Body scrollable ── */
.gsac-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gsac-panel-body::-webkit-scrollbar { display: none; }

/* Loading */
.gsac-panel-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}
.gsac-spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--gsac-border);
  border-top-color: var(--gsac-green);
  border-radius: 50%;
  animation: gsac-spin 0.7s linear infinite;
}
@keyframes gsac-spin { to { transform: rotate(360deg); } }

/* ── Items de carrito (25% más grandes que base — +5% sobre v13) ── */
.gsac-cart-item {
  display: flex;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gsac-border);
}

/* Animación de salida al eliminar */
@keyframes gsac-item-exit {
  from { opacity: 1; max-height: 140px; padding-top: 16px; padding-bottom: 16px; }
  to   { opacity: 0; max-height: 0;     padding-top: 0;    padding-bottom: 0;    border-bottom-width: 0; }
}
.gsac-cart-item.gsac-removing {
  animation: gsac-item-exit 0.28s ease-out forwards;
  overflow: hidden;
  pointer-events: none;
}

.gsac-cart-item-img {
  width: 100px; height: 100px;
  object-fit: contain;
  border: 1px solid var(--gsac-border);
  border-radius: 8px;
  flex-shrink: 0;
  background: #fdfdfd;
}
.gsac-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #ddd;
}
.gsac-img-placeholder .material-icons { font-size: 34px; }

.gsac-cart-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Fila superior: info izquierda + precios derecha */
.gsac-cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.gsac-cart-item-info {
  flex: 1;
  min-width: 0;
}

/* Nombre */
.gsac-cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gsac-text);
  margin: 0;
  line-height: 1.4;
}
.gsac-item-name-link {
  color: inherit;
  text-decoration: none;
}
.gsac-item-name-link:hover {
  color: var(--gsac-green);
  text-decoration: underline;
}

.gsac-cart-item-brand {
  font-size: 12px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 2px 0 0;
}

.gsac-cart-item-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 1px;
}
.gsac-cart-item-regular {
  font-size: 13px;
  color: #bbb;
  text-decoration: line-through;
  white-space: nowrap;
}
.gsac-cart-item-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--gsac-text);
  white-space: nowrap;
}
.gsac-cart-item-total--sale {
  color: #f36767;
}

.gsac-cart-item-unit {
  font-size: 12px;
  color: #999;
  margin: 0;
}

/* ── Controles: pill cantidad + eliminar ── */
.gsac-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.gsac-qty-pill {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gsac-border);
  border-radius: 10px;
  background: #fff;
  height: 38px;
  overflow: hidden;
}
.gsac-qty-pill-btn {
  background: none;
  border: none;
  width: 34px;
  height: 100%;
  font-size: 19px;
  cursor: pointer;
  color: var(--gsac-text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.gsac-qty-pill-btn:hover { background: var(--gsac-gray); }
.gsac-qty-pill-num {
  min-width: 31px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--gsac-text);
  border-left: 1.5px solid var(--gsac-border);
  border-right: 1.5px solid var(--gsac-border);
  padding: 0 4px;
  line-height: 38px;
}

.gsac-item-delete {
  background: none;
  border: 1.5px solid var(--gsac-border);
  border-radius: 10px;
  width: 38px; height: 38px;
  cursor: pointer;
  color: #ccc;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  margin-left: auto;
}
.gsac-item-delete:hover { color: #e63946; border-color: #e63946; }
.gsac-item-delete .material-icons { font-size: 18px; }

/* Carrito vacío */
.gsac-empty-cart {
  text-align: center;
  padding: 50px 20px;
  color: #bbb;
}
.gsac-empty-cart .material-icons { font-size: 52px; display: block; margin-bottom: 14px; color: #ddd; }
.gsac-empty-cart p { font-size: 14px; margin: 0; }

/* ── Total estimado ── */
.gsac-panel-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 24px 14px;
  border-top: 2px solid var(--gsac-border);
}
.gsac-panel-total-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gsac-green);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 0 0 4px;
}
.gsac-panel-total-note {
  font-size: 10px;
  color: #bbb;
  margin: 0;
  line-height: 1.4;
  max-width: 190px;
}
.gsac-panel-total-amount {
  font-size: 17px;
  font-weight: 700;
  color: var(--gsac-text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Área de hook promocional ── */
.gsac-hook-promo {
  padding: 10px 16px 4px;
  flex-shrink: 0;
}

/* ── Footer: botones ── */
.gsac-panel-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--gsac-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--gsac-white);
  flex-shrink: 0;
}
.gsac-btn-cart,
.gsac-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  letter-spacing: 0.2px;
  transition: background 0.2s, color 0.2s;
}
.gsac-btn-cart {
  background: var(--gsac-white);
  color: var(--gsac-green) !important;
  border: 1.5px solid var(--gsac-green);
}
.gsac-btn-cart:hover { background: #f5f7eb; }
.gsac-btn-checkout {
  background: var(--gsac-green);
  color: var(--gsac-white) !important;
  border: none;
}
.gsac-btn-checkout:hover { background: var(--gsac-green2); }

/* ============================================================
   STICKY BAR
   ============================================================ */
.gsac-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--gsac-white);
  border-top: 2px solid var(--gsac-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.09);
  z-index: 9990;
  transform: translateY(100%);
  transition: transform var(--gsac-speed) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.gsac-sticky-bar.gsac-visible { transform: translateY(0); }

.gsac-sticky-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gsac-sticky-product {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.gsac-sticky-thumb {
  width: 52px; height: 52px;
  object-fit: contain;
  border: 1px solid var(--gsac-border);
  border-radius: 6px;
  background: #fdfdfd;
  flex-shrink: 0;
}
.gsac-sticky-info { min-width: 0; }
.gsac-sticky-name {
  font-size: 17px;
  font-weight: 500;
  color: #666;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(460px, 42vw);
}
.gsac-sticky-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  line-height: 1;
}
.gsac-sticky-price-normal {
  font-size: 17px;
  font-weight: 700;
  color: var(--gsac-text);
}
.gsac-sticky-price-regular {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
  font-weight: 400;
}
.gsac-sticky-price-sale {
  font-size: 18px;
  font-weight: 700;
  color: #f36767;
}
.gsac-sticky-discount-pill {
  background: #fde8e8;
  color: #f36767;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  white-space: nowrap;
}

.gsac-sticky-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Control de cantidad sticky: igual que .druni-qty-control ── */
.gsac-sticky-qty {
  display: flex;
  align-items: stretch;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  height: 50px;
  flex-shrink: 0;
  background: #fff;
}
.gsac-qty-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 100%;
  cursor: pointer;
  color: #444;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.gsac-qty-btn:hover {
  color: var(--gsac-green);
  background: #f5f5f5;
}
.gsac-qty-btn .material-icons { font-size: 16px; pointer-events: none; }
.gsac-qty-input {
  width: 44px; height: 100%;
  border: none;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
  text-align: center;
  font-size: 15px; font-weight: 600;
  color: var(--gsac-text);
  background: #fff;
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
  flex-shrink: 0;
}
.gsac-qty-input::-webkit-outer-spin-button,
.gsac-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; }

/* ── Botón añadir sticky: igual que .druni-single-add-btn ── */
.gsac-sticky-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  background: var(--gsac-green);
  color: var(--gsac-white);
  border: 2px solid var(--gsac-green);
  border-radius: 8px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}
.gsac-sticky-add-btn:hover {
  background: #1a3324;
  border-color: #1a3324;
}
.gsac-sticky-add-btn.gsac-loading { pointer-events: none; opacity: 0.75; }
.gsac-sticky-add-btn .material-icons { font-size: 18px; }

/* ── Botón favoritos sticky: igual que .druni-wishlist-container ── */
.gsac-sticky-wish-btn {
  background: none;
  border: 1px solid #eaeaea;
  border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #aaa;
  transition: color 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.gsac-sticky-wish-btn:hover { color: #e63946; border-color: #ff4040; }
.gsac-sticky-wish-btn.gsac-wished { color: #e63946; border-color: #e63946; }
.gsac-wish-icon { font-size: 20px !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .gsac-panel { width: 100%; max-width: 100%; }

  .gsac-sticky-inner { padding: 8px 12px; gap: 8px; }
  .gsac-sticky-thumb { display: none; }
  .gsac-sticky-name             { font-size: 13px; max-width: 130px; }
  .gsac-sticky-price-normal     { font-size: 14px; }
  .gsac-sticky-price-sale       { font-size: 15px; }
  .gsac-sticky-price-regular    { font-size: 11px; }
  .gsac-sticky-discount-pill    { font-size: 10px; padding: 1px 6px; }

  /* Botón añadir: solo icono en móvil */
  .gsac-sticky-add-btn span { display: none; }
  .gsac-sticky-add-btn { padding: 0 14px; }
  .gsac-sticky-add-btn .material-icons { font-size: 20px; }

  .gsac-sticky-wish-btn { display: none; }

  .gsac-cart-item-img      { width: 80px; height: 80px; }
  .gsac-panel-total-amount { font-size: 20px; }
  .gsac-panel-footer       { padding: 10px 14px 16px; }
}

@media (max-width: 400px) {
  .gsac-sticky-name  { max-width: 90px; }
  .gsac-sticky-qty   { height: 44px; }
  .gsac-sticky-add-btn { height: 44px; }
  .gsac-sticky-wish-btn { display: none; }
}

/* ──────────────────────────────────────────────────────────────
   Free shipping bar (panel header — encima de items)
   ────────────────────────────────────────────────────────────── */
.gsac-freeship {
  padding: 10px 16px 12px;
  background: #264934;
  border-bottom: 1px solid #1d3a29;
  text-align: center;
}
.gsac-freeship-msg {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
}
.gsac-freeship-msg strong {
  font-weight: 700;
  color: #fff;
}
.gsac-freeship-bar {
  width: 100%;
  height: 4.4px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  overflow: hidden;
}
.gsac-freeship-fill {
  height: 100%;
  width: 0;
  background: #a8d44f;
  transition: width 0.35s ease;
  border-radius: 2px;
}
/* Estado: envío gratis conseguido — fondo verde + texto blanco, centrado */
.gsac-freeship--achieved {
  background: var(--brand-green, #6a8f2f);
  border-bottom-color: var(--brand-green, #6a8f2f);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
}
.gsac-freeship--achieved .gsac-freeship-msg {
  margin: 0;
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.gsac-freeship--achieved .gsac-freeship-msg strong { color: #fff; }
.gsac-freeship--achieved .gsac-freeship-bar { display: none; }

/* Estado: pedido > peso máx → no elegible para envío gratis.
   Fondo claro propio (el fondo verde oscuro base haría ilegible el texto marrón). */
.gsac-freeship--ineligible {
  background: #fdf3e0;
  border-bottom-color: #f0e0c0;
}
.gsac-freeship--ineligible .gsac-freeship-msg {
  color: #8b6914;
}
.gsac-freeship--ineligible .gsac-freeship-fill {
  background: #d9b86a;
}
