/* ===================== THEME BRIDGE ===================== */

/* White defaults (второй уровень) */
#shop-block{
  --shop-white-bg: #ffffff;
  --shop-white-surface: #ffffff;
  --shop-white-surface-2: #f4f4f4;
  --shop-white-border: #ddd;
  --shop-white-border-soft: #eee;
  --shop-white-text-main: #222;
  --shop-white-text-sub: #333;
  --shop-white-text-light: #666;
  --shop-white-price: #007bff;
  --shop-btn-overlay: rgba(255,255,255,.06);
}

/* DEFAULT: тема (AI) если есть, иначе белые дефолты */
#shop-block.shop-style-default,
#shop-block:not(.shop-style-white){
  --shop-theme-bg: var(--cs-bg-light, var(--shop-white-bg));
  --shop-theme-surface: var(--cs-card-bg, var(--shop-white-surface));
  --shop-theme-surface-2: var(--cs-bg-light, var(--shop-white-surface-2));
  --shop-theme-border: var(--cs-border, var(--shop-white-border));
  --shop-theme-border-soft: var(--cs-border, var(--shop-white-border-soft));
  --shop-theme-text-main: var(--cs-text-strong, var(--shop-white-text-main));
  --shop-theme-text-sub: var(--cs-text, var(--shop-white-text-sub));
  --shop-theme-text-light: var(--cs-text, var(--shop-white-text-light));
  --shop-theme-price: var(--cs-accent, var(--shop-white-price));
}

/* WHITE OVERRIDE: полностью игнорим --cs-* */
#shop-block.shop-style-white{
  --shop-theme-bg: var(--shop-white-bg);
  --shop-theme-surface: var(--shop-white-surface);
  --shop-theme-surface-2: var(--shop-white-surface-2);
  --shop-theme-border: var(--shop-white-border);
  --shop-theme-border-soft: var(--shop-white-border-soft);
  --shop-theme-text-main: var(--shop-white-text-main);
  --shop-theme-text-sub: var(--shop-white-text-sub);
  --shop-theme-text-light: var(--shop-white-text-light);
  --shop-theme-price: var(--shop-white-price);
}

/* INLINE OVERRIDE (редактор): может быть 0/1/3/4 переменных */
#shop-block{
  --shop-text-main:  var(--color-text-main,  var(--shop-theme-text-main));
  --shop-text-sub:   var(--color-text-sub,   var(--shop-theme-text-sub));
  --shop-text-light: var(--color-text-light, var(--shop-theme-text-light));
  --shop-price:      var(--color-price,      var(--shop-theme-price));
}

/* === БАЗОВЫЙ СТИЛЬ (по умолчанию = NONE) === */
#shop-block {
  overflow: hidden;
  max-height: 80vh; /* высота видимой части */
  transition: max-height 0.6s ease;
  border-radius: 20px;
  position: relative;
  width: 100%;
 /* max-width: 100%;*/
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  display:none;

  /* по умолчанию — прозрачный фон (NONE) */
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;

  font-size: 1em;/*32px*/
  font-weight: bold;
  /*text-transform: uppercase;*/
  /*display: flex;*/
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;

/*  color: #666;
  --shop-text-main: #222;     // Заголовки, названия
  --shop-text-sub: #333;      // Категории, ID
  --shop-text-light: #666;    // Description, мелкий текст
  --shop-price: #007bff;      // Цена (акцентный)
*/
}

/* === Нижний градиент (по умолчанию выключен) === */
#shop-block::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  opacity: 0; /* none = прозрачный по умолчанию */
  pointer-events: none;
  transition: opacity 0.3s;
}

/* === GLASS (стеклянный фон с размытием) === */
#shop-block.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
#shop-block.glass::after {
  background: linear-gradient(to top, rgba(255,255,255,0.6), rgba(255,255,255,0));
  opacity: 1;
}

/* === LAYER (белая подложка без размытия) === */
#shop-block.layer {
  background: var(--shop-theme-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
}
#shop-block.layer::after {
  background: linear-gradient(to top, rgba(255,255,255,1), rgba(255,255,255,0));
  opacity: 1;
}

