/* Popup tabeli rozmiarów — poza @layer (WooCommerce) */
@keyframes cw-size-guide-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body.cw-size-guide-open {
  overflow: hidden !important;
}

.cw-design-editor__modal.cw-design-editor__modal--size-guide:not([hidden]) {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 10050 !important;
  margin: 0 !important;
  padding: 0 !important;
  animation: cw-size-guide-fade-in 180ms ease-out !important;
}

.cw-design-editor__modal--size-guide .cw-design-editor__modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgb(0 0 0 / 45%) !important;
  backdrop-filter: blur(4px) !important;
}

.cw-design-editor__size-guide-dialog {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: 980px !important;
  border-radius: 24px !important;
  background: #fff !important;
  padding: 24px !important;
  box-shadow: 0 20px 40px rgb(0 0 0 / 15%) !important;
  text-align: left !important;
}

.cw-design-editor__modal-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 9999px !important;
  background: #f5f5f5 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: #0a0a0a !important;
  cursor: pointer !important;
}

.cw-design-editor__size-guide-title {
  margin: 0 48px 16px 0 !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #0a0a0a !important;
}

.cw-design-editor__size-guide-intro,
.cw-design-editor__size-guide-desc {
  margin: 0 0 8px !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: #262626 !important;
}

.cw-design-editor__size-guide-desc {
  margin-bottom: 16px !important;
}

.cw-design-editor__size-guide-grid {
  display: grid !important;
  align-items: end !important;
  gap: 24px !important;
}

.cw-design-editor__size-guide-image {
  display: block !important;
  width: 100% !important;
  max-width: 210px !important;
  height: auto !important;
  object-fit: contain !important;
}

.cw-design-editor__size-guide-legend {
  margin-top: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  color: #0a0a0a !important;
}

.cw-design-editor__size-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  text-align: left !important;
}

.cw-design-editor__size-table th {
  border-bottom: 1px solid #d4d4d4 !important;
  padding: 8px 12px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #0a0a0a !important;
}

.cw-design-editor__size-table td {
  padding: 8px 12px !important;
  font-size: 16px !important;
  color: #262626 !important;
}

.cw-design-editor__size-table tbody tr:nth-child(even) td {
  background: #f5f5f5 !important;
}

.cw-design-editor__size-guide-empty {
  margin: 0 !important;
  border: 1px dashed #d4d4d4 !important;
  border-radius: 12px !important;
  padding: 40px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #525252 !important;
  text-align: center !important;
}

@media (min-width: 901px) {
  .cw-design-editor__modal--size-guide:not([hidden]) {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }

  .cw-design-editor__size-guide-grid {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
}

@media (max-width: 900px) {
  .cw-design-editor__modal--size-guide:not([hidden]) {
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .cw-design-editor__size-guide-dialog {
    width: 100% !important;
    max-width: none !important;
    max-height: min(88dvh, calc(100dvh - 1rem)) !important;
    overflow: auto !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }

  .cw-design-editor__size-guide-title {
    margin-bottom: 12px !important;
    font-size: 20px !important;
  }

  .cw-design-editor__size-guide-intro,
  .cw-design-editor__size-guide-desc {
    font-size: 14px !important;
  }

  .cw-design-editor__size-guide-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .cw-design-editor__size-guide-image {
    max-width: 150px !important;
  }

  .cw-design-editor__size-guide-legend {
    font-size: 12px !important;
  }

  .cw-design-editor__size-table th,
  .cw-design-editor__size-table td {
    padding: 6px 8px !important;
    font-size: 14px !important;
  }
}
