/* ───────── Carrito compartido (portada y subpáginas) ─────────
   Hoja autónoma: no depende de las variables de styles.css ni de sub.css. */
.glc {
  --glc-ink: #0e0e10; --glc-muted: #62656d; --glc-line: rgba(14, 14, 16, .12); --glc-red: #c95153; --glc-red-deep: #a63e40;
  position: fixed; inset: 0; z-index: 120; font-family: inherit; color: var(--glc-ink);
}
.glc[hidden] { display: none; }
.glc-lock, .glc-lock body { overflow: hidden; }
.glc-scrim { position: absolute; inset: 0; background: rgba(14, 14, 16, .45); opacity: 0; transition: opacity .3s; }
.glc-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 60px rgba(0, 0, 0, .18);
  transform: translateX(100%); transition: transform .38s cubic-bezier(.22, 1, .36, 1); outline: none;
}
.glc.is-open .glc-scrim { opacity: 1; }
.glc.is-open .glc-panel { transform: none; }
.glc-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--glc-line); }
.glc-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; text-transform: uppercase; line-height: 1.1; }
.glc-n { color: var(--glc-muted); font-weight: 600; }
.glc-x { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--glc-line); border-radius: 8px; background: none; color: inherit; cursor: pointer; }
.glc-x:hover { border-color: var(--glc-ink); }
.glc-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.glc-list { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 4px 22px; }
.glc-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--glc-line); }
.glc-img { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 8px; background: #f3f4f6; overflow: hidden; }
.glc-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; padding: 6px; }
.glc-star { width: 26px; height: 26px; background: var(--glc-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 0C21.5 12 28 18.5 40 20 28 21.5 21.5 28 20 40 18.5 28 12 21.5 0 20 12 18.5 18.5 12 20 0Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 0C21.5 12 28 18.5 40 20 28 21.5 21.5 28 20 40 18.5 28 12 21.5 0 20 12 18.5 18.5 12 20 0Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.glc-name { display: block; font-weight: 700; font-size: .98rem; line-height: 1.25; color: inherit; text-decoration: none; }
.glc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.glc-var { margin: 3px 0 0; color: var(--glc-muted); font-size: .86rem; }
.glc-qty { display: inline-flex; align-items: center; margin-top: 10px; border: 1px solid var(--glc-line); border-radius: 8px; }
.glc-qty button { width: 32px; height: 32px; padding: 0; border: 0; background: none; color: inherit; font-size: 1.05rem; cursor: pointer; }
.glc-qty button:hover { background: #f3f4f6; }
.glc-qty span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; font-size: .92rem; }
.glc-end { display: grid; justify-items: end; gap: 8px; font-variant-numeric: tabular-nums; }
.glc-end b { font-size: .98rem; white-space: nowrap; }
.glc-del { padding: 0; border: 0; background: none; color: var(--glc-muted); font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.glc-del:hover { color: var(--glc-red-deep); }

.glc-empty { display: none; flex: 1 1 auto; padding: 40px 22px; text-align: center; color: var(--glc-muted); }
.glc.is-empty .glc-empty { display: block; }
.glc.is-empty .glc-list, .glc.is-empty .glc-row, .glc.is-empty .glc-note, .glc.is-empty .glc-pay { display: none; }
.glc-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.glc-links a { padding: 9px 14px; border: 1px solid var(--glc-line); border-radius: 999px; color: var(--glc-ink); text-decoration: none; font-size: .9rem; font-weight: 600; }
.glc-links a:hover { border-color: var(--glc-ink); }

.glc-foot { display: grid; gap: 10px; padding: 18px 22px 22px; border-top: 1px solid var(--glc-line); }
.glc-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.glc-row b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.glc-note { margin: 0; color: var(--glc-muted); font-size: .82rem; line-height: 1.45; }
.glc-pay, .glc-more { height: 50px; border-radius: 8px; font: inherit; font-weight: 700; font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.glc-pay { border: 0; background: var(--glc-ink); color: #fff; }
.glc-pay:hover { background: var(--glc-red-deep); }
.glc-more { border: 1px solid var(--glc-line); background: #fff; color: var(--glc-ink); }
.glc-more:hover { border-color: var(--glc-ink); }
.glc-msg { margin: 0; min-height: 1.2em; color: var(--glc-red-deep); font-size: .86rem; }

.glc-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 110; transform: translate(-50%, 16px); opacity: 0; visibility: hidden;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 18px; border-radius: 10px;
  background: #0e0e10; color: #fff; font-size: .9rem; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45);
  transition: opacity .25s, transform .4s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .4s;
}
.glc-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glc-toast button { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: #fff; color: #0e0e10; font: inherit; font-weight: 700; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
.glc-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .4s cubic-bezier(.22, 1, .36, 1), visibility 0s; }

@media (max-width: 480px) {
  .glc-item { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; }
  .glc-img { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .glc-panel, .glc-scrim, .glc-toast { transition-duration: .01ms; }
}
