/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
}

.cz-conf {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #FFFFFF;
  color: #000;
  padding: 40px 20px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.cz-conf *,
.cz-conf *::before,
.cz-conf *::after {
  box-sizing: border-box;
}

.cz-conf .container {
  max-width: 1520px;
  margin: 0 auto;
}

.cz-conf h1 {
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
  margin: 0 0 20px 0;
  color: #000000;
}

.cz-conf .main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 0;
  background: #F7F7F7;
  padding: 0 20px 0 20px;
  border-radius: 8px;
}

.cz-conf .product-image {
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-height: 520px;
  height: 520px;
  overflow: hidden;
}

.cz-conf .product-image img.cfg-main-image {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.cz-conf .product-image.without-frame {
  justify-content: center;
}

.cz-conf .product-image.without-frame img.cfg-main-image {
  max-width: 110%;
  max-height: 100%;
  transform: scale(1.03);
}

/* Спиннер загрузки */
.cz-conf .cfg-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.cz-conf .cfg-loader:after {
  content: "";
  width: 34px;
  height: 34px;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: #0064fc;
  border-radius: 50%;
  animation: cfg-spin 0.9s linear infinite;
}

.cz-conf .product-image.is-loading .cfg-loader {
  opacity: 1;
}

.cz-conf .product-image.is-loading img.cfg-main-image {
  opacity: 0.15;
}

@keyframes cfg-spin {
  to { transform: rotate(360deg); }
}

/* Первичный полноэкранный лоадер */
.cz-conf .cfg-initial-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(1px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.cz-conf .cfg-initial-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cz-conf .cfg-loader-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  padding: 18px 20px 14px;
  box-shadow: 0 12px 30px rgba(15, 26, 43, 0.12);
  display: grid;
  gap: 10px;
  min-width: 220px;
  text-align: center;
  align-items: center;
}

.cz-conf .cfg-loader-title {
  font-weight: 700;
  font-size: 16px;
  color: #101828;
  letter-spacing: 0.01em;
}

.cz-conf .cfg-loader-text {
  font-size: 12px;
  color: #4b5563;
}

.cz-conf .cfg-coffee-icon {
  position: relative;
  width: 96px;
  height: 80px;
  margin: 0 auto;
}

.cz-conf .cfg-coffee-steam {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 38px;
  pointer-events: none;
}

.cz-conf .cfg-coffee-steam span {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 24px;
  background: linear-gradient(180deg, rgba(0, 108, 255, 0.58) 0%, rgba(0, 108, 255, 0.0) 100%);
  border-radius: 12px;
  filter: blur(0.4px);
  animation: cfg-steam 1.8s ease-in-out infinite;
}

.cz-conf .cfg-coffee-steam span:nth-child(1) { left: 16px; animation-delay: 0s; }
.cz-conf .cfg-coffee-steam span:nth-child(2) { left: 32px; animation-delay: 0.25s; }
.cz-conf .cfg-coffee-steam span:nth-child(3) { left: 48px; animation-delay: 0.5s; }

.cz-conf .cfg-coffee-cup {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 44px;
  background: #ffffff;
  border: 3px solid #006cff;
  border-radius: 0 0 14px 14px;
  box-shadow: inset 0 -6px 0 rgba(0, 108, 255, 0.12);
}

.cz-conf .cfg-coffee-cup::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 8px;
  width: 18px;
  height: 22px;
  border: 3px solid #006cff;
  border-left: none;
  border-radius: 0 14px 14px 0;
}

.cz-conf .cfg-coffee-saucer {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 12px;
  background: rgba(0, 108, 255, 0.1);
  border-radius: 999px;
  filter: blur(0.4px);
}

@keyframes cfg-steam {
  0%   { transform: translateY(6px) scale(0.9); opacity: 0; }
  20%  { opacity: 1; }
  70%  { transform: translateY(-20px) scale(1); opacity: 0.85; }
  100% { transform: translateY(-32px) scale(1.05); opacity: 0; }
}