/* === РАСКРЫТИЕ (expanded) === */
#shop-block.expanded {
  max-height: 100% !important;
}
#shop-block.expanded::after {
  opacity: 0 !important;
}



/* кнопка в стиле sort-btn */
.shop-toggle-tab {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  font-size: 12px;
  color: var(--shop-text-sub);
/*  border: 1px solid rgba(255, 255, 255, 0.3); */
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3); /* ← полупрозрачный фон */
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
  z-index: 10;
}

.shop-toggle-tab:hover {
  background: rgba(255, 255, 255, 0.75); /* чуть плотнее при наведении */
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.shop-toggle-tab:active {
  transform: translateX(-50%) translateY(0);
  background: rgba(255, 255, 255, 0.65);
}


.shop-toggle-tab::after {
  content: "▼";
  font-size: 11px;
  margin-left: 6px;
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s;
}

#shop-block.expanded + .shop-toggle-tab::after {
  content: "▲";
  opacity: 0.8;
}


  .shop-item,
  .shop-detail-inner,
  .shop-cart-inner,
  .shop-thankyou {
    background: var(--shop-theme-surface);
    border: 1px solid var(--shop-theme-border);
  }

  .shop-item {
    width: 280px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .shop-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

  .shop-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    /*border-radius: 8px;*/
    margin-bottom: 10px;
  }

  .shop-item h4 {
    margin: 8px 0 5px 0;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--shop-text-main);
  }

  .shop-item p {
    margin: 0;
    color: var(--shop-text-light);
    font-size: 14px;
  }

  .shop-item .price {
    font-weight: bold;
    margin-top: 8px;
    color: var(--shop-price);
    font-size: 1.4em;
  }

  .shop-item .id-item {
    color: var(--shop-text-light);
    font-size: 0.8em;
  }

  .shop-item .tags {
    color: var(--shop-text-light);
    font-size: 1em;
  }

.shop-pagination {
  width: 100%;
  text-align: center;
  margin: 15px 0 25px;
  flex: 0 0 auto; /* 👈 не растягивать */
  display: block; /* 👈 независимо от flex-окружения */
}

.shop-pagination button, .shop-contacts button {
  margin: 0 5px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  color: var(--shop-text-sub);
  transition: all 0.2s ease;
}

.shop-pagination button:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
}

.shop-pagination button.active {
  border: 1px solid var(--shop-price);
  background: var(--shop-price);
  color: #fff;
}

.shop-contacts button:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
}


.shop-contacts-empty {
  color: #f00;
}

.shop-contacts div:not(.shop-contacts-t) {
  font-weight: normal;
  text-transform: none;
}


.shop-pagination svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.shop-detail {
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.shop-detail-inner {
  width: 100%;
  max-width: 1000px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  box-sizing: border-box;
}

.shop-close,
.shop-close1 {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--shop-text-light);
  cursor: pointer;
  padding: 4px; /* чтобы была зона клика */
  transition: color 0.2s ease, transform 0.15s ease;
  z-index: 10;
}

.shop-close:hover,
.shop-close1:hover {
  color: var(--shop-text-main);
  transform: scale(1.1);
}

.shop-detail-image {
  flex: 1 1 300px;
}

.shop-detail-image img {
  max-width: 100%;
  max-height: 300px;
  object-fit: cover;
  /*border-radius: 8px;*/
}

.shop-detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}

.shop-detail-thumbs img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  /*object-fit: contain;
  border-radius: 8px;*/
}

.shop-detail-info {
  flex: 2 1 400px;
}

.shop-detail-info h2 {
  margin: 8px 0 5px 0;
  font-weight: bold;
  color: var(--shop-text-main);
  font-size: 1.4em;
}

.shop-price {
  font-weight: bold;
  color: var(--shop-price);
  margin: 10px 0;
  font-size: 1.4em;
}

.shop-id {
  color: var(--shop-text-light);
  font-size: 0.9em;
}

.shop-tags {
  color: var(--shop-text-light);
  font-size: 1em;
}

