/* Калькулятор стоимости - нижняя панель */
.cost-die {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgb(91, 72, 104);
  z-index: 100;
  opacity: 0;
  max-height: 1px;
  overflow: hidden;
  transform: translateY(80px);
  transition: 0.5s;
}

.cost-die.show {
  opacity: 1;
  max-height: 500px;
  overflow: visible;
  transform: translateY(0px);
}

.cost-die__wrapper {
  padding: 0;
}

.cost-die__main {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px 0;
  color: #fff;
  gap: 12px;
  min-height: 60px;
}

/* Элементы с прозрачными рамками */
.cost-die__item {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
}


.cost-die__image {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cost-die__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cost-die__info {
  display: flex;
  flex-direction: column;
  margin-right: 15px;
}

.cost-die__label {
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.cost-die__name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.cost-die__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.cost-die__price {
  font-size: 16px;
  font-weight: 600;
}

.cost-die__price-vat {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 2px;
}

.cost-die__options-add {
  font-size: 12px;
  color: #90EE90;
}

.cost-die__options-add:not(:empty)::before {
  content: "+";
  margin-right: 2px;
}

/* Блок Итого с прозрачной рамкой */
.cost-die__total {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
}

.cost-die__total-label {
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cost-die__total-price {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.cost-die__total-vat {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Кнопки */
.cost-die__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.cost-die__toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  height: 56px;
  box-sizing: border-box;
}

.cost-die__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.cost-die__toggle svg {
  transition: transform 0.3s;
}

.cost-die__toggle.active svg {
  transform: rotate(180deg);
}

/* Кнопка оформить в стиле сайта */
.cost-die__btn {
  background: rgb(136, 137, 255);
  color: #fff;
  padding: 0 25px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  white-space: nowrap;
  height: 56px;
  box-sizing: border-box;
}

.cost-die__btn:hover {
  background: rgb(81, 53, 100);
  color: #fff;
}

/* Детализация опций - прозрачные рамки */
.cost-die__details {
  background: rgb(91, 72, 104);
  padding: 20px 0;
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-die__details.active {
  display: block;
}

.cost-die__details-row {
  display: flex;
  gap: 20px;
}

/* Блоки опций с прозрачными рамками */
.cost-die__options {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 15px 20px;
  color: #fff;
}

.cost-die__options-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  display: block;
  opacity: 0.9;
}

.cost-die__options-list {
  margin-bottom: 15px;
  min-height: 40px;
}

.cost-die__options-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-style: italic;
}

.cost-die__option-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.cost-die__option-item:last-child {
  border-bottom: none;
}

.cost-die__option-name {
  color: rgba(255, 255, 255, 0.8);
}

.cost-die__option-price {
  color: #fff;
  font-weight: 500;
}

.cost-die__options-subtotal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.cost-die__options-subtotal-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.cost-die__options-vat {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  align-self: flex-end;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .cost-die__main {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .cost-die__item {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .cost-die__main {
    padding: 10px 0;
  }
  
  .cost-die__item {
    padding: 8px 12px;
  }
  
  .cost-die__image {
    width: 35px;
    height: 35px;
  }
  
  .cost-die__name {
    font-size: 12px;
  }
  
  .cost-die__price {
    font-size: 14px;
  }
  
  .cost-die__price-vat {
    font-size: 9px;
  }
  
  .cost-die__total-price {
    font-size: 20px;
  }
  
  .cost-die__toggle span {
    display: none;
  }
  
  .cost-die__btn {
    padding: 10px 15px;
    font-size: 12px;
  }
  
  .cost-die__details {
    padding: 15px 0;
  }
  
  .cost-die__details-row {
    flex-direction: column;
    gap: 15px;
  }
}

/* Мобильная адаптивность для маленьких экранов */
@media (max-width: 480px) {
  .cost-die.show {
    max-height: none;
  }
  
  .cost-die__main {
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }
  
  .cost-die__item {
    width: 100%;
    min-width: unset;
    flex: none;
    padding: 8px 12px;
    height: auto;
    min-height: 50px;
  }
  
  .cost-die__info {
    flex: 1;
    margin-right: 10px;
    min-width: 0;
  }
  
  .cost-die__name {
    white-space: normal;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.3;
  }
  
  .cost-die__prices {
    flex-shrink: 0;
  }
  
  .cost-die__total {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 50px;
    padding: 10px 12px;
  }
  
  .cost-die__total-label {
    margin-bottom: 0;
    margin-right: 10px;
  }
  
  .cost-die__total-price {
    font-size: 18px;
  }
  
  .cost-die__total-vat {
    margin-top: 0;
    margin-left: 8px;
  }
  
  .cost-die__actions {
    width: 100%;
    justify-content: stretch;
    margin-left: 0;
  }
  
  .cost-die__toggle {
    flex: 0 0 48px;
    padding: 0 12px;
    height: 48px;
  }
  
  .cost-die__btn {
    flex: 1;
    height: 48px;
  }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
  .cost-die__name {
    font-size: 12px;
  }
  
  .cost-die__price {
    font-size: 13px;
  }
  
  .cost-die__price-vat {
    font-size: 9px;
  }
  
  .cost-die__total-price {
    font-size: 16px;
  }
  
  .cost-die__total-vat {
    font-size: 9px;
  }
}

/* Состояние с развернутыми деталями */
.cost-die.expanded {
  max-height: 600px;
}

@media (max-width: 480px) {
  .cost-die.expanded {
    max-height: none;
  }
}

.cost-die.expanded .cost-die__toggle svg {
  transform: rotate(180deg);
}
