/**
 * Ajax Cart CSS - стили для модального окна корзины
 */

/* Основной контейнер модального окна */
.theme-ajax-cart-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  visibility: hidden;
  z-index: 999990;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 750px;
  pointer-events: none;
}

.theme-ajax-cart-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.theme-ajax-cart-modal-content {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 28px;
  position: relative;
}

.theme-ajax-cart-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: #777;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
  z-index: 10;
}

.theme-ajax-cart-modal-close:hover {
  color: #000;
}

/* Тело модального окна */
.theme-ajax-cart-modal-body {
  margin-top: 10px;
}

#cart-items-container-simple {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.redcoder-cartsimg {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #eaeaea;
  padding: 12px;
}

.redcoder-cartsimg img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* Бейдж "В наличии" */
.product-badge-in-stock {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #4caf50;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.redcoder-cartsinfo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.redcoder-cartsname {
  font-weight: 600;
  font-size: 18px;
  color: #222;
  margin-bottom: 12px;
  line-height: 1.4;
  padding-right: 30px; /* Отступ, чтобы не налезал на кнопку закрытия */
}

/* Стили для блока цены */
.redcoder-cartsprice {
  color: #111;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 10px;
  display: inline-block;
}

/* Стили для блока характеристик */
.redcoder-cartsattributes {
  color: #333;
  font-size: 14px;
  margin-top: 8px;
  margin-bottom: 25px;
  line-height: 1.5;
  width: 100%;
}

.product-attributes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.attribute-row {
  display: flex;
  width: 100%;
  position: relative;
  overflow: hidden;
  line-height: 1.2;
  padding: 2px 0;
}

.attribute-label {
  color: #666;
  font-weight: 500;
  padding-right: 5px;
  position: relative;
  z-index: 1;
  background: white;
}

.attribute-label::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: calc(100% + 5px);
  right: 5px;
  height: 1px;
  border-bottom: 2px dotted #ddd;
  z-index: 0;
  width: 800px;
}

.attribute-value {
  margin-left: auto;
  text-align: right;
  font-weight: 500;
  color: #333;
  padding-left: 15px;
  position: relative;
  z-index: 1;
  background: white;
}

/* Кнопки */
.cart-items-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: auto;
}

.cart-button {
  height: var(--button_height, 48px);
  border-radius: var(--button_border_radius, 8px);
  text-transform: var(--button_text_transform, none);
  border-width: var(--button_border_width, 1px);
  border-color: var(--button_border_color, transparent);
  padding: 0 20px;
  font-size: var(--button_font_size, 14px);
  font-weight: var(--button_font_weight, 500);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-align: center;
}

.cart-button-primary {
  background-color: var(--main_color, #4f46e5);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-button-primary:hover {
  background-color: var(--main_color_hover, #3c35b5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cart-button-secondary {
  background-color: white;
  color: #555;
  border: 1px solid #ddd;
}

.cart-button-secondary:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* Оверлей */
.theme-ajax-cart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999989;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  backdrop-filter: blur(2px);
}

.theme-ajax-cart-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Блокировка прокрутки */
body.modal-open {
  overflow: hidden;
}

/* Адаптивность */
@media (max-width: 768px) {
  .theme-ajax-cart-modal {
    max-width: 95%;
  }
  
  .theme-ajax-cart-modal-content {
    padding: 22px;
  }
  
  #cart-items-container-simple {
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }
  
  .redcoder-cartsimg {
    width: 150px;
    height: 150px;
  }
  
  .redcoder-cartsinfo {
    width: 100%;
  }
  
  .redcoder-cartsname {
    text-align: center;
	padding-right:0px;
	padding-left:0px;
    margin-bottom: 10px;
  }
  
  .redcoder-cartsprice {
    margin-bottom: 10px;
    text-align: center;
    align-self: center;
  }
  
  .redcoder-cartsattributes {
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .theme-ajax-cart-modal-content {
    padding: 18px;
  }
  
  .theme-ajax-cart-modal-close {
    top: 15px;
    right: 15px;
  }
  
  .redcoder-cartsimg {
    width: 120px;
    height: 120px;
  }
  
  .cart-items-buttons {
    grid-template-columns: 1fr;
  }
  
  .cart-button-primary {
    order: -1;
  }
}