/* Craft Sticky Bar v1.4.0 */
:root {
  --csb-bg: #ffffff;
  --csb-pt: #1a1a1a;
  --csb-bb: #3b5bdb;
  --csb-bt: #ffffff;
  --csb-cb: #f1f3f5;
  --csb-ci: #1a1a1a;
  --csb-bw: 0px;
  --csb-bc: #e9ecef;
  --csb-cr: 14px;
  --csb-br: 14px;
  --csb-z: 999990;
}

#csb-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: var(--csb-z) !important;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--csb-bg);
  border-top: var(--csb-bw) solid var(--csb-bc);
  box-shadow: 0 -4px 24px rgba(0,0,0,.08);
  font-family: -apple-system,'Segoe UI',sans-serif;
  box-sizing: border-box;
}
#csb-bar.on {
  display: flex !important;
}

.csb-price {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--csb-pt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.csb-price del { opacity: .4; font-size: .72em; font-weight: 500; }
.csb-price ins { text-decoration: none; }

.csb-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Bouton panier */
.csb-cb {
  position: relative;
  width: 48px; height: 48px;
  border-radius: var(--csb-cr);
  border: none;
  background: var(--csb-cb);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s;
}
.csb-cb:hover  { transform: scale(1.06); }
.csb-cb:active { transform: scale(.96); }
.csb-cb .csb-ci {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--csb-ci);
  transition: opacity .18s;
}
.csb-cb .csb-cs {
  position: absolute;
  top: 50%; left: 50%;
  margin-top: -11px; margin-left: -11px;
  width: 22px; height: 22px;
  border: 2.5px solid rgba(26,26,26,.15);
  border-top-color: var(--csb-ci);
  border-radius: 50%;
  opacity: 0;
  animation: csb-spin .65s linear infinite;
  transition: opacity .18s;
}
.csb-cb.loading .csb-ci { opacity: 0; }
.csb-cb.loading .csb-cs { opacity: 1; }

/* Bouton acheter — SIMPLE, texte toujours visible */
.csb-bb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--csb-br);
  border: none;
  background: var(--csb-bb);
  color: var(--csb-bt);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
}
.csb-bb:hover  { opacity: .88; transform: scale(1.02); }
.csb-bb:active { transform: scale(.97); }
.csb-bb:disabled { opacity: .6; cursor: default; transform: none; }
.csb-bb .csb-bt { display: inline; transition: opacity .18s; }
.csb-bb .csb-bs {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: csb-spin .65s linear infinite;
  flex-shrink: 0;
}
.csb-bb.loading .csb-bt { opacity: .4; }
.csb-bb.loading .csb-bs { display: inline-block; }

/* Shortcode */
.csb-sc { display: inline-flex; align-items: center; gap: 8px; }
.csb-sc-fw { display: flex; width: 100%; }
.csb-sc-fw .csb-sc-b { flex: 1; min-width: 0; }

.csb-sc-c {
  position: relative;
  width: 44px; height: 44px;
  border-radius: var(--csb-cr, 12px);
  border: 1.5px solid rgba(0,0,0,.1);
  background: var(--csb-cb, #f1f3f5);
  cursor: pointer; flex-shrink: 0;
  transition: transform .15s;
}
.csb-sc-c:hover { transform: scale(1.06); }
.csb-sc-c .csb-ci {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--csb-ci, #1a1a1a);
  transition: opacity .18s;
}
.csb-sc-c .csb-cs {
  position: absolute; top: 50%; left: 50%;
  margin-top: -10px; margin-left: -10px;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(26,26,26,.15);
  border-top-color: var(--csb-ci, #1a1a1a);
  border-radius: 50%; opacity: 0;
  animation: csb-spin .65s linear infinite;
  transition: opacity .18s;
}
.csb-sc-c.loading .csb-ci { opacity: 0; }
.csb-sc-c.loading .csb-cs { opacity: 1; }

.csb-sc-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--csb-br, 12px);
  border: none;
  background: var(--csb-bb, #3b5bdb);
  color: var(--csb-bt, #fff);
  font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: opacity .15s;
}
.csb-sc-b:hover { opacity: .88; }
.csb-sc-b:disabled { opacity: .6; cursor: default; }
.csb-sc-b .csb-bt { display: inline; transition: opacity .18s; }
.csb-sc-b .csb-bs {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: csb-spin .65s linear infinite;
  flex-shrink: 0;
}
.csb-sc-b.loading .csb-bt { opacity: .4; }
.csb-sc-b.loading .csb-bs { display: inline-block; }

.csb-sc-small .csb-sc-c { width: 36px; height: 36px; }
.csb-sc-small .csb-sc-b { height: 36px; font-size: 12px; }
.csb-sc-large .csb-sc-c { width: 52px; height: 52px; }
.csb-sc-large .csb-sc-b { height: 52px; font-size: 15px; }

.csb-sc-msg     { font-size: 12px; font-weight: 600; color: #166534; }
.csb-sc-msg.err { color: #991b1b; }

@keyframes csb-spin { to { transform: rotate(360deg); } }

@media (max-width: 400px) {
  .csb-price { font-size: 14px; }
  .csb-bb { font-size: 12px; padding: 0 12px; height: 44px; }
  .csb-cb { width: 44px; height: 44px; }
  .csb-acts { gap: 6px; }
}
