/* Full-page bag, based on the France storefront's product and summary layout. */
#bag-view {
  min-height: calc(100dvh - 166px);
  padding: 26px 22px 64px;
  background: #f8f8f8;
  color: #111;
}

#bag-view #cart-title {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: 0;
}

#bag-view #cart-title span { font-weight: 400; }

.bag-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  align-items: start;
  gap: 20px;
}

.bag-left,
.bag-items,
.bag-item-copy,
.bag-summary { min-width: 0; }

#bag-view .cart-item.bag-item {
  display: grid;
  grid-template-columns: minmax(120px, 25%) minmax(0, 1fr);
  gap: 24px;
  margin: 0;
  padding: 24px;
  border: 0;
  border-bottom: 1px solid #c8c8c8;
  background: #fff;
}

#bag-view .bag-item-image {
  display: block;
  align-self: start;
  overflow: hidden;
  text-decoration: none;
  background: #eee;
}

#bag-view .cart-item .bag-item-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  background: #eee;
}

.bag-item-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#bag-view .bag-item-copy h2 {
  margin: 0 32px 14px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.bag-item-copy h2 a { text-decoration: none; }
.bag-item-copy h2 a:hover { text-decoration: underline; }

#bag-view .bag-remove {
  position: absolute;
  top: -6px;
  right: -8px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font: 300 28px/1 Arial, sans-serif;
}

.bag-remove svg { width: 24px; height: 24px; }
#bag-view .bag-remove:hover { background: #f3f3f3; }

#bag-view .cart-item p.bag-color,
#bag-view .cart-item p.bag-size {
  margin: 0 0 3px;
  color: #666;
  font-size: 16px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.bag-quantity-price {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 16px;
}

#bag-view .qty {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
  height: 32px;
  overflow: hidden;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  background: #fff;
}

#bag-view .qty button {
  display: inline-grid;
  width: 32px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #222;
  font-size: 22px;
  font-weight: 400;
  line-height: 30px;
}

#bag-view .qty button:hover:not(:disabled) { background: #f3f3f3; }
#bag-view .qty button:disabled { color: #aaa; cursor: default; }

#bag-view .qty span,
#bag-view .qty input {
  display: inline-block;
  width: 32px;
  min-width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 16px;
  line-height: 30px;
  text-align: center;
}

#bag-view .qty input { appearance: textfield; }
#bag-view .qty input::-webkit-inner-spin-button,
#bag-view .qty input::-webkit-outer-spin-button { margin: 0; appearance: none; }

.bag-line-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  margin-left: auto;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  text-align: right;
}

.bag-old-price { color: #6d6d6d; font-size: 14px; font-weight: 400; line-height: 18px; }
.bag-line-price > strong { white-space: nowrap; font-weight: 600; }

.bag-line-price .sale-price-set { justify-content: flex-end; gap: 3px 7px; }
.bag-line-price .sale-was { font-size: 15px; }
.bag-line-price .sale-now { font-size: 18px; }
.bag-line-price .sale-badge { font-size: 10px; }

.bag-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px 24px;
  margin-top: auto;
  padding-top: 22px;
}

#bag-view .bag-item-actions button,
#bag-view .bag-item-actions a {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid #bdbdbd;
  border-radius: 0;
  background: transparent;
  color: #222;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
  text-decoration: none;
}

#bag-view .bag-item-actions button:hover,
#bag-view .bag-item-actions a:hover { border-bottom-color: #111; }

#bag-view .cart-item .size-reselect {
  margin: 6px 0 0;
  color: #9e1730;
  font-size: 14px;
  line-height: 19px;
}

.bag-summary { align-self: start; }

.bag-summary .bag-promo {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.bag-promo summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 10px;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.bag-promo summary::-webkit-details-marker { display: none; }
.bag-promo summary::marker { content: ''; }
.bag-promo summary::before {
  content: '+';
  display: inline-block;
  flex: 0 0 16px;
  font-size: 27px;
  font-weight: 400;
  line-height: 24px;
  text-decoration: none;
}
.bag-promo[open] summary::before { content: '−'; }

.bag-promo form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 0 0;
}

.bag-promo form > div { display: flex; align-items: flex-end; gap: 8px; min-width: 0; width: 100%; }

.bag-promo label {
  flex: 1 1 100%;
  font-size: 14px;
  line-height: 19px;
}

.bag-promo label:has(input) { flex: 1 1 160px; }