.cz-conf .cfg-bubbles {
  position: absolute;
  width: 260px;
  height: 220px;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -80%);
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.cz-conf .cfg-bubbles span {
  position: absolute;
  bottom: -20px;
  display: block;
  background: rgba(0, 108, 255, 0.28);
  border: 1px solid rgba(0, 108, 255, 0.36);
  border-radius: 50%;
  animation: cfg-bubble-rise 2.4s ease-out infinite;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.cz-conf .cfg-bubbles span:nth-child(1) { left: 22%; width: 26px; height: 26px; animation-delay: 0s; }
.cz-conf .cfg-bubbles span:nth-child(2) { left: 36%; width: 36px; height: 36px; animation-delay: 0.25s; }
.cz-conf .cfg-bubbles span:nth-child(3) { left: 48%; width: 24px; height: 24px; animation-delay: 0.55s; }
.cz-conf .cfg-bubbles span:nth-child(4) { left: 60%; width: 34px; height: 34px; animation-delay: 0.1s; }
.cz-conf .cfg-bubbles span:nth-child(5) { left: 72%; width: 40px; height: 40px; animation-delay: 0.45s; }
.cz-conf .cfg-bubbles span:nth-child(6) { left: 30%; width: 22px; height: 22px; animation-delay: 0.9s; }
.cz-conf .cfg-bubbles span:nth-child(7) { left: 50%; width: 30px; height: 30px; animation-delay: 1.2s; }
.cz-conf .cfg-bubbles span:nth-child(8) { left: 66%; width: 24px; height: 24px; animation-delay: 1.45s; }

@keyframes cfg-bubble-rise {
  0%   { transform: translateY(0) scale(0.85); opacity: 0; }
  10%  { opacity: 1; }
  60%  { transform: translateY(-90px) scale(1.05); opacity: 0.9; }
  100% { transform: translateY(-130px) scale(1.2); opacity: 0; }
}

.cz-conf .cfg-gallery {
  display: none !important;
}

.cz-conf .cfg-image-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cz-conf .cfg-zoom-lens {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 2px solid #0064fc;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  pointer-events: none;
  display: none;
  z-index: 4;
}

.cz-conf .cfg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #000;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.cz-conf .cfg-arrow:hover:not(:disabled):not(.disabled) {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 14px rgba(0,0,0,0.16);
}

.cz-conf .cfg-arrow:disabled,
.cz-conf .cfg-arrow.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.cz-conf .cfg-arrow-prev { left: 10px; }
.cz-conf .cfg-arrow-next { right: 10px; }

/* Спецификации */
.cz-conf .specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 18px;
}

.cz-conf .spec-block {
  padding-bottom: 0;
}

.cz-conf .spec-title {
  color: #999;
  font-size: 14px;
  text-transform: capitalize;
  margin-bottom: 8px;
}

.cz-conf .spec-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.cz-conf .spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cz-conf .spec-list li {
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.cz-conf .spec-list li:before {
  content: "• ";
  font-weight: bold;
  color: #000;
}

/* Конфигуратор */
.cz-conf .configurator-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
  margin-bottom: 30px;
  align-items: stretch;
}

.cz-conf .configurator {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 15px;
}

.cz-conf .config-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cz-conf .config-label {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  transition: color 0.2s ease;
}

.cz-conf .config-item:has(.config-select:disabled) .config-label,
.cz-conf .config-label.disabled-label {
  color: #b3b3b3 !important;
}

.cz-conf .config-select {
  appearance: none;
  width: 100%;
  height: 50px;
  padding: 0 45px 0 20px;
  cursor: pointer;
  outline: none;
  background-color: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #000;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 10px 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease-out;
}

.cz-conf .config-select:hover:not(:disabled) {
  border-color: #bdbdbd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.cz-conf .config-select:disabled {
  background-color: #FFFFFF;
  border-color: #e5e5e5;
  color: #b3b3b3;
  cursor: not-allowed;
}

/* Цены */
.cz-conf .price-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
  align-self: start;
  height: 100%;
}

.cz-conf .price-block {
  display: grid;
  grid-template-rows: 1fr auto;
  text-align: center;
}

.cz-conf .price {
  font-size: 44px;
  font-weight: 700;
  margin: 0;
  min-height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 26px;
  padding-bottom: 10px;
}

.cz-conf .price.cfg-price-left {
  color: #0066FF;
}

.cz-conf .price.cfg-price-right {
  color: #000;
}

.cz-conf .price-small {
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #666 !important;
}

/* Кнопки */
.cz-conf .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  width: 100%;
  text-decoration: none;
  height: 50px;
  align-self: end;
}

