/* Cart page — studio layout matching all-categories / customize */

:root {
  --cart-teal: #04cda3;
  --cart-teal-dim: #0d9488;
  --cart-ink: #182631;
  --cart-muted: #5a6f7a;
  --cart-line: rgba(4, 205, 163, 0.12);
}

body.cart-page {
  background: #f4f8f9;
  font-family: 'Cairo', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

body.cart-page main {
  width: 100% !important;
  max-width: 100% !important;
  min-height: calc(100vh - 72px);
  height: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 34vw, 460px) !important;
  gap: 0 !important;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(4, 205, 163, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(4, 205, 163, 0.035) 1px, transparent 1px),
    #f4f8f9;
  background-size: 28px 28px;
}

.cart-page__main {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 1.25rem clamp(1rem, 2vw, 1.75rem) 2.5rem;
}

.cart-page__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cart-page__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--cart-teal-dim);
  letter-spacing: -0.02em;
}

.cart-page__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--cart-muted);
}

.shopping-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 !important;
  max-width: 100%;
  background: transparent;
}

.cart-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--cart-line);
  box-shadow: 0 14px 34px rgba(24, 38, 49, 0.06);
  animation: cartItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes cartItemIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-item__media {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #eef2f4, #dfe8eb);
  border: 1px solid rgba(4, 205, 163, 0.12);
}

.cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.cart-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-item__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--cart-ink);
  overflow-wrap: anywhere;
}

.cart-item__remove {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cart-item__remove:hover {
  background: rgba(239, 68, 68, 0.18);
  transform: scale(1.05);
}

.cart-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cart-item__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(4, 205, 163, 0.1);
  color: var(--cart-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.cart-item__chip span {
  color: var(--cart-muted);
  font-weight: 600;
}

.cart-item__size-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cart-item__size-breakdown label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(24, 38, 49, 0.06);
  color: var(--cart-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.cart-item__size-breakdown input {
  width: 3.8rem;
  border: 1px solid rgba(24, 38, 49, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--cart-ink);
  font-weight: 900;
  text-align: center;
  outline: none;
}

.cart-item__delivery {
  font-size: 0.8rem;
  color: var(--cart-muted);
}

.cart-item__delivery strong {
  color: var(--cart-ink);
}

.cart-item__pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(24, 38, 49, 0.08);
}

.cart-item__stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cart-item__stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cart-muted);
}

.cart-item__stat-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--cart-ink);
}

.cart-item__stat-value--total {
  color: var(--cart-teal-dim);
}

.cart-item__qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(4, 205, 163, 0.08);
  border: 1px solid rgba(4, 205, 163, 0.18);
}

.cart-item__qty-btn {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: var(--cart-teal-dim);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(24, 38, 49, 0.08);
}

.cart-item__qty-input {
  width: 4.5rem;
  border: none;
  background: transparent;
  color: var(--cart-ink);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.cart-item__qty-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--cart-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.cart-continue-shopping {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: fit-content;
  margin: 0.25rem auto 0;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  background: var(--cart-ink);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(24, 38, 49, 0.16);
}

.cart-continue-shopping:hover {
  background: var(--cart-teal-dim);
  color: #ffffff;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
  min-height: 420px;
  padding: 2.5rem 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(4, 205, 163, 0.35);
}

.cart-empty__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(4, 205, 163, 0.12);
  color: var(--cart-teal-dim);
  font-size: 1.8rem;
}

.cart-empty h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--cart-ink);
}

.cart-empty p {
  margin: 0;
  max-width: 28rem;
  color: var(--cart-muted);
  line-height: 1.5;
}

.cart-empty__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--cart-teal);
  color: var(--cart-ink);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-empty__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(4, 205, 163, 0.35);
}

.order-summary {
  position: sticky;
  top: 0;
  align-self: start;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: calc(100vh - 72px);
  max-height: calc(100vh - 72px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.5rem clamp(1rem, 2vw, 1.5rem) 2rem;
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid var(--cart-line);
  box-shadow: -8px 0 30px rgba(24, 38, 49, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.cart-page .order-summary {
  scrollbar-gutter: stable;
}

body.cart-page .cart-sidebar__summary {
  padding: 1.15rem;
  margin-bottom: 1.15rem;
  border: 1px solid rgba(4, 205, 163, 0.16);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 38, 49, 0.06);
}

.cart-sidebar__block {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(24, 38, 49, 0.08);
}

.cart-sidebar__block:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.cart-sidebar__checkout {
  padding-top: 0.15rem;
}

.cart-sidebar__terms h2 {
  font-size: 0.95rem;
}

.cart-sidebar__terms ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--cart-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cart-sidebar__terms li + li {
  margin-top: 0.45rem;
}

.order-summary h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cart-ink);
}

.order-summary .price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.45rem 0;
  font-size: 0.9rem;
  color: var(--cart-muted);
}

.order-summary .price span:last-child {
  font-weight: 700;
  color: var(--cart-ink);
}

.order-summary hr {
  border: none;
  border-top: 1px solid rgba(24, 38, 49, 0.08);
  margin: 0.85rem 0;
}

.order-summary .price:last-of-type span:last-child {
  color: var(--cart-teal-dim);
  font-size: 1.05rem;
  font-weight: 800;
}

