/* Espai Mil·leni — Carrito + form styles (shared) */

/* ─── Cart button in header ─────────────────────────────────────────── */
.em-cart-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 4px;
  font-size: 13px; font-weight: 600;
  background: transparent; border: 1.5px solid #1d3d52;
  color: #1d3d52; cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  text-decoration: none;
}
.em-cart-btn:hover { background: #1d3d52; color: #fff; }
.em-cart-btn svg { width: 16px; height: 16px; }
.em-cart-badge {
  display: none;
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: #e06820; color: #fff;
  font-size: 10px; font-weight: 700;
  align-items: center; justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  font-family: 'Manrope', sans-serif;
}

/* ─── Drawer ────────────────────────────────────────────────────────── */
.em-drawer-root {
  position: fixed; inset: 0; z-index: 1500;
  pointer-events: none;
}
.em-drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(15,25,35,0.5);
  opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.em-drawer-root.open { pointer-events: auto; }
.em-drawer-root.open .em-drawer-overlay { opacity: 1; pointer-events: auto; }
.em-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  box-shadow: -16px 0 40px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.32,0.72,0.3,1);
}
.em-drawer-root.open .em-drawer { transform: translateX(0); }
.em-drawer-head {
  padding: 22px 24px 18px;
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid #ede9e3;
}
.em-drawer-eyebrow {
  font-size: 10px; font-weight: 700; color: #e06820;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 4px;
}
.em-drawer-head h2 {
  font-family: 'Bricolage Grotesque','Manrope',sans-serif;
  font-size: 22px; font-weight: 700; color: #1d3d52;
  letter-spacing: -0.02em;
}
.em-drawer-close {
  width: 34px; height: 34px;
  border-radius: 50%; background: #f8f7f5;
  border: 1px solid #e8e3d8;
  font-size: 22px; line-height: 1;
  cursor: pointer; color: #666;
  font-family: inherit;
}
.em-drawer-close:hover { background: #1d3d52; color: #fff; border-color: #1d3d52; }
.em-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 18px 24px;
}
.em-drawer-foot {
  border-top: 1px solid #ede9e3;
  padding: 18px 24px 22px;
  background: #fafaf8;
}

/* ─── Empty state ───────────────────────────────────────────────────── */
.em-empty {
  text-align: center; padding: 48px 16px;
  color: #888;
}
.em-empty-ic { font-size: 48px; margin-bottom: 12px; }
.em-empty h3 {
  font-family: 'Bricolage Grotesque','Manrope',sans-serif;
  font-size: 18px; color: #1d3d52; margin-bottom: 8px;
}
.em-empty p { font-size: 13px; line-height: 1.5; max-width: 280px; margin: 0 auto; }

/* ─── Line item ─────────────────────────────────────────────────────── */
.em-line {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0ede7;
}
.em-line:last-child { border-bottom: none; }
.em-line-img {
  width: 80px; height: 80px;
  background: #f4f0eb; border-radius: 6px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.em-line-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-line-ph {
  font-family: 'Courier New', monospace;
  font-size: 10px; font-weight: 700; color: #a89e8e;
  letter-spacing: 0.1em;
}
.em-line-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.em-line-name {
  font-family: 'Bricolage Grotesque','Manrope',sans-serif;
  font-size: 15px; font-weight: 700; color: #1d3d52;
  letter-spacing: -0.01em;
}
.em-line-meta {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 11px; color: #777;
}
.em-line-ref {
  font-family: 'Courier New', monospace;
  font-weight: 600; letter-spacing: 0.08em;
  color: #999;
}
.em-line-spec {
  display: inline-flex; align-items: center; gap: 5px;
}
.em-color-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid #00000022;
  display: inline-block;
}
.em-line-qty {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.em-line-qty button {
  width: 26px; height: 28px;
  border: 1.5px solid #ddd; background: #fff;
  border-radius: 4px;
  font-size: 14px; font-weight: 600; color: #1d3d52;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.em-line-qty button:hover { border-color: #1d3d52; background: #f8f7f5; }
.em-line-qty input {
  width: 50px; height: 28px;
  text-align: center;
  border: 1.5px solid #ddd; border-radius: 4px;
  font-size: 13px; font-weight: 600;
  font-family: inherit; outline: none;
  -moz-appearance: textfield;
}
.em-line-qty input::-webkit-outer-spin-button,
.em-line-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.em-line-qty input:focus { border-color: #1d3d52; }
.em-line-rm {
  width: auto !important;
  margin-left: auto;
  padding: 0 10px !important;
  font-size: 11px !important; font-weight: 500 !important;
  color: #999 !important; border-color: transparent !important;
}
.em-line-rm:hover { color: #c4202d !important; border-color: #c4202d !important; }

/* ─── Footer ────────────────────────────────────────────────────────── */
.em-foot-summary {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #444;
  margin-bottom: 12px;
}
.em-foot-summary strong { color: #1d3d52; font-size: 16px; }
.em-clear {
  background: none; border: none;
  font-size: 11px; color: #999;
  cursor: pointer; text-decoration: underline;
  font-family: inherit;
}
.em-clear:hover { color: #c4202d; }
.em-cta-info {
  display: block !important;
  text-align: center;
  width: 100%;
  font-size: 14px !important;
  padding: 14px 20px !important;
}
.em-cta-wa {
  background: #25D366 !important;
}
.em-cta-wa:hover { background: #1ca84e !important; }
.em-foot-note {
  font-size: 10px; color: #aaa; text-align: center;
  margin-top: 10px; line-height: 1.5;
}

/* ─── Toast ─────────────────────────────────────────────────────────── */
.em-toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1d3d52; color: #fff;
  padding: 11px 20px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0; transition: all 0.25s;
  z-index: 2000; pointer-events: none;
  font-family: 'Manrope', sans-serif;
}
.em-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Add-to-cart controls on product detail ─────────────────────────── */
.em-add-row {
  display: flex; gap: 10px; align-items: stretch;
  margin-top: 8px;
}
.em-qty-control {
  display: flex; align-items: center;
  border: 1.5px solid #ddd; border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.em-qty-control button {
  width: 40px; height: 50px;
  border: none; background: transparent;
  font-size: 18px; font-weight: 600; color: #1d3d52;
  cursor: pointer; font-family: inherit;
}
.em-qty-control button:hover { background: #f4f0eb; }
.em-qty-control input {
  width: 60px; height: 50px;
  text-align: center;
  border: none; outline: none;
  font-size: 15px; font-weight: 700; color: #1d3d52;
  font-family: inherit;
  border-left: 1.5px solid #ede9e3;
  border-right: 1.5px solid #ede9e3;
  -moz-appearance: textfield;
}
.em-qty-control input::-webkit-outer-spin-button,
.em-qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.em-add-btn {
  flex: 1;
  background: #e06820; color: #fff;
  padding: 14px 22px;
  border: none; border-radius: 4px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: background 0.15s;
}
.em-add-btn:hover { background: #c55a18; }
.em-add-btn svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 560px) {
  .em-drawer { width: 100vw; }
}