.cz-conf .btn-primary,
.cz-conf a.btn-primary {
  background-color: #0064fc;
  color: #ffffff !important;
}

.cz-conf .btn-primary:hover:not(:disabled):not(.disabled),
.cz-conf a.btn-primary:hover:not(:disabled):not(.disabled) {
  background-color: #0052d4;
  color: #ffffff !important;
}

.cz-conf .btn-primary:disabled,
.cz-conf .btn-primary[disabled],
.cz-conf .btn-primary.disabled,
.cz-conf a.btn-primary:disabled,
.cz-conf a.btn-primary[disabled],
.cz-conf a.btn-primary.disabled {
  background-color: #d3d3d3 !important;
  color: #ffffff !important;
  cursor: not-allowed !important;
  opacity: 0.7 !important;
  pointer-events: none !important;
  text-decoration: none !important;
}

.cz-conf a.btn-primary[disabled]:hover,
.cz-conf a.btn-primary[disabled]:focus,
.cz-conf a.btn-primary[disabled]:active,
.cz-conf a.btn-primary.disabled:hover,
.cz-conf a.btn-primary.disabled:focus,
.cz-conf a.btn-primary.disabled:active {
  color: #ffffff !important;
  background-color: #d3d3d3 !important;
}

.cz-conf .btn-secondary {
  background-color: #fff;
  color: #000;
  border: 2px solid #000;
}

.cz-conf .btn-secondary:hover {
  background-color: #000;
  color: #fff;
}

/* Адаптив для десктопа */
@media (min-width: 969px) {
  .cz-conf .configurator-wrapper {
    align-items: start;
  }

  .cz-conf .price-section {
    padding-top: 0;
  }

  .cz-conf .price-block {
    grid-template-rows: minmax(50px, 1fr) 50px;
    gap: 15px;
  }

  .cz-conf .price {
    padding-top: 10px;
    font-size: 32px;
  }

  .cz-conf .btn {
    height: 50px;
  }
}

/* Адаптив для мобильных */
@media (max-width: 968px) {
  .cz-conf .main-content {
    grid-template-columns: 1fr;
    padding: 0;
    background: transparent;
    margin-bottom: 10px;
  }

  .cz-conf .specs {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }

  .cz-conf .product-image {
    min-height: auto;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    background: #F7F7F7;
    border-radius: 8px;
  }

  .cz-conf .product-image img.cfg-main-image {
    width: auto;
    height: auto;
    max-width: 80%;
    max-height: 300px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
    transform: none;
  }

  /* С каркасом */
  .cz-conf .product-image.with-frame {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .cz-conf .product-image.with-frame img.cfg-main-image {
    max-width: 80%;
    max-height: 300px;
    transform: none;
  }

  /* Без каркаса — увеличенный размер */
  .cz-conf .product-image.without-frame {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .cz-conf .product-image.without-frame img.cfg-main-image {
    max-width: 70%;
    max-height: 280px;
    transform: scale(1.15);
  }

  .cz-conf .configurator-wrapper {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 15px;
  }

  .cz-conf .configurator {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .cz-conf .price-section {
    display: flex;
    gap: 10px;
  }

  .cz-conf .price-block {
    flex: 1;
  }

  .cz-conf .price {
    font-size: 24px;
    white-space: nowrap;
    padding-top: 8px;
    padding-bottom: 5px;
  }
}

/* Модальное окно */
.cfg-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.cfg-modal.is-open {
  display: flex;
}

.cfg-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.cfg-modal-content {
  position: relative;
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.cfg-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.cfg-modal-close:hover {
  color: #000;
}

.cfg-modal-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 24px 0;
  color: #000;
}

.cfg-form-group {
  margin-bottom: 20px;
}

.cfg-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #000;
}

.cfg-required {
  color: #ff0000;
}

.cfg-form-control {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  color: #000;
  transition: border-color 0.2s ease;
}

.cfg-form-control:focus {
  outline: none;
  border-color: #0064fc;
}

.cfg-checkbox-group {
  margin-bottom: 24px;
}

.cfg-checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 400;
}

.cfg-checkbox {
  margin-right: 10px;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.cfg-link {
  color: #0064fc;
  text-decoration: none;
}

.cfg-link:hover {
  text-decoration: underline;
}

.cfg-form-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 5px;
  font-size: 14px;
  text-align: center;
  display: none;
}

.cfg-form-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cfg-form-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
