.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: white;
  margin: 2rem auto;
  padding: 2rem;
  width: 90%;
  max-width: 800px;
  border-radius: 15px;
  position: relative;
  animation: modalOpen 0.3s ease-out;
}

@keyframes modalOpen {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary-color);
}

.image-upload-container {
  margin: 1rem 0;
}

.image-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.image-preview-wrapper {
  position: relative;
  width: 100%;
  height: 150px;
}

.remove-image-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background-color 0.3s;
}

.remove-image-btn:hover {
  background: red;
}

.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.new-category-group .image-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin-top: 10px;
  border: 2px solid var(--primary-color);
}

.new-category-group .image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#imageUpload {
  display: none;
}

#uploadBtn {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 1rem;
}

#productDetails {
  width: 100%;
  height: 150px;
  padding: 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  resize: vertical;
  margin-bottom: 1rem;
}

#saveProduct {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.5rem 2rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  float: right;
}

.modal-title {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.product-form-group {
  margin-bottom: 1rem;
}

.product-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.product-form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  font-size: 1rem;
}

.product-form-group select {
  width: 100%;
  padding: 0.7rem 0.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  font-size: 1rem;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1em;
  cursor: pointer;
}

.product-form-group select:hover {
  border-color: var(--secondary-color);
}

.product-form-group select:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
}

/* Estilos específicos para o dropdown de descontos */
#productDiscount {
  color: #333;
  font-weight: 400;
  background-color: #fff;
  text-indent: 5px;
}

/* Ajusta a aparência do texto nos navegadores modernos */
#productDiscount::selection {
  background-color: var(--primary-color);
  color: white;
}

#productDiscount option {
  padding: 10px 5px;
  background-color: #fff;
  color: #333;
}

#productDiscount option:first-child {
  font-style: italic;
  color: #777;
}

/* Ajuste para melhorar a visibilidade das opções */
#productDiscount option:hover,
#productDiscount option:focus,
#productDiscount option:active,
#productDiscount option:checked {
  background-color: var(--primary-color) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.product-form-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

#productDiscount {
  color: #333;
  font-weight: 400;
  background-color: #fff;
}

#productDiscount option {
  padding: 8px;
  background-color: #fff;
  color: #333;
}

#productDiscount option:first-child {
  font-style: italic;
  color: #777;
}

#productDiscount option:not(:first-child) {
  color: #333;
  font-weight: 500;
}

/* Correção para o problema de visualização do dropdown de descontos */
#productDiscount option:hover,
#productDiscount option:focus,
#productDiscount option:active,
#productDiscount option:checked {
  background-color: var(--primary-color);
  color: white;
}

/* Estilo para quando o dropdown está aberto */
#productDiscount:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.2);
}

.checkout-modal-content {
  background: linear-gradient(135deg, #E3D7CE, white);
  border-radius: 10px;
  padding: 2rem;
  max-width: 500px;
  margin: 5% auto;
  position: relative;
}

.checkout-modal h2 {
  color: #4a4a4a;
  text-align: center;
  margin-bottom: 1.5rem;
}

.checkout-form-group {
  margin-bottom: 1rem;
}

.checkout-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #4a4a4a;
  font-weight: bold;
}

.checkout-form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #E3D7CE;
  border-radius: 5px;
}

#checkoutNextBtn, #checkoutBackBtn, #sendWhatsAppBtn {
  background: #E3D7CE;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 5px;
  width: 100%;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.3s ease;
}

#checkoutNextBtn:hover, #checkoutBackBtn:hover, #sendWhatsAppBtn:hover {
  background: #d4c5a9;
}

#orderSummary {
  background: #fff;
  border: 1px solid #E3D7CE;
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

/* Estilos do Modal de Checkout */
.checkout-modal {
  max-width: 600px;
  background: #fff;
}

.checkout-progress {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  position: relative;
}

