/* =============================================================
   PO CART — stage.pureorganics.ro/cos/
   PureOrganics WooCommerce Blocks cart redesign
   ============================================================= */

/* ─── Design Tokens ─────────────────────────────────────────── */
body.woocommerce-cart {
  --cos-bg:       oklch(99.5% 0 0);
  --cos-surf:     oklch(96.5% 0.010 162);
  --cos-text:     oklch(22% 0.015 162);
  --cos-text2:    oklch(42% 0.020 162);
  --cos-muted:    oklch(58% 0.018 162);
  --cos-green:    oklch(48% 0.12 162);
  --cos-green-dk: oklch(40% 0.12 162);
  --cos-rule:     oklch(87% 0.020 162);
  --fh: 'Manrope', system-ui, sans-serif;
  --fb: 'Figtree', system-ui, sans-serif;
}

/* ─── 1. Page Hero — hide entirely, title injected via JS ─── */
body.woocommerce-cart .entry-hero {
  display: none !important;
}

/* Cart page heading injected by po-cart.js */
.po-cart-heading {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 800;
  color: oklch(22% 0.015 162);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 28px;
  padding-top: 28px;
}

/* ─── 2. Content area spacing ─────────────────────────────── */
body.woocommerce-cart #primary {
  padding-top: 0 !important;
}
body.woocommerce-cart .content-container {
  padding-top: 0 !important;
}
body.woocommerce-cart .po-breadcrumbs-wrap {
  margin-bottom: 0;
}

/* ─── 3. Cart Block Container ─────────────────────────────── */
body.woocommerce-cart .wp-block-woocommerce-cart {
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── 4. Two-column layout: items 1fr | sidebar 360px ─────── */
body.woocommerce-cart .wc-block-components-sidebar-layout.wc-block-cart {
  display: grid !important;
  grid-template-columns: 1fr 360px !important;
  gap: 48px !important;
  align-items: start !important;
}
/* WC cart.css sets width:65%/35% on children — override to fill grid cell */
body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main {
  width: 100% !important;
}
body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  width: 100% !important;
}

/* ─── 5. Cart Items Table ──────────────────────────────────── */
body.woocommerce-cart .wc-block-cart-items {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

/* Column header row */
body.woocommerce-cart .wc-block-cart-items__header tr {
  border-bottom: 1px solid var(--cos-rule) !important;
}
body.woocommerce-cart .wc-block-cart-items__header th {
  font-family: var(--fh) !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.13em !important;
  text-transform: uppercase !important;
  color: var(--cos-muted) !important;
  padding: 0 0 12px !important;
  background: none !important;
}
body.woocommerce-cart .wc-block-cart-items__header-image {
  width: 96px !important;
}
body.woocommerce-cart .wc-block-cart-items__header-total {
  text-align: right !important;
}

/* Product row cells */
body.woocommerce-cart .wc-block-cart-items__row td {
  padding: 24px 0 !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--cos-rule) !important;
  background: none !important;
}

/* ─── 6. Product Image ─────────────────────────────────────── */
body.woocommerce-cart .wc-block-cart-item__image {
  width: 96px !important;
}
body.woocommerce-cart .wc-block-cart-item__image a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 80px !important;
  height: 80px !important;
  border-radius: 10px !important;
  background: var(--cos-surf) !important;
  overflow: hidden !important;
  text-decoration: none !important;
}
body.woocommerce-cart .wc-block-cart-item__image img {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain !important;
  display: block !important;
  padding: 0 !important;
}

/* ─── 7. Product Details ───────────────────────────────────── */
body.woocommerce-cart .wc-block-cart-item__product {
  padding-left: 16px !important;
  padding-right: 20px !important;
}
body.woocommerce-cart .wc-block-cart-item__wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}
body.woocommerce-cart .wc-block-components-product-name {
  font-family: var(--fh) !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: var(--cos-text) !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  transition: color 0.15s ease !important;
}
body.woocommerce-cart .wc-block-components-product-name:hover {
  color: var(--cos-green) !important;
}
body.woocommerce-cart .wc-block-cart-item__prices {
  margin: 0 !important;
}
body.woocommerce-cart .wc-block-cart-item__prices .price,
body.woocommerce-cart .wc-block-cart-item__prices .wc-block-components-product-price {
  font-family: var(--fb) !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  color: var(--cos-muted) !important;
}

/* ─── 8. Quantity Controls ─────────────────────────────────── */
body.woocommerce-cart .wc-block-cart-item__quantity {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 10px !important;
}

