.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  /* display: none; */
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  max-width: 500px;
  width: 80%;
  max-height: 80vh; 
  display: flex;
  flex-direction: column;
}

.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 15px 0;
  overflow-y: auto; 
  flex: 1;
}

.thumbnails-grid img {
  width: 100%;
  height: auto;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 8px;
}

.thumbnails-grid img.selected {
  border: 2px solid #0077cc;
  /* border-color: #0077cc; */
}

.modal-actions {
  margin-top: auto; 
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.modal-actions button {
  background: #0077cc;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-actions button:hover {
  background: #005fa3;
}


#publish-back {
  position: absolute;
  top: 0;
  left: 1rem;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
}
#publish-back svg {
  width: 24px;
  height: 24px;
  stroke: #555;
}
#publish-section {
  height: 100vh;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  /* background-color: #f2f2f2; */
  background-color: white;
 display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}
#form-publish {
  display: flex;  
  flex-direction: column;
  min-height: 70vh;
  max-height: 90vh;
  
}

.form-body {
   display: flex;  
  flex-direction: column;
   gap: 1rem;               
  overflow-y: auto;     
  padding-right: 0.5rem; 
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 0.25rem;
  font-weight: 500;
}
#form-publish input[type="text"],
/* #form-publish input[type="number"], */
#form-publish select,
#form-publish textarea {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 1.8px solid #ccc;
  border-radius: 6px;
  background: white;
  box-sizing: border-box;
}
#form-publish textarea {
  min-height: 120px; 
resize: vertical;
}
.media-group input[type="file"] {
  display: none;
}
.media-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1.7px dashed #aaa;
  border-radius: 6px;
  cursor: pointer;
  color: #555;
}
.media-label svg {
  stroke: #555;
}
.btn-submit {
  bottom: 0;
  margin-top: 1rem; 
  width: 100%;
   padding: 1rem; 
   z-index: 10;
}
.btn {
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: #1d4ed8;
}
.btn-secondary {
  background: transparent;
  color: #555;
  padding: 0.5rem;
  text-align: left;
}

.publish-toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 16px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  font-size: 17px;
  opacity: 0;
  transition: opacity 0.5s, visibility 0.5s;
  transform: translateX(-50%);
}


.publish-toast.show {
  visibility: visible;
  opacity: 1;
}
.publish-toast.error {
  background-color: red;
}
.publish-toast.success {
  background-color: #2196f3;
}


.price-input-group {
 display: flex;
  align-items: stretch;
  width: 100%;
}
/*.price-input-group input[type="number"] {
  /* flex: 1; *
   border: 2px solid #ccc; 
  border-right: none;
   border-radius: 6px 0 0 6px;
  padding: 1rem;
  font-size: 1rem;
  background: #fff;
  box-sizing: border-box;
  outline: none; 
}*/
.price-input-group select {
  border: 2px solid #ccc;
  border-left: none; 
 border-radius: 0 6px 6px 0;
   padding: 1rem;
  font-size: 1rem;
  background: #f9f9f9;
  cursor: pointer;
}


#progressFill {
  transition: width 0.3s ease-in-out;
  width: 0%; height: 100%; background-color: #0077cc;
}

#progressContainer{
display:none; 
margin-top: 1rem;
}
#progressBar{
  height: 8px; background-color: #eee; border-radius: 4px; overflow: hidden;
}
#progressText{
  font-size: 0.9rem; margin-top: 0.5rem;
}

.third-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.third-bottom-sheet {
  display: none;
  position: fixed;
  left: 0;
  bottom: -100%;
  width: 100%;
  height: 60%; 
  background: #fff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0px -3px 10px rgba(0, 0, 0, 0.2);
  transition: bottom 0.3s ease;
  z-index: 10;
  overflow: hidden;
}
.third-bottom-sheet.show-mobile {
  bottom: 0;
  display: block;
}

.third-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #007bff;
  color: #fff;
}

.third-drag-handle {
  width: 40px;
  height: 5px;
  background-color: #fff;
  border-radius: 10px;
  cursor: grab;
  margin: 0 auto;
}
.third-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;        
  display: flex;         
  align-items: center;
  justify-content: center;
}

.third-close-btn svg {
  stroke: #fff;        
  width: 24px;
  height: 24px;
}

.third-sheet-content {
  padding: 20px;
}

.success-title {
  text-align: center;
   background: #e9fcf4;
   color: #60cea0; 
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.success-title svg,
.success-title span.emoji {
  font-size: 18px;
}
/*Bottom sheet*/
/*Modal thumbnail desktop*/
.third-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 90%;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0px 5px 20px rgba(0,0,0,0.3);
  z-index: 3010;
  padding: 20px;
}

.third-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.third-modal-content {
  margin-top: 1rem;
}

#third-overlay-desktop {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
}
/*Modal thumbnail desktop*/



@media (max-width: 600px) {
  #form-publish {
    height: auto;
    gap: 0.75rem;
  }
  #form-publish input,
  #form-publish select,
  #form-publish textarea,
  .media-label {
    padding: 0.6rem;
    font-size: 0.95rem;
  }
  .btn-submit {
    padding: 1rem;
    font-size: 1rem;
  }
}
@media (max-width: 720px) {
  #publish-section {
    padding: 3.5rem 1rem 1rem; 
    box-sizing: border-box;
  }
}
@media (min-width: 768px) {
  #form-publish input[type="text"],
#form-publish input[type="number"],
#form-publish select,
#form-publish textarea, .btn-submit, .media-label {
  width: 50%;
}




#form-publish {
  padding-top: 3.5rem
}

 .form-body {
    overflow: visible !important;
    flex: unset !important;
    padding-right: 0 !important;
  }

.btn-submit {
  margin-bottom: 1rem;  
}

#progressContainer{
display:none; 
margin-top: 1rem;
width: 50%;
}

.price-input-group { 
  width: 50%;
}

}