.shop-desc {
  color: var(--shop-text-light);
  font-size: 1.2em;
  font-weight: normal;
  text-transform: none;
}

.shop-descm {
  color: var(--shop-text-light);
  font-size: 1em;
  font-weight: normal;
  text-transform: none;
  margin: 20px;
}

.cs-title-s {
  margin-bottom: 0px !important;
}



.sort-group {
  display: inline-flex;
  gap: 8px;
  margin-left: 20px;
}

.sort-btn {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.shop-detail.closing {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

.shop-more {
  cursor: pointer;
}

.shop-contacts button{
  margin-top: 10px;
}

.shop-more-btn, .shop-buy, .shop-order-btn,
.shop-pagination button, .shop-contacts button,
.sort-btn, .cart-qty button{
  background-color: var(--shop-theme-surface-2);
  background-image: linear-gradient(var(--shop-btn-overlay), var(--shop-btn-overlay));
  border: 1px solid var(--shop-theme-border);
  color: var(--shop-text-sub);
}

.shop-more-btn, .shop-buy, .shop-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  /*font-size: 15px;
  font-weight: 600;*/
  color: var(--shop-text-sub);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
  margin-top: 10px;
  font-size: 1.2em;
}

.shop-more-btn {
  width: 100%;
}

.shop-more-btn:hover, .shop-buy:hover, shop-order-btn:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.shop-more-btn svg, .shop-buy svg, .shop-order-btn svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

@media (max-width: 768px) {
  #shop-block {
    gap: 15px;
    padding: 10px;
  }

  .shop-close1 {
    top: 5px !important;
    right: 5px !important;
  }

  .shop-item{
    width: 100%;      /* 👈 перебивает width:280px */
    max-width: 95%;   /* или 100% если хочешь впритык */
    margin: 0 auto;
  }

  .shop-item img {
    max-height: 180px;
  }

/*  .shop-item h4 {
    font-size: 15px;
  }

  .shop-item .price {
    font-size: 16px;
  }*/

  /* 👇 добавляем это сюда */
  .shop-detail-inner {
    padding: 15px 15px 25px 15px;
  }

  .shop-detail-image img {
    /*border-radius: 10px;*/
  }

  .shop-detail-main img {
    /*border-radius: 10px;*/
  }

}

/* Корзина */
.shop-cart {
  color: var(--shop-text-light);
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.shop-cart-inner {
  border-radius: 10px;
  padding: 25px 30px;
  width: 95%;               /* чуть шире */
  max-width: 1000px;        /* 🔥 вернули простор, как в карточке */
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  position: relative; /* 🔹 теперь кнопка позиционируется относительно этого блока */
}

/* --- Заголовок --- */
.shop-cart-title {
  display: flex;
  align-items: center;
  justify-content: center; /* 🔥 теперь по центру */
  gap: 10px;
  font-size: 1.4em;
  font-weight: bold;
  color: var(--shop-text-light);
  margin: 30px 0px 30px 0px;
}

.shop-cart-title svg {
  width: 24px;
  height: 24px;
  fill: var(--shop-text-light);
}

/* --- Список товаров --- */
.shop-cart-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 15px;
}

/* --- Товар --- */
.cart-item {
  display: grid;
  grid-template-columns: 150px minmax(250px, 1fr) 160px; /* ✅ три колонки: фото | текст | количество */
  align-items: center;
  gap: 20px;
  border-bottom: 1px dotted var(--shop-text-light);
  padding: 15px 0;
  width: 100%;
}

.cart-item img {
  max-width: 150px;
  max-height: 150px;
/* border-radius: 8px; */
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.cart-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* чтобы текст не прилипал к центру */
  width: 100%;             /* ✅ растягиваем по ширине */
}

.cart-info .shop-id {
  color: var(--shop-text-light);
  font-size: 0.8em;
  margin-bottom: 4px;
}

.cart-info h2 {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--shop-text-main);
  margin: 2px 0 6px;
  word-break: break-word;
}

.cart-info .shop-price {
  font-weight: bold;
  color: var(--shop-price);
  font-size: 1.4em;
  margin-top: 2px;
}

