/* ============================================================
   iTOOL — Cart Page CSS  (prefix: .aitc-)
   ============================================================ */

:root {
  --aitc-bg:            #f5f5f5;
  --aitc-surface:       #ffffff;
  --aitc-ink:           #111111;
  --aitc-muted:         #6b7280;
  --aitc-muted-2:       #9ca3af;
  --aitc-line:          rgba(0,0,0,0.06);
  --aitc-line-dash:     #e5e7eb;
  --aitc-primary:       #1e2a78;
  --aitc-primary-2:     #2a3a8c;
  --aitc-primary-soft:  rgba(30,42,120,0.08);
  --aitc-danger:        #dc2626;
  --aitc-radius:        20px;
  --aitc-radius-sm:     14px;
  --aitc-font:          var(--itoll-font-family);
}

body.woocommerce-cart { background: var(--aitc-bg); }

/* Escape Blocksy container */
body.woocommerce-cart .entry-content,
body.woocommerce-cart .ct-container,
body.woocommerce-cart .ct-container-full,
body.woocommerce-cart .is-layout-constrained > .woocommerce,
body.woocommerce-cart .woocommerce {
  max-width: 100% !important; width: 100% !important;
  padding-left: 0 !important; padding-right: 0 !important;
  margin-left: 0 !important;  margin-right: 0 !important;
}
body.woocommerce-cart .ct-container-full[data-vertical-spacing] {
  padding-top: 0 !important; padding-bottom: 0 !important;
  margin-top: 0 !important;  margin-bottom: 0 !important;
}
body.woocommerce-cart .hero-section,
body.woocommerce-cart .entry-header,
body.woocommerce-cart h1.entry-title,
body.woocommerce-cart .ct-page-title {
  display: none !important; height: 0 !important;
  padding: 0 !important; margin: 0 !important; overflow: hidden !important;
}

/* ── base ── */
.aitc-cart, .aitc-cart * { box-sizing: border-box; }
.aitc-cart {
  font-family: var(--aitc-font);
  color: var(--aitc-ink);
  direction: rtl;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  background: var(--aitc-bg);
  box-shadow: 0 0 0 100vmax var(--aitc-bg);
  clip-path: inset(0 -100vmax);
}
.aitc-cart__left, .aitc-cart__right {
  display: flex; flex-direction: column; gap: 20px; min-width: 0;
}

/* ── card ── */
.aitc-card {
  background: var(--aitc-surface);
  border: 1px solid var(--aitc-line);
  border-radius: var(--aitc-radius);
  box-shadow: 0 2px 12px rgba(16,24,40,.05);
  overflow: hidden;
}

/* ── items header ── */
.aitc-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--aitc-line);
}
.aitc-items-head__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--aitc-ink);
}
.aitc-items-head__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--aitc-muted);
}

/* ── item ── */
.aitc-item {
  display: grid;
  grid-template-columns: 104px 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "media body"
    "foot  foot";
  column-gap: 20px;
  row-gap: 0;
  padding: 22px 24px 0;
  border-bottom: 1px solid var(--aitc-line);
}
.aitc-item:last-child { border-bottom: 0; }