.bag-promo input {
  flex: 1 1 140px;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid #777;
  border-radius: 3px;
  background: #fff;
  font-size: 16px;
}

.bag-promo form button {
  flex: 0 0 auto;
  height: 44px;
  padding: 10px 16px;
  border: 1px solid #111;
  border-radius: 3px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.bag-promo form button:hover { background: #eee; }
.bag-promo > p { margin: 10px 0 0; font-size: 14px; line-height: 19px; }

.bag-summary #cart-total { margin: 0; }
.bag-summary #cart-total .bag-summary-row,
.bag-summary #cart-total > p,
.bag-summary .cart-sale-summary > p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid #d7d7d7;
  font-size: 16px;
  line-height: 21px;
}

.bag-summary #cart-total .bag-summary-row > :last-child,
.bag-summary #cart-total > p > :last-child,
.bag-summary .cart-sale-summary > p > :last-child { text-align: right; }

.bag-summary .cart-sale-summary { margin: 0; padding: 0; }
.bag-summary .cart-sale-saving { color: #9e1730; }
.bag-summary .cart-sale-saving strong { font-weight: 600; }
.bag-summary .bag-shipping { margin: 14px 0 3px; }
.bag-summary .bag-shipping label { display: block; margin-bottom: 8px; font-size: 16px; line-height: 21px; }

.bag-summary select {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 52px;
  padding: 12px 14px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 400;
  text-overflow: ellipsis;
}

.bag-summary #cart-total .total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 13px 0 17px;
  border: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.bag-summary #cart-total .total > :last-child { white-space: nowrap; text-align: right; }
.bag-summary .market-note { margin: 8px 0 16px; font-size: 13px; line-height: 18px; }
#bag-actions { margin: 0; }
#bag-checkout-status { margin: 12px 0 0; color: #9e1730; font-size: 14px; line-height: 19px; }
#bag-checkout-status:empty { display: none; }

.bag-payment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 53px;
  padding: 0 16px;
  border: 1px solid #d31334;
  border-radius: 4px;
  background: #d31334;
  color: #fff;
  font-family: Calibre, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 48px;
  letter-spacing: 1.6px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bag-payment:hover:not(:disabled) { border-color: #b50e2c; background: #b50e2c; }
.bag-payment:disabled { border-color: #d5d5d5; background: #d5d5d5; color: #686868; cursor: default; }
.bag-payment:focus-visible { outline: 2px solid #111; outline-offset: 4px; }

.bag-saved { margin-top: 64px; }
.bag-saved:empty { display: none; }
.bag-saved > h2 { margin: 0 0 20px; font-size: 25px; line-height: 30px; }

.bag-saved-empty {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid #dedede;
  text-align: center;
}

.bag-saved-empty svg { display: block; width: 30px; height: 38px; margin: 0 auto 16px; }
.bag-saved-empty h2 { margin: 0 0 12px; font-size: 28px; font-weight: 600; line-height: 33px; }
.bag-saved-empty p { margin: 0; font-size: 18px; line-height: 24px; }

.bag-empty {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.bag-empty > svg { width: 32px; height: 38px; margin: 0 0 16px; }
.bag-empty h2 { margin: 0 0 12px; font-size: 28px; font-weight: 600; line-height: 34px; }
.bag-empty p { max-width: 620px; margin: 0 0 24px; font-size: 18px; line-height: 24px; }
.bag-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.bag-empty .btn,
.bag-empty button[data-category] {
  display: inline-flex;
  min-width: 170px;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
}
.bag-empty .btn:hover,
.bag-empty button[data-category]:hover { background: #292929; }
#bag-view #cart-continue,
#bag-view .bag-continue {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin: 18px auto 0;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #222;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: #9a9a9a;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-transform: none;
  cursor: pointer;
}
#bag-view #cart-continue:hover,
#bag-view .bag-continue:hover { color: #000; text-decoration-color: #000; }
#bag-view #cart-continue:focus-visible,
#bag-view .bag-continue:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.bag-mobile-checkout { display: none; }

#payment-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 36px 28px 28px;
  overflow: auto;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

#payment-dialog::backdrop { background: #0007; }
#payment-dialog .payment-copy { padding-top: 6px; }
#payment-dialog h2 { margin: 0 0 16px; font-size: 28px; font-weight: 600; line-height: 34px; }
#payment-dialog p { margin: 0 0 16px; color: #555; font-size: 18px; line-height: 24px; }
#payment-dialog .payment-amount {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  color: #111;
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
}
#payment-dialog button.payment-back,
#payment-dialog .payment-back button {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border: 1px solid #222;
  border-radius: 4px;
  background: #222;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 1px;
}

@media (min-width: 1000px) and (min-height: 760px) {
  .bag-summary { position: sticky; top: 104px; }
}

@media (min-width: 768px) and (max-width: 1050px) {
  #bag-view { padding-right: 16px; padding-left: 16px; }
  .bag-layout { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; }
  #bag-view .cart-item.bag-item { grid-template-columns: minmax(100px, 27%) minmax(0, 1fr); gap: 16px; padding: 20px 16px; }
  .bag-quantity-price { flex-wrap: wrap; }
  .bag-item-actions { justify-content: flex-start; gap: 10px 16px; }
}

@media (max-width: 767px) {
  body:has(#bag-view:not([hidden])) { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  body:has(#bag-view:not([hidden])) .toast { bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 80; }
  #bag-view { min-height: calc(100dvh - 157px); padding: 20px 10px 40px; }
  #bag-view #cart-title { margin-bottom: 20px; font-size: 26px; line-height: 32px; }
  .bag-layout { display: block; }
  #bag-view .cart-item.bag-item { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px 12px; }
  #bag-view .bag-item-copy h2 { margin-right: 24px; margin-bottom: 10px; font-size: 18px; line-height: 22px; }
  #bag-view .bag-remove { top: -7px; right: -5px; width: 30px; height: 32px; font-size: 25px; }
  #bag-view .cart-item p.bag-color,
  #bag-view .cart-item p.bag-size { font-size: 15px; line-height: 20px; }
  .bag-quantity-price { flex-wrap: wrap; gap: 10px 12px; margin-top: 12px; }
  .bag-line-price { font-size: 17px; line-height: 22px; }
  .bag-line-price .sale-was { font-size: 13px; }
  .bag-line-price .sale-now { font-size: 17px; }
  .bag-item-actions { justify-content: flex-start; gap: 10px 16px; margin-top: 0; padding-top: 16px; }
  #bag-view .bag-item-actions button,
  #bag-view .bag-item-actions a { font-size: 14px; line-height: 18px; }
  .bag-summary { position: static; margin-top: 28px; }
  .bag-summary .bag-promo { margin-bottom: 12px; }
  .bag-summary #cart-payment { display: none; }
  #bag-view #cart-continue,
  #bag-view .bag-continue { font-size: 15px; }
  .bag-saved { margin-top: 40px; }
  .bag-saved-empty { padding: 32px 8px; }
  .bag-saved-empty h2 { font-size: 24px; line-height: 29px; }
  .bag-saved-empty p { font-size: 17px; line-height: 22px; }
  .bag-empty { min-height: 300px; padding: 32px 8px; }
  .bag-empty h2 { font-size: 26px; line-height: 31px; }
  .bag-empty p { font-size: 17px; line-height: 22px; }
  .bag-empty .btn,
  .bag-empty button[data-category] { min-width: 132px; }
  .bag-mobile-checkout {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(144px, .95fr);
    align-items: center;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 -2px 8px #00000009;
  }
  .bag-mobile-total { display: flex; min-width: 0; flex-direction: column; gap: 2px; font-size: 14px; line-height: 18px; }
  .bag-mobile-total strong { font-size: 20px; font-weight: 600; line-height: 24px; }
  .bag-mobile-checkout .bag-payment { min-height: 50px; padding: 0 10px; font-size: 14px; line-height: 48px; letter-spacing: 1.4px; }
  #payment-dialog { padding: 32px 22px 24px; }
  #payment-dialog .payment-amount { font-size: 20px; line-height: 26px; }
}

@media (max-width: 359px) {
  #bag-view .cart-item.bag-item { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 14px 8px; }
  #bag-view .bag-item-copy h2 { font-size: 17px; line-height: 21px; }
  #bag-view .qty button,
  #bag-view .qty span,
  #bag-view .qty input { width: 29px; min-width: 29px; }
  .bag-line-price,
  .bag-line-price .sale-now { font-size: 16px; }
  .bag-mobile-checkout { grid-template-columns: minmax(0, 1fr) 140px; padding-right: 12px; padding-left: 12px; }
  .bag-mobile-total strong { font-size: 18px; }
}