/* Pill stepper */
body.woocommerce-cart .wc-block-components-quantity-selector {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--cos-surf) !important;
  border: 1px solid var(--cos-rule) !important;
  border-radius: 999px !important;
  padding: 3px !important;
  gap: 0 !important;
  width: auto !important;
  box-shadow: none !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__button {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  background: var(--cos-bg) !important;
  border: 1px solid var(--cos-rule) !important;
  color: var(--cos-text) !important;
  font-family: var(--fh) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
  padding: 0 !important;
  line-height: 1 !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__button:hover:not(:disabled) {
  background: var(--cos-green) !important;
  border-color: var(--cos-green) !important;
  color: white !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__button:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__input {
  width: 36px !important;
  text-align: center !important;
  font-family: var(--fh) !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: var(--cos-text) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 4px !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
body.woocommerce-cart .wc-block-components-quantity-selector__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Remove button */
body.woocommerce-cart .wc-block-cart-item__remove-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  color: var(--cos-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}
body.woocommerce-cart .wc-block-cart-item__remove-link:hover {
  color: oklch(42% 0.18 27) !important;
  background: oklch(96% 0.02 27) !important;
  border-color: oklch(88% 0.04 27) !important;
}
body.woocommerce-cart .wc-block-cart-item__remove-link svg {
  width: 16px !important;
  height: 16px !important;
}

/* ─── 9. Line Total Column ─────────────────────────────────── */
body.woocommerce-cart .wc-block-cart-item__total {
  text-align: right !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}
body.woocommerce-cart .wc-block-cart-item__total .price,
body.woocommerce-cart .wc-block-cart-item__total .wc-block-components-product-price,
body.woocommerce-cart .wc-block-cart-item__total .wc-block-formatted-money-amount {
  font-family: var(--fh) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--cos-text) !important;
}
body.woocommerce-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper {
  justify-content: flex-end !important;
}

/* ─── 10. Order Summary Sidebar ────────────────────────────── */
body.woocommerce-cart .wc-block-components-sidebar {
  position: sticky !important;
  top: 24px !important;
}
body.woocommerce-cart .wp-block-woocommerce-cart-order-summary-block {
  background: var(--cos-surf) !important;
  border-radius: 12px !important;
  padding: 28px !important;
  border: 1px solid var(--cos-rule) !important;
}
body.woocommerce-cart .wc-block-cart__totals-title {
  font-family: var(--fh) !important;
  font-size: 1.125rem !important;
  font-weight: 800 !important;
  color: var(--cos-text) !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  margin: 0 0 20px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--cos-rule) !important;
}

/* ─── 11. Coupon Panel ──────────────────────────────────────── */
body.woocommerce-cart .wc-block-components-totals-wrapper {
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--cos-rule) !important;
}
body.woocommerce-cart .wc-block-components-panel__button {
  font-family: var(--fh) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: var(--cos-green) !important;
  background: none !important;
  border: none !important;
  padding: 4px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  width: auto !important;
}
body.woocommerce-cart .wc-block-components-panel__button svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--cos-green) !important;
}

/* ─── 12. Totals Rows ───────────────────────────────────────── */
body.woocommerce-cart .wc-block-components-totals-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 4px 0 !important;
}
body.woocommerce-cart .wc-block-components-totals-item__label {
  font-family: var(--fb) !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: var(--cos-text2) !important;
}
body.woocommerce-cart .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-wrapper .wc-block-formatted-money-amount {
  font-family: var(--fh) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--cos-text) !important;
}

/* ─── 13. Grand Total Footer ───────────────────────────────── */
body.woocommerce-cart .wc-block-components-totals-footer-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 0 4px !important;
  border-top: 1px solid var(--cos-rule) !important;
  margin-top: 4px !important;
  border-bottom: none !important;
}
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
  font-family: var(--fh) !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  color: var(--cos-text) !important;
}
body.woocommerce-cart .wc-block-components-totals-footer-item-tax-value {
  font-family: var(--fh) !important;
  font-size: 1.375rem !important;
  font-weight: 800 !important;
  color: var(--cos-green) !important;
  letter-spacing: -0.02em !important;
}

/* ─── 14. Trust Badges (injected via JS) ───────────────────── */
.po-cart-trust {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 0;
  margin-bottom: 0;
}
.po-cart-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.po-cart-trust-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--cos-green, oklch(48% 0.12 162));
}
.po-cart-trust-label {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(42% 0.020 162);
  line-height: 1.4;
}

/* ─── 15. CTA Button ────────────────────────────────────────── */
body.woocommerce-cart .wc-block-cart__submit {
  margin-top: 16px !important;
}
body.woocommerce-cart .wc-block-cart__submit-container {
  padding: 0 !important;
}
body.woocommerce-cart .wc-block-cart__submit-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 52px !important;
  background: var(--cos-green) !important;
  color: white !important;
  font-family: var(--fh) !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  border-radius: 10px !important;
  border: none !important;
  text-decoration: none !important;
  box-shadow: 0 2px 12px oklch(48% 0.12 162 / 0.28) !important;
  padding: 0 24px !important;
  transition: background 0.2s ease, box-shadow 0.2s ease !important;
}
body.woocommerce-cart .wc-block-cart__submit-button:hover {
  background: var(--cos-green-dk) !important;
  box-shadow: 0 4px 20px oklch(48% 0.12 162 / 0.38) !important;
  color: white !important;
}
body.woocommerce-cart .wc-block-components-button__text {
  font-family: var(--fh) !important;
  font-weight: 700 !important;
}