.aitc-item__media {
  grid-area: media;
  width: 104px; height: 104px;
  border-radius: var(--aitc-radius-sm);
  background: var(--aitc-bg);
  border: 1px solid var(--aitc-line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8px; flex-shrink: 0;
  align-self: start;
}
.aitc-item__media img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* item body */
.aitc-item__body {
  grid-area: body;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding-bottom: 16px;
}
.aitc-item__top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.aitc-item__name {
  font-size: 15px; font-weight: 700;
  color: var(--aitc-ink); text-decoration: none;
  line-height: 1.55; flex: 1; transition: color .2s;
}
.aitc-item__name:hover { color: var(--aitc-primary); }

/* remove icon */
.aitc-remove {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--aitc-line); background: #fff;
  color: var(--aitc-muted-2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
  text-decoration: none;
}
.aitc-remove:hover {
  background: rgba(220,38,38,.08); color: var(--aitc-danger);
  border-color: rgba(220,38,38,.2);
}
.aitc-remove svg { width: 15px; height: 15px; }

/* meta rows */
.aitc-item__meta { display: flex; flex-direction: column; gap: 5px; }
.aitc-item__meta-row {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12.5px; color: var(--aitc-muted); line-height: 1.5;
}
.aitc-item__meta-row svg {
  width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px;
  color: var(--aitc-muted-2);
}
.aitc-item__meta-row strong { color: var(--aitc-ink); font-weight: 600; }

/* foot row — full width, price right / stepper left */
.aitc-item__foot {
  grid-area: foot;
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 14px 0 20px;
  border-top: 1px dashed var(--aitc-line-dash);
  margin-top: 4px;
}
.aitc-subtotal {
  font-size: 15px; font-weight: 800;
  color: var(--aitc-ink); font-feature-settings: "tnum";
}

/* ── qty stepper ── */
.aitc-qty {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--aitc-primary);
  border-radius: 100px;
  background: #fff; height: 42px;
  min-width: 120px;
}
.aitc-qty__plus,
.aitc-qty__minus {
  width: 42px; height: 100%;
  background: transparent; border: 0;
  color: var(--aitc-primary);
  font-size: 19px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s;
  border-radius: 100px;
}
.aitc-qty__plus:hover  { color: var(--aitc-primary-2); }
.aitc-qty__minus:hover { color: var(--aitc-primary-2); }
.aitc-qty__del {
  width: 42px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--aitc-danger); text-decoration: none;
  transition: color .15s;
  flex-shrink: 0;
}
.aitc-qty__del:hover { color: #b91c1c; }
.aitc-qty__del svg { width: 16px; height: 16px; }
.aitc-qty__del--hidden,
.aitc-qty__minus--hidden { display: none !important; }

.aitc-qty__input {
  flex: 1; height: 100%; border: 0;
  background: transparent; text-align: center;
  font-family: inherit; font-size: 15px; font-weight: 700;
  color: var(--aitc-ink); -moz-appearance: textfield;
  min-width: 0;
}
.aitc-qty__input::-webkit-outer-spin-button,
.aitc-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aitc-qty__input:focus { outline: none; }

/* ── coupon ── */
.aitc-actions {
  padding: 18px 24px 22px;
  border-top: 1px dashed var(--aitc-line-dash);
}
.aitc-coupon {
  display: flex; gap: 10px; max-width: 480px;
}
.aitc-coupon input {
  flex: 1; height: 44px;
  padding: 0 16px;
  border: 1px solid var(--aitc-line);
  border-radius: 10px; background: #fff;
  font-family: inherit; font-size: 14px;
  color: var(--aitc-ink); min-width: 0;
  transition: border-color .2s, box-shadow .2s;
}
.aitc-coupon input::placeholder { color: var(--aitc-muted-2); }
.aitc-coupon input:focus {
  outline: none;
  border-color: var(--aitc-primary);
  box-shadow: 0 0 0 3px rgba(30,42,120,.1);
}

/* ── buttons ── */
.aitc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.aitc-btn:active { transform: translateY(1px); }
.aitc-btn--primary {
  background: var(--aitc-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px -3px rgba(30,42,120,.35);
}
.aitc-btn--primary:hover {
  background: var(--aitc-primary-2) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px -4px rgba(30,42,120,.45);
}
.aitc-btn--block { width: 100%; height: 52px; font-size: 15px; border-radius: 12px; }

/* ── info card (shipping & install notice) ── */
.aitc-info-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--aitc-surface);
  border: 1px solid var(--aitc-line);
  border-radius: var(--aitc-radius);
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(16,24,40,.05);
}
.aitc-info-card__icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--aitc-primary-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--aitc-primary);
}
.aitc-info-card__icon svg { width: 18px; height: 18px; }
.aitc-info-card__text {
  font-size: 13px; color: var(--aitc-muted);
  line-height: 1.8; margin: 0; padding-top: 2px;
}