.pay-now,
.cartCheckout {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

body.cart-page .order-summary .pay-now,
body.cart-page .order-summary button.pay-now,
body.cart-page .order-summary .cartCheckout,
body.cart-page .order-summary button.cartCheckout {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  transform: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

.pay-now {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 0;
  background: linear-gradient(135deg, var(--cart-teal), var(--cart-teal-dim));
  color: var(--cart-ink);
  min-height: 3.25rem;
  box-shadow: 0 14px 28px rgba(4, 205, 163, 0.18);
}

.pay-now:hover:not(:disabled) {
  transform: none !important;
  box-shadow: 0 12px 28px rgba(4, 205, 163, 0.35);
}

.proforma-invoice {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0.65rem 0 0;
  border: 1px solid rgba(24, 38, 49, 0.16);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: #ffffff;
  color: var(--cart-ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.proforma-invoice:hover {
  background: #f4fffc;
  border-color: rgba(4, 205, 163, 0.48);
  box-shadow: 0 12px 28px rgba(24, 38, 49, 0.08);
}

.proforma-invoice--email {
  margin-top: 0.5rem;
  background: #f5fffc;
  border-color: rgba(4, 205, 163, 0.28);
  color: #007d70;
}

.proforma-invoice--email:hover:not(:disabled) {
  background: #e3fbf7;
  color: #142331;
}

.proforma-invoice:disabled {
  cursor: wait;
  opacity: 0.72;
}

.cartCheckout {
  margin-top: 0.5rem;
  background: var(--cart-ink);
  color: #fff;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartCheckout:hover {
  transform: none !important;
  box-shadow: 0 12px 28px rgba(24, 38, 49, 0.25);
}

.order-summary .choices {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.order-summary .checkboxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(24, 38, 49, 0.1);
  border-radius: 14px;
  background: #f8fbfa;
  font-size: 0.88rem;
}

#checkoutForm {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

body.cart-page .order-summary form,
body.cart-page #checkoutForm {
  width: 100%;
  max-width: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

#checkoutForm label,
body.cart-page .order-summary label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cart-muted);
  width: 100%;
}

#checkoutForm input,
body.cart-page .order-summary input,
body.cart-page .order-summary select {
  width: 100% !important;
  box-sizing: border-box;
  border: 1px solid rgba(24, 38, 49, 0.14);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fafbfc;
  margin-bottom: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#checkoutForm input:focus,
body.cart-page .order-summary input:focus {
  outline: none;
  border-color: rgba(4, 205, 163, 0.55);
  box-shadow: 0 0 0 3px rgba(4, 205, 163, 0.15);
  background: #fff;
}

#shippingDetails {
  margin-top: 0.5rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(4, 205, 163, 0.06);
  border: 1px solid rgba(4, 205, 163, 0.18);
}

.whatsapp-contact,
body.cart-page .cart-sidebar__help.whatsapp-contact {
  position: static;
  top: auto;
  right: auto;
  width: 100%;
  max-width: none;
  margin-top: auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 14px;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.25);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cart-ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

body.cart-page .cart-sidebar__help.whatsapp-contact:hover {
  background: rgba(37, 211, 102, 0.16);
  transform: translateY(-1px);
}

body.cart-page .whatsapp-icon {
  font-size: 1.35rem;
  color: #25D366;
  flex-shrink: 0;
}

.cart-page--empty-summary .pay-now,
.cart-page--empty-summary .cart-sidebar__checkout,
.cart-page--empty-summary .cart-sidebar__terms,
.cart-page--empty-summary .cart-sidebar__help,
.cart-page--empty-summary .order-summary .price,
.cart-page--empty-summary .order-summary .adress,
.cart-page--empty-summary .order-summary hr {
  display: none !important;
}

body.cart-page .order-summary hr,
body.cart-page aside hr {
  width: 100%;
  margin: 0.85rem 0;
  transform: none;
  border: none;
  border-top: 1px solid rgba(24, 38, 49, 0.08);
}

body.cart-page .order-summary .price {
  width: 100%;
}

.cart-page .popup {
  border-radius: 20px;
  border: 1px solid rgba(4, 205, 163, 0.25);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 1.75rem 1.75rem 2.35rem;
  max-width: 420px;
  min-height: 235px;
  box-sizing: border-box;
}

.cart-page .popup p {
  margin: 0 0 1rem;
  line-height: 1.5;
  color: var(--cart-ink);
}

.cart-page .guest-btn,
.cart-page .register-btn {
  display: block;
  width: min(240px, 100%);
  margin: 0.85rem auto 0;
  border: none;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cart-page .guest-btn {
  background: var(--cart-teal);
  color: var(--cart-ink);
}

.cart-page .register-btn {
  background: var(--cart-ink);
  color: #fff;
}

@media (max-width: 980px) {
  body.cart-page main {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
    min-height: auto;
    max-height: none;
    overflow: visible;
    border-left: none;
    border-top: 1px solid var(--cart-line);
  }

  .cart-item {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .cart-item__media {
    width: 110px;
    height: 110px;
  }

  .cart-item__pricing {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item__media {
    width: 100%;
    height: 180px;
  }
}

/* Neutralize legacy cart-CADEAU.css breakpoints that force 100vw / broken grids */
@media (min-width: 351px) and (max-width: 1264px) {
  body.cart-page main {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 36vw, 460px) !important;
    grid-auto-rows: unset !important;
    gap: 0 !important;
  }

  body.cart-page main > div,
  body.cart-page .cart-page__main {
    max-width: 100% !important;
    width: auto !important;
    overflow: hidden;
  }

  body.cart-page .shopping-items {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

body.cart-page .order-summary .price {
  width: 100%;
  margin-left: 0;
}

body.cart-page .order-summary .choices {
  width: 100%;
  justify-content: stretch;
  gap: 0.65rem;
}
