/* --- VARIABLES --- */

.seller-product-form {
  --background-green-color: #16a34a;
}

/* --- CUSTOM STYLE CHO SELECT2 (đồng bộ với .modern-input) --- */
.seller-product-form .select2-container--default .select2-selection--single {
  background: #F9FAFB !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}

.seller-product-form .select2-container--default .select2-selection--single:focus,
.seller-product-form .select2-container--default .select2-selection--single:active {
  border-color: var(--background-green-color) !important;
  box-shadow: 0 0 0 2px rgba(22,163,74,0.15);
}

.seller-product-form .select2-container--default .select2-selection__rendered {
  color: #111827 !important;
  font-size: 14px !important;
  padding-left: 10px !important;
  line-height: 36px !important;
}

.seller-product-form .select2-container--default .select2-selection__arrow {
  height: 36px !important;
  right: 8px !important;
}

/* Dropdown menu */
.seller-product-form .select2-dropdown {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
}

.seller-product-form .select2-results__option {
  padding: 8px 12px !important;
  font-size: 14px !important;
}

.seller-product-form .select2-results__option--highlighted {
  background-color: #E2F3E8 !important;
  color: var(--background-green-color) !important;
}

.seller-product-form .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #6b7280 !important;
}

.seller-product-form .btn-create-product {
  background: var(--background-green-color);
  border:none;
  padding: 8px 22px;
  border-radius:6px;
  min-width:150px;
}

.seller-product-form .btn-success:hover {
  background-color: #15803d !important;
  box-shadow: 0 0 4px rgba(0,0,0,0.15);
  transition: all 0.2s;
  }

.seller-product-form .input-with-unit {
  position: relative;
  flex: 1;
}

.seller-product-form .input-with-unit .modern-input {
  padding-right: 38px; /* chừa chỗ cho đơn vị */
}

.seller-product-form .input-with-unit .unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 13px;
  pointer-events: none;
}

.seller-product-form .select2-container .select2-selection--single {
  outline: none !important;
  box-shadow: none !important;
}

/* ----- TOGGLE SWITCH STYLE ----- */
#quantity-display[readonly] {
  background-color: #d5d5d5 !important;
  color: #6b7280;
  font-style: italic;
}

.seller-product-form .toggle-wrapper {
  display: flex;
  align-items: center; /* căn giữa dọc giữa toggle và text */
  gap: 8px; /* khoảng cách giữa nút và chữ */
  margin-top: 8px;
}

.seller-product-form .toggle-label {
  font-size: 14px;
  color: #0f2e2e; /* cùng tone với các label khác */
}

.seller-product-form .switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.seller-product-form .switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}
.seller-product-form .switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 34px;
}

.seller-product-form .switch-slider::before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.seller-product-form .switch-input:checked + .switch-slider {
  background-color: var(--background-green-color);
}
.seller-product-form .switch-input:checked + .switch-slider::before {
  transform: translateX(22px);
}

/* ----- FORM INPUT STYLE ----- */
.seller-product-form .modern-input {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  padding: 7px 10px;
  transition: all 0.2s;
  background: #F9FAFB !important;
}

.seller-product-form .modern-input:focus {
  border-color: var(--background-green-color);
  box-shadow: 0 0 0 2px rgba(22,163,74,0.15);
}

/* ----- IMAGE PREVIEW STYLE (Mockup ENVIO) ----- */
.seller-product-form .preview-card {
  background:#fff;
  border-radius:10px;
  box-shadow:0 1px 3px rgba(0,0,0,0.08);
  padding:20px;
}