/* ── totals sidebar ── */
.aitc-totals {
  position: sticky;
  top: 20px;
  padding: 26px 24px;
  background: var(--aitc-surface);
  border: 1px solid var(--aitc-line);
  border-radius: var(--aitc-radius);
  box-shadow: 0 2px 12px rgba(16,24,40,.05);
  display: flex; flex-direction: column; gap: 16px;
}
.aitc-totals__title {
  font-size: 16px; font-weight: 800; color: var(--aitc-ink); margin: 0;
}
.aitc-totals__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--aitc-line-dash);
}
.aitc-totals__row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.aitc-totals__label { font-size: 13.5px; font-weight: 600; color: var(--aitc-muted); }
.aitc-totals__value { font-size: 14px; font-weight: 700; color: var(--aitc-ink); font-feature-settings: "tnum"; }

/* shipping notice */
.aitc-shipping-notice {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--aitc-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px; color: var(--aitc-muted);
  line-height: 1.7;
}
.aitc-shipping-notice svg {
  width: 15px; height: 15px; flex-shrink: 0;
  color: #f97316; margin-top: 2px;
}

/* grand total */
.aitc-totals__grand {
  display: flex; justify-content: space-between; align-items: baseline;
}
.aitc-totals__grand .aitc-totals__label { font-size: 14px; font-weight: 700; color: var(--aitc-ink); }
.aitc-totals__grand .aitc-totals__value { font-size: 18px; font-weight: 800; color: var(--aitc-ink); }

/* wc proceed to checkout */
.wc-proceed-to-checkout { padding: 0; }
.wc-proceed-to-checkout .aitc-btn--primary,
.wc-proceed-to-checkout a.checkout-button {
  width: 100%; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--aitc-primary) !important;
  color: #fff !important;
  font-family: var(--aitc-font) !important;
  font-size: 15px !important; font-weight: 700 !important;
  border-radius: 12px !important;
  border: none !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px -3px rgba(30,42,120,.35);
  transition: background .2s, box-shadow .2s;
  cursor: pointer;
}
.wc-proceed-to-checkout .aitc-btn--primary:hover,
.wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--aitc-primary-2) !important;
  box-shadow: 0 8px 18px -4px rgba(30,42,120,.45);
}

/* ── mobile sticky bar ── */
.aitc-mobile-bar { display: none; }

/* ── empty cart ── */
.aitc-cart--empty {
  display: block;
  max-width: 920px;
}
.aitc-empty {
  text-align: center;
  padding: 56px 28px 48px;
  font-family: var(--aitc-font); direction: rtl;
  max-width: 560px; margin: 0 auto;
}