.checkout-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e0e0e0;
  transform: translateY(-50%);
  z-index: 1;
}

.step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #9d9d9d;
}

.step.active {
  color: #9d4edd;
}

.step.completed {
  color: #4CAF50;
}

.step-number {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.step.active .step-number {
  background: #9d4edd;
  color: white;
  border-color: #9d4edd;
}

.step.completed .step-number {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.step-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.checkout-step {
  padding: 1rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: #9d4edd;
  outline: none;
}

.phone-input-container {
  display: flex;
  gap: 0.5rem;
}

.phone-input {
  flex: 1;
}

.search-phone-btn {
  padding: 0 1rem;
  background: #9d4edd;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-phone-btn:hover {
  background: #7b2cbf;
}

.button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

.btn-cancel, .btn-back {
  padding: 0.8rem 1.5rem;
  border: 1px solid #9d4edd;
  background: white;
  color: #9d4edd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-next, .btn-confirm {
  padding: 0.8rem 1.5rem;
  background: #9d4edd;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-cancel:hover, .btn-back:hover {
  background: #f8f4ff;
}

.btn-next:hover, .btn-confirm:hover {
  background: #7b2cbf;
}

/* Estilos para o resumo do pedido */
.order-summary {
  background: #f8f4ff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.order-items {
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.order-item-details {
  display: flex;
  align-items: center;
  gap: 15px;
}

.order-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.order-item-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.order-item-name {
  font-weight: bold;
  color: #333;
}

.order-item-quantity,
.order-item-price {
  font-size: 0.9em;
  color: #666;
}

.order-item-subtotal {
  font-weight: bold;
  color: #9d4edd;
}

.order-totals {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 1.1em;
}

.total-row:last-child {
  border-top: 2px solid #ddd;
  margin-top: 8px;
  padding-top: 15px;
  font-weight: bold;
  color: #9d4edd;
}

.customer-info {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.customer-info h3 {
  color: #333;
  margin-bottom: 10px;
}

.customer-info p {
  margin: 5px 0;
  color: #666;
}

/* Estilos para a confirmação */
.confirmation-message {
  text-align: center;
  padding: 2rem 0;
}

.success-icon {
  color: #4CAF50;
  font-size: 4rem;
  margin-bottom: 1rem;
}

.btn-whatsapp {
  width: 100%;
  padding: 1rem;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 1rem;
}

.btn-whatsapp:hover {
  background: #128C7E;
}

.btn-conclude {
  width: 100%;
  padding: 1rem;
  background: #9d4edd;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-conclude:hover {
  background: #7b2cbf;
}

/* Estilos para elementos ocultos */
.hidden-step {
  display: none;
}

/* Estilos para elementos do checkout */
#step2, #step3 {
  display: none;
}

/* Estilos do carrinho */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: var(--beige-light);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 100vh;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, #e0e0e0, #ebd4a7, #d4c5a9);
  color: var(--text-color);
  position: relative;
  min-height: 60px;
}

.cart-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 600;
}

.close-cart {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--accent-color);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  right: -0.5rem;
}

