/* =====================================================================
   QUICK CART
   The drawer the header's cart button opens, measured from the Figma frames
   docs/design/kosik/rychlykosik.png and celynahlad.png: a 500px panel on the
   right with 48px of padding, over a page darkened to 70% black and blurred
   by 5px.
   ===================================================================== */

.quick-cart {
  position: fixed;
  inset: 0;
  z-index: 1080;
}

.quick-cart[hidden] { display: none; }

.quick-cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .24s ease;
}

.quick-cart.is-open .quick-cart-backdrop { opacity: 1; }

.quick-cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(500px, 100%);
  height: 100%;
  padding: 48px;
  border-radius: 24px 0 0 24px;
  background: #FFFFFF;
  box-shadow: -24px 0 60px rgba(32, 35, 28, 0.18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1);
  overflow: hidden;
}

.quick-cart.is-open .quick-cart-panel { transform: translateX(0); }

/* The panel is the scroll box: the heading scrolls with the rest, as in the
   frame, and the scrollbar itself stays out of the way. */
.quick-cart-body {
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* The frame draws no scrollbar; the panel still scrolls by wheel, touch and
     keyboard, and its own edge is what says there is more below. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quick-cart-body::-webkit-scrollbar { display: none; }

/* ---- Heading ---- */
.quick-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.quick-cart-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  color: #20231C;
}

.quick-cart-count {
  margin-left: 8px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  color: #727272;
  top: -0.6em;
}

.quick-cart-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #727272;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.quick-cart-close:hover { background: #F1F1ED; color: #20231C; }

/* ---- Lines in the cart ---- */
.quick-cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-cart-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: #F8F9F7;
}

.quick-cart-item-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/*
  A tall slim thumbnail, as the frame shows it: the product standing beside its
  name. The frame's own photo is a tight crop of a door; ours carry white around
  them, so the whole photo is fitted into the box rather than cropped to its
  middle - a white door cropped that way showed nothing at all.
*/
.quick-cart-item-media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 58px;
  border-radius: 8px;
  background: #FFFFFF;
  color: #CCBDAA;
  font-size: 18px;
  overflow: hidden;
}

.quick-cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.quick-cart-item-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.quick-cart-stock {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #B9E8C4;
  color: #007124;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.24;
}

.quick-cart-stock--out { background: #FDE4E4; color: #B3261E; }

.quick-cart-item-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-remove {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #727272;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease;
}

.quick-cart-remove:hover { color: #B3261E; }

.quick-cart-item-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.quick-cart-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 126px;
  height: 45px;
  padding: 0 20px;
  border: 1px solid #CCCFC6;
  border-radius: 16px;
  background: transparent;
}

.quick-cart-qty-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #20231C;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.quick-cart-qty-btn:disabled { color: #CCCFC6; cursor: default; }

.quick-cart-qty-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.quick-cart-item-price strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-item-price span {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #616161;
}

/* ---- What else the order could use ---- */
.quick-cart-upsell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, #F8F9F7 0%, #FFFFFF 42.08%);
}

.quick-cart-upsell-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #2F2F2F;
}

/* The arrows sit over the rail's edges, centred on the cards. */
.quick-cart-upsell-shell { position: relative; }

.quick-cart-rail-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 6px 20px rgba(32, 35, 28, 0.16);
  color: #6E775F;
  font-size: 13px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity .18s ease;
}

.quick-cart-rail-arrow--prev { left: -6px; }
.quick-cart-rail-arrow--next { right: -6px; }

.quick-cart-rail-arrow:disabled { opacity: 0; pointer-events: none; }

.quick-cart-upsell-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overflow-anchor: none;
  scrollbar-width: none;
}

.quick-cart-upsell-rail::-webkit-scrollbar { display: none; }

.quick-cart-upsell-card {
  display: flex;
  flex: 0 0 calc((100% - 16px) / 2);
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 24px;
  background: #F8F9F7;
  scroll-snap-align: start;
}

.quick-cart-upsell-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  color: #B1B4AA;
  font-size: 20px;
}

.quick-cart-upsell-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.quick-cart-upsell-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #2F2F2F;
}

.quick-cart-upsell-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
}

.quick-cart-upsell-price strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #2F2F2F;
}

.quick-cart-upsell-price span {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #9F9F9F;
}

.quick-cart-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #EF8739 0%, #F29E50 100%);
  color: #40190C;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.quick-cart-add:disabled { opacity: .5; cursor: default; }

.quick-cart-rail-bars {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.quick-cart-rail-bars[hidden] { display: none; }

.quick-cart-rail-bars span {
  width: 29px;
  height: 7px;
  border-radius: 999px;
  background: #E1E2DD;
}

.quick-cart-rail-bars span.is-active { background: #8D957F; }

/* ---- Summary ---- */
.quick-cart-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #FEF8EF 0%, #FDF0D9 100%);
}

.quick-cart-summary-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-summary-row span:last-child { text-align: right; }

.quick-cart-summary-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding-top: 16px;
  border-top: 3px solid #F9DBB2;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-summary-net {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-top: -8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #868686;
}

.quick-cart-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 16px 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #EF8739 0%, #F29E50 100%);
  color: #40190C;
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.quick-cart-cta:hover { color: #40190C; filter: brightness(1.03); }

.quick-cart-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: .75;
}

.quick-cart-logos img { height: 14px; width: auto; }

.quick-cart-logo-text {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #555555;
}

/* ---- Nothing in it yet ---- */
.quick-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: auto 0;
  padding: 24px 20px;
  border-radius: 24px;
  background: #F8F9F7;
}

.quick-cart-empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #20231C;
}

.quick-cart-empty-text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.48;
  color: #616161;
}

/* The page must not scroll behind an open drawer. */
body.quick-cart-open { overflow: hidden; }

@media (max-width: 575.98px) {
  .quick-cart-panel {
    width: 100%;
    padding: 24px 20px;
    border-radius: 0;
  }

  .quick-cart-title { font-size: 28px; }
  .quick-cart-body { gap: 20px; }
}
