/* ===================================================================
   Stellar Cart Section CSS
   Matches Gandharva Cart UI Design & Full-Width WooCommerce Compatibility
   =================================================================== */

/* ---------- FULL-WIDTH PAGE CONTAINER RESETS (ASTRA & THEME OVERRIDES) ---------- */
body.woocommerce-cart,
body:has(.stellar-cart-wrap) {
  background-color: #F8F3EA !important;
  background: #F8F3EA !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.woocommerce-cart #page,
body.woocommerce-cart #content,
body.woocommerce-cart .site-content,
body.woocommerce-cart .ast-container,
body.woocommerce-cart #primary,
body.woocommerce-cart #main,
body.woocommerce-cart .entry-content,
body.woocommerce-cart .woocommerce,
body.woocommerce-cart .ast-article-post,
body.woocommerce-cart .ast-article-single {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ensure Header & Footer stretch 100% edge-to-edge without boxed restrictions */
body.woocommerce-cart #masthead,
body.woocommerce-cart .site-header,
body.woocommerce-cart .ast-main-header-wrap,
body.woocommerce-cart .stellar-header-wrap,
body.woocommerce-cart #colophon,
body.woocommerce-cart .site-footer,
body.woocommerce-cart .stellar-footer-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ---------- CART WRAPPER ---------- */
.stellar-cart-wrap {
  --ink: #1E2822;
  --text: #1E2822;
  --muted: #5B6C5F;
  --line: #E5DCCB;
  --surface: #FFFFFF;
  --plate: #F3E8D3;
  --bg-input: #F6EFE3;
  --forest: #22382C;
  --forest-hover: #17271E;
  --onforest: #F5EEDB;
  --danger: #A2432F;
  --ok: #2D4536;

  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3.5vw, 64px);
  box-sizing: border-box;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1E2822;
  background: transparent;
}

/* ---------- PAGE TITLE & OPTIONAL BREADCRUMBS ---------- */
.stellar-cart-wrap .page-title {
  padding: 36px 0 24px;
}

.stellar-cart-wrap .crumbs {
  font-size: 13.5px;
  color: #5B6C5F;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stellar-cart-wrap .crumbs a {
  color: #5B6C5F;
  text-decoration: none;
  transition: color 0.15s ease;
}

.stellar-cart-wrap .crumbs a:hover {
  color: #22382C;
  text-decoration: underline;
}

.stellar-cart-wrap .page-title h1 {
  font-family: "Marcellus", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(32px, 3.8vw, 44px);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
  color: #1E2822;
}

/* ---------- CART GRID LAYOUT ---------- */
.stellar-cart-wrap .cart {
  display: grid;
  grid-template-columns: 1fr clamp(320px, 30vw, 400px);
  gap: clamp(28px, 4vw, 60px);
  padding: 0 0 60px;
  align-items: start;
}

/* ---------- LEFT COLUMN: LINE ITEMS ---------- */
.stellar-cart-wrap .cart-items {
  display: flex;
  flex-direction: column;
}

.stellar-cart-wrap .line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid #E5DCCB;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.stellar-cart-wrap .line.removing {
  opacity: 0;
  transform: translateX(-16px);
  pointer-events: none;
}

/* Thumbnail Plate */
.stellar-cart-wrap .line .plate {
  border-radius: 12px;
  position: relative;
  aspect-ratio: 1;
  background-color: #F3E8D3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.stellar-cart-wrap .line .plate svg.art {
  width: 68%;
  height: 68%;
}

.stellar-cart-wrap .line .plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
  padding: 4px !important;
  box-sizing: border-box !important;
}

/* Item info (Title, Price, Qty, Remove) */
.stellar-cart-wrap .line .item-info {
  display: flex;
  flex-direction: column;
}

.stellar-cart-wrap .line h3 {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.35;
  color: #1E2822;
}

.stellar-cart-wrap .line h3 a {
  color: #1E2822;
  text-decoration: none;
  transition: color 0.15s ease;
}

