/* Armenian font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Armenian:wght@400;600;700;800;900&display=swap');

/* ===================== Глобальные переменные ===================== */
:root{
  --c-bg:#fff;
  --c-text:#0f172a;
  --c-muted:#64748b;
  --c-border:#e2e8f0;

  /* Брендовый синий (#1947C4) */
  --c-accent:#1947C4;
  --c-accent-600:#1236A8;
  --c-accent-700:#0F2E8F;

  --c-danger:#ef4444;
  --c-shadow:0 26px 80px rgba(2,6,23,.12);
  --radius:18px;
}

.cca-cart, .cca-cart *{
  font-family:"Noto Sans Armenian","Noto Sans",system-ui,-apple-system,"Segoe UI",Arial,sans-serif !important;
  color:var(--c-text);
}

/* ========================= Layout / Desktop ========================= */
.cca-cart__grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:28px;
}
@media (max-width:992px){ .cca-cart__grid{ grid-template-columns:1fr; } }

.cca-cart__head{
  display:grid;
  grid-template-columns:1fr 160px;
  gap:12px;
  margin-bottom:8px;
  color:#334155;
  font-weight:800;
}

/* ========================= Items list ========================= */
#cca-cart-items{ display:flex; flex-direction:column; gap:12px; }

.cca-cart__empty{
  padding:28px;
  border:1px dashed var(--c-border);
  border-radius:16px;
  color:var(--c-muted);
}

.cca-row{
  position:relative;
  display:grid;
  grid-template-columns:1fr 160px;
  gap:12px;
  background:#fff;
  border:1px solid var(--c-border);
  border-radius:var(--radius);
  box-shadow:0 10px 22px rgba(2,6,23,.06);
  overflow:visible !important;
}
.cca-row__left{ display:flex; align-items:center; gap:14px; padding:12px 14px; overflow:visible !important; }
.cca-row__right{
  display:flex; align-items:center; justify-content:flex-end;
  padding:12px 14px; border-left:1px dashed var(--c-border);
  overflow:visible !important;
}

.thumb img{ width:88px; height:88px; object-fit:cover; border-radius:12px; display:block; }

