.add-product-form {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: Arial, sans-serif;
}

.add-product-form form p {
    margin-bottom: 20px;
}

.add-product-form input[type="text"],
.add-product-form input[type="number"],
.add-product-form textarea,
.add-product-form select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.add-product-form input:focus,
.add-product-form textarea:focus,
.add-product-form select:focus {
    border-color: #00b894;
    outline: none;
}

.apf-file {
    margin-top: 10px;
    margin-bottom: 10px;
}

.add-product-form .checkbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.add-product-form .checkbox-tags label {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f3f3;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0px;
}

.apf-submit {
    width: 100%;
    background-color: #00b894;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}

.apf-submit:hover {
    background-color: #01856b;
}

.apf-submit:active {
    transform: scale(0.97);
}
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ccc;
    cursor: pointer;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn-new-product {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #ff6b6b;
    color: white;
    font-size: 16px;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.image-modal-new-product {
    display: none;
    position: fixed;
    z-index: 20000;
    inset: 0;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.image-modal-new-product.show {
    display: flex;
}

.modal-content-img-new-product {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
    margin: 0;
}

.close-modal-new-product {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20001;
}

.pin-block {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    margin-top: 10px;
}

.pin-label {
    margin: 0;
    padding: 0;
}

.pin-block input[type="checkbox"] {
    transform: scale(1.4);
    margin-right: 16px;
}

.close-modal-new-product:hover {
    color: #ff6b6b;
}

/* страница добавления товара с топбаром как у новостей */
.add-product-page{
  max-width: 760px;
  margin: 0 auto;
}

/* шапка */
.product-add-topbar{
  position: sticky;
  top: 0;
  z-index: 60;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.title-new-product {
    display: block;
}

.phone-privacy-field {
    margin-bottom: 20px;
}

.phone-input-wrap {
    position: relative;
}

.phone-input-wrap input[type="text"] {
    padding-right: 88px; /* место под глаз и вопросик */
}

.phone-input-actions {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.phone-privacy-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
}

.phone-privacy-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.eye-icon {
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #8b8b8b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.phone-privacy-toggle:hover .eye-icon {
    transform: scale(1.08);
}

.phone-privacy-help {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 15px 0;
    cursor: pointer;
    color: #8b8b8b;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-privacy-help:hover {
    color: #00b894;
}

.phone-privacy-toggle input:not(:checked) ~ .eye-open {
    display: flex;
}

.phone-privacy-toggle input:checked ~ .eye-closed {
    display: flex;
    color: #00b894;
}

@media screen and (max-width: 768px) {
    .add-product-form {
        max-width: 768px;
        margin: 0px auto;
        padding: 25px 30px 30px 30px;
        background-color: #fff;
        border-radius: 0px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        font-family: Arial, sans-serif;
    }
    .title-new-product {
        display: none;
    }
}

.category-picker-block {
  margin-bottom: 16px;
}

.category-picker-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
}

.category-picker-btn {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: .2s ease;
}

.category-picker-btn:hover {
  border-color: rgba(0,0,0,.18);
}

.category-picker-errors {
  margin-top: 8px;
  color: #d93025;
  font-size: 13px;
}

.category-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.category-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.category-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.category-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(680px, calc(100vw - 24px));
  max-height: min(80vh, 760px);
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.20);
  display: flex;
  flex-direction: column;
}

.category-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.category-modal__title {
  font-size: 18px;
  font-weight: 800;
}

.category-modal__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #f4f4f6;
  cursor: pointer;
  font-size: 18px;
}

.category-modal__body {
  padding: 14px 16px 18px;
  overflow-y: auto;
}

.category-group + .category-group {
  margin-top: 18px;
}

.category-group__title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #666;
}

.category-group__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-child-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}

.category-child-btn:hover {
  border-color: rgba(0,0,0,.18);
  transform: translateY(-1px);
}

.category-child-btn.is-active {
  border-color: #111;
  background: #f7f7f8;
}

body.category-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .category-modal__dialog {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 82vh;
    transform: none;
    border-radius: 22px 22px 0 0;
  }

  .category-group__items {
    grid-template-columns: 1fr;
  }
}

.category-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  visibility: hidden;
}

.category-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.category-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .24s ease;
}

.category-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(680px, calc(100vw - 24px));
  max-height: min(80vh, 760px);
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.20);
  display: flex;
  flex-direction: column;
  will-change: transform;
  backface-visibility: hidden;
}

.category-modal__dialog.is-dragging {
  transition: none !important;
  user-select: none;
}

@media (max-width: 640px) {
  .category-modal__dialog {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 82vh;
    transform: translateY(0);
    border-radius: 22px 22px 0 0;
  }

  .category-group__items {
    grid-template-columns: 1fr;
  }

  .category-picker-btn {
    border-radius: 8px;
  }
}

.category-modal__header {
  position: relative;
  padding-top: 22px;
}

.category-modal__grab {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.category-modal__search {
  padding: 12px 16px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.category-modal__search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.category-modal__search-box .fa-magnifying-glass {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: #8c8c8c;
  pointer-events: none;
}

.category-modal__search-input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  background: #fff;
  padding: 0 42px 0 40px;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.category-modal__search-input:focus {
  border-color: #00b894;
  box-shadow: 0 0 0 3px rgba(0,184,148,.10);
}

.category-modal__search-clear {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.category-modal__search-clear.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.category-modal__search-clear:hover {
  background: #f2f2f2;
  color: #333;
}

.category-modal__empty {
  padding: 32px 16px;
  text-align: center;
  color: #777;
}

.category-modal__empty i {
  font-size: 28px;
  margin-bottom: 10px;
  color: #b0b0b0;
}

.category-modal__empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}

.category-modal__empty-text {
  font-size: 14px;
}

.product-field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  color: #111;
}

.product-form-group {
  margin-bottom: 20px;
}

.product-description-wrap {
  position: relative;
}

.productLimitInfo {
  position: absolute;
  right: 0px;
  bottom: 5px;
  font-size: 12px;
  line-height: 1;
  color: #8a8a8a;
  padding: 4px 7px;
  border-radius: 999px;
  pointer-events: none;
}

.productLimitInfo.is-over {
  color: #d93025;
  font-weight: 700;
}

.description_product {
  min-height: 140px;
  padding-bottom: 34px !important;
  resize: vertical;
}

.description_product.is-over-limit {
  border-color: #d93025 !important;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.08);
}

.product-place-block {
    margin: 14px 0;
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.product-place-block__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.product-place-block__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.product-place-block__title i {
    color: #ef4444;
}

.product-place-block__hint {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.product-place-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-field-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #6b7280;
}

.product-region-select {
    cursor: pointer;
}

@media screen and (max-width: 640px) {
    .product-place-block {
        padding: 12px;
        border-radius: 14px;
    }

    .product-place-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .product-place-block__title {
        font-size: 14px;
    }
}

.dark-theme .product-place-block {
    background: #252525;
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .product-place-block__title {
    color: #f3f4f6;
}

.dark-theme .product-place-block__hint,
.dark-theme .product-field-hint {
    color: rgba(255, 255, 255, 0.55);
}

.region-native-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.region-picker-block {
  min-width: 0;
}

.region-picker-btn {
  width: 100%;
  justify-content: space-between;
}

#productRegionModal .category-child-btn {
  text-align: left;
}