.close-cart:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
  padding: 1rem 1rem 0.5rem;
  background-color: var(--background-color);
  max-height: calc(100vh - 130px);
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.8rem;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
  background-color: var(--beige-light);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.empty-cart {
  text-align: center;
  color: var(--text-color);
  margin-top: 2rem;
  font-style: italic;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
  display: block;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-quantity-btn {
  background: var(--beige-light);
  border: 1px solid var(--gray-medium);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.cart-quantity-btn:hover {
  background: var(--gray-medium);
  transform: scale(1.1);
}

.cart-quantity-btn:active {
  transform: scale(0.95);
}

.remove-item-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.remove-item-btn:hover {
  background: #cc0000;
  opacity: 1;
  transform: scale(1.1);
}

.cart-footer {
  padding: 0.8rem 1.5rem 0.8rem;
  margin-top: auto;
  border-top: 1px solid var(--gray-medium);
  background: var(--beige-light);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
}

.cart-total-amount {
  font-size: 1.1rem;
  color: var(--accent-color);
}

.checkout-btn {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(to right, #e0e0e0, #ebd4a7, #d4c5a9);
  color: var(--text-color);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.checkout-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
    max-width: 100%;
    background: var(--beige-light);
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: auto;
    z-index: 9000;
  }
  
  .cart-sidebar.active {
    right: 0;
    left: auto;
  }
  
  .cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    background-color: var(--background-color);
    padding: 0.8rem 0.8rem 0.5rem;
  }
  
  .cart-header {
    min-height: 56px;
    padding: 0.8rem 1rem;
    background: linear-gradient(to right, #e0e0e0, #ebd4a7, #d4c5a9);
    color: var(--text-color);
  }
  
  .cart-item {
    grid-template-columns: 50px 1fr;
    gap: 0.5rem;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background-color: var(--beige-light);
    border-radius: 8px;
  }
  
  .cart-item-quantity {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--gray-medium);
  }
  
  .cart-item-image {
    width: 50px;
    height: 50px;
  }
  
  .cart-item-name {
    font-size: 0.9rem;
    max-width: 200px;
  }
  
  .cart-item-price {
    font-size: 0.85rem;
  }
  
  .cart-footer {
    padding: 0.8rem 1rem 0.8rem;
    margin-top: auto;
  }
  
  .cart-total {
    font-size: 1rem;
    margin-bottom: 0.6rem;
  }
  
  .checkout-btn {
    padding: 0.7rem;
    font-size: 0.9rem;
    background: linear-gradient(to right, #e0e0e0, #ebd4a7, #d4c5a9);
    color: var(--text-color);
    margin-bottom: 0;
  }
  
  .cart-quantity-btn {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    background: var(--beige-light);
    border: 1px solid var(--gray-medium);
    color: var(--text-color);
  }
  
  .remove-item-btn {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    background: var(--accent-color);
    color: white;
  }
}

@media (max-width: 350px) {
  .cart-item-name {
    max-width: 150px;
  }
  
  .cart-quantity-btn {
    width: 22px;
    height: 22px;
    font-size: 0.8rem;
    background: var(--beige-light);
    border: 1px solid var(--gray-medium);
    color: var(--text-color);
  }
  
  .remove-item-btn {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .checkout-modal {
    margin: 0;
    min-height: 100vh;
    border-radius: 0;
  }

  .step-text {
    font-size: 0.8rem;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .modal-content {
    margin: 1rem auto;
    padding: 1rem;
    width: 95%;
  }
  
  .image-preview-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }
  
  .image-preview-wrapper {
    height: 120px;
  }
  
  .remove-image-btn {
    width: 20px;
    height: 20px;
    font-size: 16px;
  }
  
  .image-preview {
    height: 120px;
  }
  
  .product-form-group input,
  #productDetails {
    font-size: 16px; 
  }
  
  #saveProduct {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
  }
  
  .close {
    font-size: 1.5rem;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .modal-content {
    margin: 0.5rem auto;
    padding: 1rem;
  }
  
  .image-preview-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .image-preview-wrapper {
    height: 100px;
  }
  
  .image-preview {
    height: 100px;
  }
  
  .modal-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .product-form-group {
    margin-bottom: 0.75rem;
  }
}

@media (min-height: 800px) {
  .modal-content {
    margin: 5vh auto;
  }
}

.category-header {
  position: relative;
  margin: 2rem 0 1rem;
  text-align: center;
}

.category-header h2 {
  display: inline-block;
  padding: 0 15px;
  background: transparent;
  position: relative;
  z-index: 1;
  margin: 0;
  color: #333;
}

.category-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #ddd;
  z-index: 0;
}

.edit-category-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #9d4edd;
  cursor: pointer;
  padding: 5px;
  z-index: 1;
}