/* WPShop cart / forms — под наш визуальный язык */
.ks-theme #wpshop_cart,
.ks-theme #wpshop_minicart,
.ks-theme .wpshop_bag {
  font-family: var(--font-body);
  color: var(--ink);
}

.ks-theme .checkout-page,
.ks-theme .ks-cart-page {
  max-width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 3.5rem) var(--space, 1.25rem) 4rem;
}

.ks-theme .ks-cart-page .checkout-box,
.ks-theme .ks-cart-page .ks-cart-content,
.ks-theme .ks-cart-page .entry-content {
  max-width: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
}

/* Скрыть служебный блок «передать заказ» со secret-ссылкой */
.ks-theme #pass_order,
.ks-theme a.wpshop_reset_order {
  display: none !important;
}

.ks-theme #wpshop_cart {
  width: 100%;
  max-width: 100%;
  float: none;
  overflow: visible;
}

.ks-theme #wpshop_cart .recycle_bin {
  width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card, 0 20px 50px rgba(16, 24, 40, 0.07));
  overflow: hidden;
}

.ks-theme #wpshop_cart .recycle_bin thead th {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.ks-theme #wpshop_cart .recycle_bin td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ks-theme #wpshop_cart .recycle_bin tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.ks-theme #wpshop_cart .rb_img {
  width: 56px;
  white-space: nowrap;
}

.ks-theme #wpshop_cart .rb_img a {
  display: block;
  width: 48px;
  height: 48px;
  border: 0 !important;
  outline: none;
  box-shadow: none;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
}

.ks-theme #wpshop_cart .rb_img img,
.ks-theme #wpshop_cart .ks-cart-thumb {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain;
  display: block;
  border: 0 !important;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.ks-theme #wpshop_cart .rb_name a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.35;
}

.ks-theme #wpshop_cart .rb_name a:hover {
  color: var(--accent);
}

.ks-theme #wpshop_cart .rb_type {
  display: none;
}

.ks-theme #wpshop_cart .rb_num {
  white-space: nowrap;
}

.ks-theme #wpshop_cart .rb_num a.minus,
.ks-theme #wpshop_cart .rb_num a.plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  background: var(--bg-elevated);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  vertical-align: middle;
}

.ks-theme #wpshop_cart .rb_num a.minus:hover,
.ks-theme #wpshop_cart .rb_num a.plus:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ks-theme #wpshop_cart .rb_num input[type="text"] {
  width: 3rem;
  height: 32px;
  text-align: center;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  margin: 0 0.25rem;
  vertical-align: middle;
}

.ks-theme #wpshop_cart .ks-del-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem !important;
  border: 2px solid var(--ink);
  background: var(--bg-elevated);
  color: var(--ink) !important;
  text-decoration: none !important;
  font-family: var(--font-body);
  font-size: 0.68rem;
  line-height: 1.2;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
}

.ks-theme #wpshop_cart .ks-del-btn:hover {
  border-color: #c0392b;
  color: #c0392b !important;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-btn);
}

.ks-theme #wpshop_cart .ks-del-btn span {
  display: inline;
}

.ks-theme #wpshop_cart tfoot td {
  border-bottom: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: var(--bg-soft);
}

.ks-theme #wpshop_cart tfoot .rb_total strong {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--accent);
}

.ks-theme .wpshop-button,
.ks-theme input.wpshop-button1,
.ks-theme input.wpshop-button2,
.ks-theme a.wpshop-button,
.ks-theme .cform .sendbutton,
.ks-theme .cform input.sendbutton,
.ks-theme #ks-checkout-cta a.wpshop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0.5rem 0.35rem 0;
  padding: 0.9rem 1.5rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm, 8px);
  background: var(--accent);
  color: var(--accent-ink) !important;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none !important;
  box-shadow: var(--shadow-btn, 0 10px 28px rgba(15, 55, 110, 0.22));
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.ks-theme .wpshop-button:hover,
.ks-theme input.wpshop-button1:hover,
.ks-theme input.wpshop-button2:hover,
.ks-theme a.wpshop-button:hover,
.ks-theme .cform .sendbutton:hover,
.ks-theme .cform input.sendbutton:hover,
.ks-theme #ks-checkout-cta a.wpshop-button:hover {
  background: var(--accent-hover, #1f6bc7);
  border-color: var(--accent-hover, #1f6bc7);
  transform: translateY(-1px);
}

/* Доставка: скрыть блок «Канцелярия школы / Подробнее о доставке» */
.ks-theme ul.custom_del,
.ks-theme .choose_del,
.ks-theme .select_delivery,
.ks-theme select[name="select_delivery"],
.ks-theme a.delivery_link_more,
.ks-theme #yandex_dostavka_form_container {
  display: none !important;
}

.ks-theme #ks-checkout-cta {
  margin: 1rem 0 0.5rem;
  clear: both;
}

.ks-theme .ks-pay-now {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--panel-border, var(--line));
  border-radius: var(--radius, 10px);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card, 0 6px 24px rgba(44, 42, 38, 0.07));
  position: relative;
  z-index: 8;
}