.info .name{
  font-weight:900; font-size:18px; color:var(--c-text); text-decoration:none; display:block;
  max-width:min(54vw,520px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.info .name:hover{ color:var(--c-accent-600); }
.info .price{ color:var(--c-accent); font-weight:800; margin-top:4px; font-size:14px; }

/* Quantity (desktop) */
.qty{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.cca-qty-btn{
  width:36px; height:36px; border-radius:10px; background:#fff; border:1px solid var(--c-border);
  box-shadow:0 4px 10px rgba(2,6,23,.06); cursor:pointer; font-weight:900;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.cca-qty-btn:hover{ transform:translateY(-1px); box-shadow:0 8px 16px rgba(2,6,23,.12); border-color:#cbd5e1; background:#f8fbff; }
.cca-qty-input{
  width:68px; height:38px; border:1px solid var(--c-border); border-radius:10px;
  text-align:center; font-weight:800; background:#f8fafc; outline:none;
}
.cca-qty-input:focus-visible{ border-color:var(--c-accent); box-shadow:0 0 0 3px rgba(25,71,196,.18); }
.cca-qty-input::-webkit-outer-spin-button,
.cca-qty-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.cca-qty-input[type=number]{ -moz-appearance:textfield; }

/* ========================= Remove (desktop baseline) ========================= */
.remove,
.wc-block-cart-item__remove-link{
  margin-left:10px; width:36px; height:36px; border-radius:10px; border:1px solid var(--c-border);
  background:#fff; color:#94a3b8; cursor:pointer; font-size:18px; line-height:1;
  transition:background .15s ease,color .15s ease,transform .15s ease,border-color .15s ease;
}
.remove:hover,
.wc-block-cart-item__remove-link:hover{
  background:#fff1f2; color:var(--c-danger); border-color:#fecaca; transform:translateY(-1px);
}

/* Line total */
.line-total{ font-weight:900; font-size:18px; }

/* ========================= Back link — ONE clean arrow ========================= */
.cca-cart__return{
  display:inline-flex; align-items:center;
  gap:10px; margin-top:12px;
  color:var(--c-accent); text-decoration:none; font-weight:800;
  padding:0; text-indent:0;
}
.cca-cart__return:before,
.cca-cart__return:after{ content:none !important; }
.cca-cart__return::first-letter{
  display:inline-block; background:var(--c-accent); color:#fff; border-radius:12px;
  padding:3px 7px; line-height:1; box-shadow:0 2px 8px rgba(25,71,196,.35); margin-right:6px;
}
.cca-cart__return:hover{ text-decoration:underline; }

/* ========================= Totals / Sidebar ========================= */
.cca-cart__sidebar{ position:sticky; top:24px; }
.cca-totals{
  background:#fff; border:1px solid var(--c-border); border-radius:var(--radius); box-shadow:var(--c-shadow);
  padding:18px;
}
.cca-totals .ttl{ margin:0 0 8px; font-weight:900; }
.cca-totals .row{ display:flex; justify-content:space-between; align-items:center; padding:8px 0; }
.cca-totals .row.muted{ color:var(--c-muted); }
.cca-totals .row.total{ padding-top:10px; border-top:1px dashed var(--c-border); font-size:20px; font-weight:900; }

/* ========================= Checkout button ========================= */
.btn-checkout{
  display:flex; align-items:center; justify-content:center;
  width:100%; min-height:56px; margin-top:12px;
  border-radius:var(--radius);
  background-color:var(--c-accent);
  background-image:linear-gradient(180deg, var(--c-accent) 0%, var(--c-accent-600) 100%);
  color:#fff; text-decoration:none; font-weight:900; letter-spacing:.01em;
  box-shadow:0 16px 32px rgba(25,71,196,.25), inset 0 -2px 0 rgba(0,0,0,.12);
  transition:transform .15s ease, filter .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.btn-checkout:hover{ transform:translateY(-1px); filter:brightness(1.03) saturate(1.05); box-shadow:0 20px 36px rgba(18,54,168,.32), inset 0 -2px 0 rgba(0,0,0,.12); }
.btn-checkout:active{ transform:translateY(0); background-image:linear-gradient(180deg, var(--c-accent-600) 0%, var(--c-accent-700) 100%); }
.btn-checkout:focus-visible{ outline:3px solid rgba(25,71,196,.35); outline-offset:2px; box-shadow:0 0 0 4px rgba(25,71,196,.18), 0 16px 32px rgba(25,71,196,.25); }
.btn-checkout[disabled], .btn-checkout.is-disabled{ opacity:.55; cursor:not-allowed; filter:none; transform:none; box-shadow:none; }

/* ========================= MOBILE — qty снизу + крестик справа ========================= */
@media (max-width:768px){
  .cca-cart{ padding:10px 12px 140px; }

  .cca-row{
    grid-template-columns:1fr;
    gap:0;
    border-radius:16px;
    padding-right:84px;                 /* место под крестик */
  }

  .cca-row__left{
    display:grid;
    grid-template-columns:112px 1fr;
    grid-template-rows:auto auto;
    column-gap:14px; row-gap:8px;
    align-items:start;
    padding:14px 14px 8px 14px;
  }

  .thumb{ grid-column:1 / 2; grid-row:1 / 3; }
  .thumb img{ width:104px; height:140px; border-radius:14px; object-fit:cover; }

  .info{ grid-column:2 / 3; grid-row:1 / 2; }
  .info .name{
    max-width:100%; font-size:18px; line-height:1.35;
    white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  }
  .info .price{ font-size:14px; margin-top:4px; }

  .qty{
    grid-column:2 / 3; grid-row:2 / 3;
    justify-self:start; align-self:center;
    margin-left:0; position:static;
    background:#fff; border:1px solid var(--c-border);
    border-radius:16px; padding:3px;
    box-shadow:0 6px 14px rgba(2,6,23,.08);
  }
  .cca-qty-btn{ width:40px; height:40px; border-radius:12px; border:none; background:#fff; }
  .cca-qty-btn:hover{ background:#f1f5f9; }
  .cca-qty-input{ width:56px; height:40px; margin:0 2px; border:1px solid var(--c-border); border-radius:10px; background:#f8fafc; font-size:16px; }

  .cca-row__right{
    border-left:none; border-top:1px dashed var(--c-border);
    justify-content:flex-start; padding:12px 14px;
  }
  .line-total{ font-size:18px; }

  /* КРЕСТИК — один, всегда видимый внутри карточки */
  .cca-row, .cca-row__left, .cca-row__right{ overflow:visible !important; }

  .cca-row .remove,
  .cca-row .wc-block-cart-item__remove-link{
    position:absolute !important;
    right:53px !important; top:2px !important; left:auto !important;
    width:44px; height:44px; border-radius:14px;
    border:1px solid #d7e0eb; background:#fff; color:var(--c-text);
    display:inline-flex; align-items:center; justify-content:center;
    box-shadow:0 10px 22px rgba(2,6,23,.12);
    text-decoration:none; font-weight:800; z-index:9; pointer-events:auto;

    /* Спрятать любой встроенный текст/иконки, чтобы не было дубля */
    font-size:0; line-height:0; text-indent:0; letter-spacing:0;
    overflow:hidden;
  }
  /* некоторые темы рисуют иконку через ::after — отключим */
  .cca-row .remove::after,
  .cca-row .wc-block-cart-item__remove-link::after{ content:none !important; }

  /* спрячем вложенные узлы на всякий случай */
  .cca-row .remove > *, .cca-row .wc-block-cart-item__remove-link > *{ display:none !important; }

  /* наш единственный символ × */
  .cca-row .remove::before,
  .cca-row .wc-block-cart-item__remove-link::before{
    content:"×"; font-size:22px; line-height:1; color:var(--c-text);
  }
  .cca-row .remove:hover,
  .cca-row .wc-block-cart-item__remove-link:hover{
    background:#fff1f2; border-color:#fecaca; color:var(--c-danger);
    box-shadow:0 12px 24px rgba(239,68,68,.18);
  }

  /* Sidebar снизу */
  .cca-cart__sidebar{
    position:fixed; left:0; right:0; bottom:0; top:auto; z-index:1000;
    box-shadow:0 -10px 30px rgba(2,6,23,.15);
  }
  .cca-totals{
    border-radius:16px 16px 0 0; border:0; border-top:1px solid var(--c-border);
    padding:14px 16px; background:#fff;
  }
  .cca-totals .ttl{ font-size:16px; margin-bottom:4px; }
  .cca-totals .row{ padding:6px 0; }
  .cca-totals .row.total{ font-size:18px; padding-top:8px; }

  .btn-checkout{
    min-height:54px; font-size:16px; border-radius:14px;
    background-color:var(--c-accent);
    background-image:linear-gradient(180deg, var(--c-accent) 0%, var(--c-accent-600) 100%);
    box-shadow:0 18px 36px rgba(25,71,196,.28), inset 0 -2px 0 rgba(0,0,0,.12);
  }

  .cca-cart__return{ margin:10px 0 2px; padding:6px 0; font-size:15px; }
}

/* Очень узкие экраны */
@media (max-width:380px){
  .thumb img{ width:96px; height:128px; }
  .info .name{ font-size:16px; }
  .cca-qty-input{ width:52px; height:38px; font-size:15px; }
  .cca-qty-btn{ width:38px; height:38px; }
  .btn-checkout{ min-height:52px; font-size:15px; }
}

/* На случай если тема режет overflow у внешних контейнеров */
@media (max-width:768px){
  .woocommerce, .entry-content, .wp-site-blocks{ overflow:visible !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .cca-qty-btn, .btn-checkout, .remove, .wc-block-cart-item__remove-link, .cca-cart__return{ transition:none !important; }
}