.seller-product-form .main-image-box { border:1px solid #eee; border-radius:8px; padding:10px; min-height:220px; position:relative; text-align:center; }

.seller-product-form .main-image-box img {
  max-width:200px;
  object-fit:contain;
}

.seller-product-form .btn-replace {
  position:absolute;
  right:15px;
  bottom:10px;
  border:none;
  background:#fff;
  border-radius:6px;
  box-shadow:0 0 3px rgba(0,0,0,0.15);
  font-size:12px;
  padding:4px 8px;
  cursor:pointer;
}

.seller-product-form .thumb-list {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  /* margin-top:12px; */
}

.seller-product-form .thumb-box {
  position: relative;
  width: 70px;
  height: 70px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.seller-product-form .thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-product-form .thumb-box button {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 16px;
  cursor: pointer;
}

.seller-product-form .thumb-add {
  border: 2px dashed #ccc;
  width: 70px;
  height: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  color: var(--background-green-color);
  cursor: pointer;
  font-size: 13px;
  flex-direction: column;
}

.seller-product-form .thumb-add:hover {
  background:#f3fdf6;
  border-color: var(--background-green-color);
}

/* ----- ANIMATION FADE ----- */
.seller-product-form .fade-update { animation: fadeHighlight 0.25s ease-in-out; }
@keyframes fadeHighlight {
  from { background-color: #eaffea; }
  to { background-color: transparent; }
}

.seller-product-form .thumb-box img:hover {
  border-color: #1d9bf0;
}

.seller-product-form .thumb-remove:hover {
  background: #f8f8f8;
  color: #333;
  border-color: #aaa;
}

.seller-product-form label[for="product-images-upload"]:hover {
  background: #f3f4f6;
  border-color: #4EA674;
  color: #4EA674;
}

/* Ô thêm ảnh */
.seller-product-form .upload-add-box{
  width:100px;
  height:80px;
  border:2px dashed #d1d5db;
  border-radius:8px;
  background:#fafafa;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all .2s ease-in-out;
  /* nếu đặt chung hàng với thumbnails thì thêm: */
  flex-shrink:0;
}

.seller-product-form .upload-add-box:hover{
  border-color:#22a05b;
  background:#f9fdfb;
}

/* Icon dấu + (SVG) */
.seller-product-form .upload-icon-svg{
  width:24px;
  height:24px;
  display:block;
  margin-bottom:8px;
}

/* Chữ “Thêm ảnh” */
.seller-product-form .upload-text{
  font-size: 14px;
  font-weight: 350;
  color:#22a05b;
  letter-spacing:.2px;
}
/* ========== THUMBNAILS + NÚT THÊM ẢNH ========== */
.seller-product-form .thumbnail-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.seller-product-form .thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.seller-product-form .upload-add-box {
  width: 100px;
  height: 80px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  flex-shrink: 0;
}

.seller-product-form .upload-add-box:hover {
  border-color: #22a05b;
  background: #f3fdf6;
}

.seller-product-form .upload-icon-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
}

.seller-product-form .upload-text {
  font-size: 13px;
  font-weight: 500;
  color: #22a05b;
}
.seller-product-form .tag-label {
  display: inline-block;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 2px 4px 2px 0;
  border: 1px solid #e5e7eb;
}
.seller-product-form .cke_toolbar,
.cke_toolgroup {
  display: inline-flex !important;
  align-items: center !important;
}

.seller-product-form .cke_toolbar_break {
  display: none !important; /* Ẩn các ngắt dòng trong toolbar */
}

.seller-product-form .cke_toolgroup a.cke_button {
  margin: 0 2px !important;
}

.seller-product-form .cke_top {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

/*===========CK EDITOR============== */

/* Giới hạn max-height để toolbar không bị bể */
.seller-product-form .cke_toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Giữ nội dung mô tả trong ô table */
#preview-desc {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
  padding: 8px;
}

/* Nếu nội dung có HTML block (p, h1-h6), reset margin để không đẩy bể layout */
#preview-desc h1,
#preview-desc h2,
#preview-desc h3,
#preview-desc h4,
#preview-desc h5,
#preview-desc h6,
#preview-desc p {
  margin: 0 0 6px 0;
  line-height: 1.4;
}

/* Giới hạn ảnh trong mô tả (nếu có) */
#preview-desc img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