.ks-theme .ks-pay-now-lead,
.ks-theme .ks-pay-now-note {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
}

.ks-theme .ks-ek-pay-form {
  margin: 0;
}

.ks-theme .ks-ek-pay-form input.wpshop-button,
.ks-theme form[action*="merchant.w1.ru"] input[type="submit"],
.ks-theme form[action*="merchant.w1.ru"] .wpshop-button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin-top: 0.25rem;
}

/* Блок входа / регистрации на шаге оформления */
.ks-theme .wpshop-auth-site {
  float: none !important;
  width: 100% !important;
  max-width: 28rem;
  margin: 0 0 1.25rem !important;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 2px);
  background: var(--bg-elevated);
  box-shadow: none;
  position: relative;
  z-index: 6;
  pointer-events: auto !important;
}

.ks-theme .wpshop-auth-site + .wpshop-auth-site {
  margin-top: 1rem !important;
}

.ks-theme .wpshop-auth-txt {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.ks-theme .wpshop-auth-site input[type="text"],
.ks-theme .wpshop-auth-site input[type="password"],
.ks-theme .wpshop-auth-site input[type="email"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.35rem 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  pointer-events: auto;
}

.ks-theme .wpshop-auth-site input[type="submit"],
.ks-theme .wpshop-auth-site input[type="button"],
.ks-theme .wpshop-auth-site .wpshop-button1,
.ks-theme .wpshop-auth-site .wpshop-button2 {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 7;
}

/* Залипший оверлей WPShop перекрывает форму входа — скрываем полностью */
.ks-theme #wpshop_shadow_window,
.ks-theme #wpshop_background_alert_put_to_cart,
.ks-theme #wpshop_modal {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

.ks-theme #wpshop_cart::after {
  content: "";
  display: table;
  clear: both;
}

.ks-theme .wpshop_button .arrow_button,
.ks-theme a.arrow_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  box-shadow: var(--shadow-btn);
}

.ks-theme .cform,
.ks-theme fieldset {
  border-color: var(--line);
}

.ks-theme .cform input[type="text"],
.ks-theme .cform input[type="email"],
.ks-theme .cform input[type="tel"],
.ks-theme .cform textarea,
.ks-theme .cform select {
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.ks-theme .ks-buy-wrap {
  display: inline-flex;
  width: auto;
}

.ks-theme .order-card .ks-buy-wrap {
  display: block;
  width: 100%;
}

.ks-theme .order-card .ks-buy-wrap .btn {
  width: 100%;
}

.ks-theme .product .ks-buy-wrap {
  display: inline-flex;
  width: auto;
  justify-self: end;
}

.ks-theme .product .ks-buy-wrap .btn {
  width: auto;
}

.ks-theme .ks-cart-hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.ks-theme .entry-content {
  max-width: 52rem;
  line-height: 1.6;
}

.ks-theme .page-title {
  font-family: var(--font-body);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 0.75rem;
}

/* Способы оплаты — сетка вместо длинной колонки */
.ks-theme #payments-table {
  float: none !important;
  width: 100% !important;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  padding: 0;
  overflow: visible;
  position: relative;
  clear: both;
}

.ks-theme #payments-table #mode-paymets-title,
.ks-theme #mode-paymets-title {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
}

.ks-theme #payments-table ul {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 !important;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
}

.ks-theme #payments-table li {
  float: none !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0.85rem 0.55rem 0.75rem;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color var(--ease, 0.18s ease), box-shadow var(--ease, 0.18s ease);
}

.ks-theme #payments-table li:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-btn);
}

.ks-theme #payments-table li a {
  display: block;
  text-decoration: none !important;
  color: var(--ink) !important;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.ks-theme #payments-table li a:hover {
  color: var(--accent) !important;
}

.ks-theme #payments-table li img {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
}

.ks-theme #payments-table li br {
  display: none;
}

@media (max-width: 800px) {
  .ks-theme #payments-table ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .ks-theme #wpshop_cart .recycle_bin thead {
    display: none;
  }

  .ks-theme #wpshop_cart .recycle_bin,
  .ks-theme #wpshop_cart .recycle_bin tbody,
  .ks-theme #wpshop_cart .recycle_bin tr,
  .ks-theme #wpshop_cart .recycle_bin td {
    display: block;
    width: 100%;
  }

  .ks-theme #wpshop_cart .recycle_bin tr.rb_item {
    padding: 0.85rem;
    border-bottom: 1px solid var(--line);
  }

  .ks-theme #wpshop_cart .rb_img {
    margin-bottom: 0.5rem;
  }

  .ks-theme #wpshop_cart .ks-del-btn span {
    display: inline;
  }

  .ks-theme #wpshop_cart tfoot tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem;
  }

  .ks-theme #wpshop_cart tfoot td {
    width: auto;
    border: 0;
    padding: 0.25rem;
    background: transparent;
  }

  .ks-theme #payments-table ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .ks-theme #payments-table ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .ks-theme #payments-table li img {
    width: 52px !important;
    height: 52px !important;
  }
}