.stellar-cart-wrap .line h3 a:hover {
  color: #22382C;
}

.stellar-cart-wrap .line .price {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stellar-cart-wrap .line .price b {
  font-size: 15px;
  font-weight: 700;
  color: #1E2822;
}

.stellar-cart-wrap .line .price s {
  color: #69786C;
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: line-through;
}

.stellar-cart-wrap .line .actions-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Quantity Pill */
.stellar-cart-wrap .line .qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #D6CAB6;
  border-radius: 999px;
  background-color: #FFFFFF;
  background: #FFFFFF;
  overflow: hidden;
  height: 32px;
  padding: 0 6px;
  box-shadow: none;
  box-sizing: border-box;
}

.stellar-cart-wrap .line .qty button {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  background-color: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #1E2822;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.stellar-cart-wrap .line .qty button:hover {
  background-color: rgba(91, 114, 98, 0.1);
  color: #22382C;
}

.stellar-cart-wrap .line .qty input {
  width: 28px;
  border: 0;
  background: transparent;
  background-color: transparent;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #1E2822;
  padding: 0;
  margin: 0;
  outline: none;
  box-shadow: none;
  -moz-appearance: textfield;
}

.stellar-cart-wrap .line .qty input::-webkit-outer-spin-button,
.stellar-cart-wrap .line .qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove button */
.stellar-cart-wrap .line .rm {
  background: transparent;
  border: 0;
  color: #5B6C5F;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s ease;
}

.stellar-cart-wrap .line .rm:hover {
  color: #A2432F;
}

/* Line Total (Right aligned) */
.stellar-cart-wrap .line .line-total {
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  text-align: right;
  align-self: center;
  padding-top: 0;
  color: #1E2822;
}

/* Continue Shopping Link */
.stellar-cart-wrap .continue-shopping-link {
  display: inline-block;
  margin-top: 28px;
  color: #5B6C5F;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.stellar-cart-wrap .continue-shopping-link:hover {
  color: #22382C;
}

/* ---------- RIGHT COLUMN: ORDER SUMMARY CARD ---------- */
.stellar-cart-wrap .summary {
  background-color: #FFFFFF;
  background: #FFFFFF;
  border: 1px solid #EBE2D3;
  border-radius: 20px;
  padding: 28px 26px;
  position: sticky;
  top: 100px;
  box-shadow: 0 4px 20px rgba(35, 48, 42, 0.02);
  color: #1E2822;
  box-sizing: border-box;
}

.stellar-cart-wrap .summary h2 {
  font-family: "Marcellus", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 20px;
  color: #1E2822;
  line-height: 1.2;
}

.stellar-cart-wrap .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14.5px;
  color: #5B6C5F;
}

.stellar-cart-wrap .row span:last-child {
  color: #1E2822;
  font-weight: 500;
}

.stellar-cart-wrap .row.discount span:last-child {
  color: #2D4536;
  font-weight: 500;
}

.stellar-cart-wrap .row.total {
  border-top: 0;
  margin-top: 14px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #1E2822;
}

.stellar-cart-wrap .row.total span:first-child {
  font-weight: 700;
  font-size: 16px;
  color: #1E2822;
}

.stellar-cart-wrap .row.total span:last-child {
  font-size: 18px;
  color: #1E2822;
  font-weight: 700;
}

/* Coupon Box Section */
.stellar-cart-wrap .coupon-box-wrapper {
  margin: 22px 0 18px;
}