/* decorative icon circle + dots */
.aitc-empty__icon {
  position: relative;
  width: 132px; height: 132px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #eef1f8 0%, #e6e9f3 100%);
  display: grid; place-items: center;
  color: var(--aitc-primary);
}
.aitc-empty__icon svg { width: 52px; height: 52px; }
.aitc-empty__dot {
  position: absolute; border-radius: 50%;
}
.aitc-empty__dot--1 { width: 14px; height: 14px; background: var(--aitc-green, #22c55e); top: 8px; right: 14px; }
.aitc-empty__dot--2 { width: 9px;  height: 9px;  background: #86efac; top: 18px; left: 16px; }
.aitc-empty__dot--3 { width: 11px; height: 11px; background: var(--aitc-muted-2); bottom: 14px; right: 6px; }

.aitc-empty__title { font-size: 20px; font-weight: 800; margin: 0 0 10px; color: var(--aitc-ink); }
.aitc-empty__desc  { color: var(--aitc-muted); font-size: 14px; line-height: 2; margin: 0 0 26px; }

/* action buttons */
.aitc-empty__actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 34px;
}
.aitc-btn--soft {
  background: var(--aitc-primary-soft); color: var(--aitc-primary);
}
.aitc-btn--soft:hover { background: rgba(30,42,120,.14); color: var(--aitc-primary); }

/* divider + categories */
.aitc-empty__divider {
  border: 0; border-top: 1px dashed var(--aitc-line-dash);
  margin: 0 0 22px;
}
.aitc-empty__cats-label {
  font-size: 13px; font-weight: 700; color: var(--aitc-muted); margin: 0 0 16px;
}
.aitc-empty__cats {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.aitc-empty__chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px;
  background: var(--aitc-surface);
  border: 1px solid var(--aitc-line);
  border-radius: 100px;
  font-size: 13px; font-weight: 600; color: var(--aitc-ink);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.aitc-empty__chip:hover {
  border-color: var(--aitc-primary);
  box-shadow: 0 6px 16px -6px rgba(30,42,120,.3);
  transform: translateY(-1px);
}
.aitc-empty__chip-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--aitc-bg);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.aitc-empty__chip-icon img { width: 100%; height: 100%; object-fit: cover; }
.aitc-empty__chip-icon svg { width: 15px; height: 15px; color: var(--aitc-primary); }

/* ── responsive ── */
@media (max-width: 1024px) {
  .aitc-cart { grid-template-columns: 1fr; gap: 20px; }
  .aitc-totals { position: static; }
}

@media (max-width: 768px) {
  .aitc-cart {
    padding: 14px 12px 100px;
    gap: 14px;
  }

  .aitc-items-head { padding: 16px 16px 14px; }
  .aitc-items-head__title { font-size: 15px; }

  .aitc-item {
    grid-template-columns: 88px 1fr;
    column-gap: 14px;
    padding: 18px 16px 0;
  }
  .aitc-item__media { width: 88px; height: 88px; border-radius: 12px; }
  .aitc-item__body  { padding-bottom: 12px; }
  .aitc-item__name  { font-size: 14px; }
  .aitc-item__meta-row { font-size: 12px; }
  .aitc-item__foot  { padding: 12px 0 16px; }
  .aitc-subtotal { font-size: 14px; }
  .aitc-qty { height: 38px; min-width: 108px; }
  .aitc-qty__plus, .aitc-qty__minus { width: 38px; font-size: 17px; }
  .aitc-qty__del { width: 38px; }
  .aitc-qty__del svg { width: 15px; height: 15px; }
  .aitc-qty__input { font-size: 14px; }

  .aitc-btn { height: 46px; font-size: 14px; }
  .aitc-info-card { padding: 14px 16px; }
  .aitc-info-card__text { font-size: 12.5px; }

  /* on mobile: show totals card + sticky bar */
  .aitc-cart__right { display: flex; }
  .aitc-totals { position: static; }

  /* mobile sticky bar */
  .aitc-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 62px; /* above bottom nav */
    right: 0; left: 0;
    z-index: 180;
    background: #fff;
    border-top: 1px solid var(--aitc-line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
    align-items: center;
    gap: 14px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    font-family: var(--aitc-font);
    direction: rtl;
  }
  .aitc-mobile-bar__info {
    flex: 1;
    display: flex; flex-direction: column; gap: 2px;
  }
  .aitc-mobile-bar__label {
    font-size: 11px; color: var(--aitc-muted); font-weight: 500;
  }
  .aitc-mobile-bar__total {
    font-size: 15px; font-weight: 800; color: var(--aitc-ink);
    font-feature-settings: "tnum";
  }
  .aitc-mobile-bar__btn {
    height: 46px; padding: 0 20px;
    font-size: 14px; border-radius: 12px;
    white-space: nowrap; flex-shrink: 0;
  }
}

@media (max-width: 400px) {
  .aitc-item { grid-template-columns: 78px 1fr; padding: 16px 12px; gap: 0 12px; }
  .aitc-item__media { width: 78px; height: 78px; }
  .aitc-item__name { font-size: 13px; }
}

/* empty cart — mobile */
@media (max-width: 768px) {
  .aitc-cart--empty { padding: 14px 12px 40px; }
  .aitc-empty { padding: 40px 18px 36px; }
  .aitc-empty__icon { width: 116px; height: 116px; margin-bottom: 22px; }
  .aitc-empty__icon svg { width: 46px; height: 46px; }
  .aitc-empty__title { font-size: 18px; }
  .aitc-empty__desc { font-size: 13.5px; line-height: 1.95; }
  .aitc-empty__actions { flex-direction: column; gap: 10px; }
  .aitc-empty__actions .aitc-btn { width: 100%; height: 52px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .aitc-cart *, .aitc-mobile-bar * { transition: none !important; }
}
