/* commerce.css - shared cart + personalization UI */

/* Cart button badge */
.cartBtn { display:inline-flex; align-items:center; gap:10px; }
.cartCount{
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: rgba(0,0,0,.08);
  font-size: 12px; font-weight: 800;
}

/* Cart overlay + drawer */
.cartOverlay{ position: fixed; inset: 0; background: rgba(0,0,0,.45); display:none; z-index: 9998; }
.cartOverlay.open{ display:block; }

.cartDrawer{
  position: fixed; top: 0; right: 0;
  width: min(420px, 92vw);
  height: 100dvh;
  background: var(--card, #fff);
  box-shadow: -20px 0 40px rgba(0,0,0,.15);
  transform: translateX(110%);
  transition: transform .22s ease;
  z-index: 9999;
  display:flex; flex-direction:column;
  padding: 14px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.cartDrawer.open{ transform: translateX(0); }

.cartHead{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.cartTitle{ font-size: 18px; font-weight: 900; }
.cartClose{ border:0; background:transparent; font-size: 18px; cursor:pointer; padding:10px; }

.cartList{ margin-top: 10px; overflow:auto; flex: 1 1 auto; display:flex; flex-direction:column; gap:10px; }

.cartItem{
  display:grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.7);
}
.cartItem img{
  width: 62px; height: 62px;
  object-fit: contain; object-position:center;
  background: rgba(0,0,0,.03);
  border-radius: 12px;
  padding: 6px;
}

.ciName{ font-weight: 800; line-height:1.15; }
.ciMeta{ font-size: 12px; color: var(--muted); margin-top: 3px; }
.ciOpts{ font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.25; }
.ciRow{ display:flex; align-items:center; justify-content:space-between; gap: 10px; margin-top: 8px; }

.qty{
  display:inline-flex; align-items:center; gap: 8px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}
.qty button{
  border:0; background: rgba(0,0,0,.06);
  width: 28px; height: 28px; border-radius: 999px;
  cursor:pointer; font-weight: 900;
}
.qty span{ min-width: 18px; text-align:center; font-weight: 800; }

.cartFoot{ border-top: 1px solid rgba(0,0,0,.10); padding-top: 12px; margin-top: 12px; }
.cartSumRow{ display:flex; align-items:center; justify-content:space-between; font-weight: 900; margin-bottom: 10px; }
#paypalButtons{ margin-top: 8px; }
.cartNote{ font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Personalization modal (Shop) */
.pOverlay{ position: fixed; inset:0; background: rgba(0,0,0,.45); display:none; z-index: 9997; }
.pOverlay.open{ display:block; }

.pModal{
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 94vw);
  max-height: 88dvh;
  overflow:auto;
  background: var(--card, #fff);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  display:none;
  z-index: 9999;
  padding: 14px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.pModal.open{ display:block; }

.pHead{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.pTitle{ font-size: 18px; font-weight: 900; }
.pSub{ font-size: 12px; color: var(--muted); margin-top: 2px; }
.pClose{ border:0; background:transparent; font-size: 18px; cursor:pointer; padding:10px; }

.pGrid{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pGrid .full{ grid-column: 1 / -1; }
@media (max-width: 640px){ .pGrid{ grid-template-columns: 1fr; } }

.field label{ display:block; font-size:12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.field textarea{ min-height: 110px; resize: vertical; }

.pActions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; margin-top: 12px; }

/* Reuse hint box */
.hintBox{
  margin-top: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.6);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
/* Versand-Auswahl im Cart */
.shipRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.shipOpt{
  display:inline-flex;
  gap:10px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.7);
  cursor:pointer;
  user-select:none;
}
.shipOpt input{ transform: translateY(1px); }