.stellar-cart-wrap .coupon {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.stellar-cart-wrap .coupon input {
  flex: 1;
  width: 100%;
  height: 42px;
  border: 1px solid #EBE0CD;
  background-color: #F6EFE3;
  background: #F6EFE3;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1E2822;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.stellar-cart-wrap .coupon input::placeholder {
  color: #5B6C5F;
  opacity: 0.8;
}

.stellar-cart-wrap .coupon input:focus {
  border-color: #5B7262;
  box-shadow: 0 0 0 2px rgba(91, 114, 98, 0.12);
}

.stellar-cart-wrap .coupon input.applied {
  background-color: #F6EFE3;
  color: #1E2822;
}

.stellar-cart-wrap .coupon button {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #D6CAB6;
  background-color: #FFFFFF;
  color: #1E2822;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.stellar-cart-wrap .coupon button:hover {
  border-color: #5B7262;
  background-color: #F3E8D3;
}

.stellar-cart-wrap .coupon-applied-msg,
.stellar-cart-wrap .promo-hint {
  font-size: 12.5px;
  color: #385542;
  margin: 8px 0 12px;
  line-height: 1.4;
}

.stellar-cart-wrap .msg {
  font-size: 13px;
  margin: 6px 0 12px;
  display: none;
}

.stellar-cart-wrap .msg.show {
  display: block;
}

.stellar-cart-wrap .msg.ok {
  color: #2D4536;
}

.stellar-cart-wrap .msg.err {
  color: #A2432F;
}

/* Proceed to Checkout Button */
.stellar-cart-wrap .btn,
.stellar-cart-wrap #checkoutBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: none;
  background-color: #22382C;
  background: #22382C;
  color: #F5EEDB;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
}

.stellar-cart-wrap .btn:hover {
  background-color: #17271E;
  color: #F5EEDB;
}

/* ---------- EMPTY CART STATE ---------- */
.stellar-cart-wrap .cart-empty {
  padding: 70px 24px;
  text-align: center;
  border: 1px dashed #E5DCCB;
  border-radius: 20px;
  background-color: #FFFFFF;
  margin: 20px 0 60px;
}

.stellar-cart-wrap .cart-empty h2 {
  font-family: "Marcellus", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 12px;
  color: #1E2822;
}

.stellar-cart-wrap .cart-empty p {
  color: #5B6C5F;
  margin: 0 0 24px;
  font-size: 15px;
}

.stellar-cart-wrap .cart-empty .btn {
  display: inline-flex;
  width: auto;
  min-width: 200px;
}

/* ---------- TOAST NOTIFICATION ---------- */
.stellar-cart-toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  opacity: 0;
  background-color: #22382C !important;
  color: #F5EEDB !important;
  padding: 12px 22px;
  border-radius: 999px;
  z-index: 999999;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: calc(100% - 32px);
}

.stellar-cart-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* Loading overlay for cart updates */
.stellar-cart-wrap.processing {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ---------- RESPONSIVE DESIGN ---------- */
@media (max-width: 980px) {
  .stellar-cart-wrap .cart {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .stellar-cart-wrap .summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .stellar-cart-wrap {
    padding: 0 16px;
  }
  .stellar-cart-wrap .line {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }
  .stellar-cart-wrap .line .plate {
    width: 72px;
    height: 72px;
  }
  .stellar-cart-wrap .line .line-total {
    grid-column: 2;
    text-align: left;
    padding-top: 4px;
  }
  .stellar-cart-wrap .summary {
    padding: 22px 18px;
  }
}

/* Item Variations Meta */
.stellar-cart-wrap .item-variations-meta,
.item-variations-meta {
  font-size: 13px;
  color: #5B6C5F;
  margin: 4px 0 6px;
  line-height: 1.4;
}

.stellar-cart-wrap .item-variations-meta dl.variation,
.item-variations-meta dl.variation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  padding: 0;
}

.stellar-cart-wrap .item-variations-meta dt.variation-label,
.item-variations-meta dt.variation-label {
  font-weight: 500;
  color: #5B6C5F;
  margin: 0;
  display: inline;
}

.stellar-cart-wrap .item-variations-meta dd.variation-value,
.item-variations-meta dd.variation-value {
  margin: 0;
  display: inline;
  font-weight: 600;
  color: #1E2822;
}

.stellar-cart-wrap .item-variations-meta dd p,
.item-variations-meta dd p {
  margin: 0;
  display: inline;
}