/* ─── 16. Empty Cart State ──────────────────────────────────── */
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
  padding: 40px 0 !important;
}
.po-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
.po-empty-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  color: oklch(82% 0.025 162);
}
.po-empty-title {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  color: oklch(22% 0.015 162);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 8px;
}
.po-empty-sub {
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: oklch(42% 0.020 162);
  line-height: 1.65;
  margin: 0 0 28px;
  max-width: 340px;
}
.po-empty-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: oklch(48% 0.12 162) !important;
  color: white !important;
  font-family: 'Manrope', system-ui, sans-serif !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  padding: 0 28px !important;
  height: 48px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: background 0.2s ease !important;
  box-shadow: 0 2px 10px oklch(48% 0.12 162 / 0.25) !important;
}
.po-empty-cta:hover {
  background: oklch(40% 0.12 162) !important;
  color: white !important;
}

/* Hide default WC empty cart text (the emoji + "Coșul tău este gol acum!") */
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block > p:first-child,
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wc-block-cart-empty-title {
  display: none !important;
}

/* ─── 17. "Noutăți în magazin" heading (empty state) ───────── */
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block h2,
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block h2.wp-block-heading {
  font-family: 'Manrope', system-ui, sans-serif !important;
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: oklch(22% 0.015 162) !important;
  margin-bottom: 24px !important;
  letter-spacing: -0.01em !important;
}

/* ─── 18. Misc / Polish ─────────────────────────────────────── */
body.woocommerce-cart .wc-block-components-notices {
  margin-bottom: 16px;
}
body.woocommerce-cart .wc-block-components-text-input input {
  font-family: var(--fb) !important;
  border-radius: 8px !important;
  border-color: var(--cos-rule) !important;
  height: 44px !important;
  font-size: 0.875rem !important;
  color: var(--cos-text) !important;
}
body.woocommerce-cart .wc-block-components-button.outlined {
  font-family: var(--fh) !important;
  font-weight: 600 !important;
  border-color: var(--cos-green) !important;
  color: var(--cos-green) !important;
  border-radius: 8px !important;
  height: 44px !important;
  font-size: 0.875rem !important;
}
body.woocommerce-cart .wc-block-cart__payment-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--cos-rule);
}

/* ─── 19. Free Shipping Bar (injected above cart items) ─────── */
.po-freeship-bar {
  background: var(--cos-surf, oklch(96.5% 0.010 162));
  border: 1px solid var(--cos-rule, oklch(87% 0.020 162));
  border-radius: 10px;
  padding: 12px 16px 14px;
  margin-bottom: 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.po-freeship-bar.is-free {
  background: oklch(95% 0.022 162);
  border-color: oklch(76% 0.05 162);
}
.po-freeship-text {
  font-family: var(--fh, 'Manrope', system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cos-text2, oklch(42% 0.020 162));
  margin-bottom: 9px;
  line-height: 1.4;
}
.po-freeship-bar.is-free .po-freeship-text {
  color: var(--cos-green, oklch(48% 0.12 162));
}
.po-freeship-text strong {
  color: var(--cos-green, oklch(48% 0.12 162));
}
.po-freeship-track {
  height: 5px;
  border-radius: 99px;
  background: var(--cos-rule, oklch(87% 0.020 162));
  overflow: hidden;
}
.po-freeship-fill {
  height: 100%;
  background: var(--cos-green, oklch(48% 0.12 162));
  border-radius: 99px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}

/* ─── 20. Mobile ────────────────────────────────────────────── */
@media (max-width: 800px) {
  body.woocommerce-cart .wc-block-components-sidebar-layout.wc-block-cart {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  body.woocommerce-cart .wc-block-components-sidebar {
    position: static !important;
    top: 0 !important;
  }
  body.woocommerce-cart .wp-block-woocommerce-cart-order-summary-block {
    border-radius: 8px !important;
    padding: 20px !important;
  }
  /* On mobile: hide separate total column, price already shown in row */
  body.woocommerce-cart .wc-block-cart-items__header-total {
    display: none !important;
  }
  body.woocommerce-cart .wc-block-cart-item__total {
    display: none !important;
  }
  /* Promote unit price to primary on mobile */
  body.woocommerce-cart .wc-block-cart-item__prices .price,
  body.woocommerce-cart .wc-block-cart-item__prices .wc-block-components-product-price {
    font-family: var(--fh) !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    color: oklch(22% 0.015 162) !important;
  }
  body.woocommerce-cart .wc-block-cart-item__image a {
    width: 68px !important;
    height: 68px !important;
  }
  body.woocommerce-cart .wc-block-cart-item__image img {
    width: 60px !important;
    height: 60px !important;
  }
  body.woocommerce-cart .wc-block-components-product-name {
    font-size: 0.875rem !important;
  }
  body.woocommerce-cart .entry-title {
    font-size: 1.5rem !important;
  }
}
@media (max-width: 480px) {
  body.woocommerce-cart .entry-hero-container-inner {
    padding-top: 20px !important;
  }
}
@media (max-width: 800px) {
  .po-freeship-bar {
    border-radius: 8px;
    padding: 10px 14px 12px;
  }
}