/* --- Количество --- */
.cart-qty {
  display: flex;
  color: var(--shop-text-light);
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-right: 20px;
  font-size: 1.2em;
}

.cart-qty button {
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  transition: 0.2s;
}

.cart-qty button:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
}

.cart-qty .qty-del {
  border: none;
  background: none;
  color: #d33;
  font-size: 18px;
}

.cart-qty .qty-del:hover {
  color: #a00;
}

/* --- Итого --- */
.shop-cart-total {
  text-align: right;
  font-size: 1.4em;
  font-weight: 600;
  color: var(--shop-text-light);
  margin-top: 10px;
}

.shop-cart-total b{
  font-weight: 600;
}

.shop-cart-total span{
  color: var(--shop-price);
}


/* --- Кнопка заказа (в стиле карточки) --- */
/*.shop-buy, .shop-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  color: var(--shop-text-sub);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
  margin: 20px auto 0;
}*/

.shop-buy:hover, .shop-order-btn:hover {
  background: var(--shop-price);
  color: #fff;
  border-color: var(--shop-price);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* --- Мобильная адаптация --- */
@media (max-width: 700px) {
  .cart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  .cart-item img {
    max-width: 80%;
    max-height: 250px;
  }
  .cart-info {
    align-items: center;
  }
  .cart-info h2 {
    font-size: 18px;
  }
  .cart-qty {
    justify-content: center;
    margin-right: 0px;
  }
  .shop-cart-total {
    text-align: center;
    margin-top: 15px;
  }
  .shop-buy, .shop-order-btn {
    width: 100%;
    max-width: 250px;
  }
  .shop-cart-inner {
    width: 95%;
    padding: 15px;
  }
  .shop-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 8px; /* 🔥 горизонтальный и вертикальный отступы */
    margin-top: 10px;
  }
}

/* ThankYou page */
.shop-thankyou {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 700px;
  padding: 30px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  animation: fadeIn 0.4s ease;
}

.shop-thankyou .shop-close {
  position: absolute;
  right: 10px;
  top: 10px;
/*  background: none;
  border: none;*/
  font-size: 20px;
  cursor: pointer;
}

.shop-thankyou h2 {
  margin: 10px 0;
  color: var(--shop-text-sub);
}

.shop-thankyou p {
  color: var(--shop-text-light);
  margin: 6px 0;
}

.shop-thankyou .shop-pay-btn {
  background: #ffd633;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  color: var(--shop-text-main);
  transition: all 0.2s ease;
}

.shop-thankyou .shop-pay-btn:hover {
  background: #ffcc00;
}

@keyframes fadeIn {
  from {opacity:0; transform: translateY(20px);}
  to {opacity:1; transform: translateY(0);}
}

/* shop-thankyou */
.shop-thankyou {
  text-align: center;
}
.shop-payments-final {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
}
.pay-method {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.pay-method.none {
  color: #888;
  font-style: italic;
}
.shop-pay-btn {
  margin-top: 10px;
  background: #007bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.shop-pay-btn:hover {
  background: #0056b3;
}

.shop-no-vh {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.shop-root {
  --shop-radius-scale: 1;
}

.shop-radius-0 { --shop-radius-scale: 0; }
.shop-radius-1 { --shop-radius-scale: 0.6; }
.shop-radius-2 { --shop-radius-scale: 1; }
.shop-radius-3 { --shop-radius-scale: 1.5; }

.shop-toggle-tab { border-radius: 4px; }

.shop-pagination button, .shop-contacts button, .sort-group button, .cart-qty button,  .pay-method { border-radius: calc(6px * var(--shop-radius-scale)); }

.shop-more-btn, .shop-buy, .shop-order-btn { border-radius: calc(8px * var(--shop-radius-scale)); }

.shop-item, .shop-detail-inner, .shop-cart-inner { border-radius: calc(10px * var(--shop-radius-scale)); }

.shop-thankyou { border-radius: calc(12px * var(--shop-radius-scale)); }

#shop-block { border-radius: calc(20px * var(--shop-radius-scale)); }


