/* =========================================================
   CARRINHO
========================================================= */

.cart-page {
  padding: 150px 8% 100px;
  background: #f7f3f2;
  min-height: 100vh;
  margin-top: 60px;
}

.cart-section {
  background: #ffffff;
  border: 1px solid #e7d0e6;
  border-radius: 24px;
  padding: 32px;
}

.cart-title {
  color: #4a4a4a;
  margin-bottom: 24px;
  font-size: 32px;
  font-weight: 500;
}

.cart-table-wrapper {
  overflow-x: auto;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.cart-table thead th {
  background: #f7f3f2;
  color: #b59ac9;
  text-align: left;
  padding: 14px 18px;
  font-size: 15px;
}

.cart-table tbody td {
  padding: 18px;
  border-bottom: 1px solid #e7d0e6;
  color: #5a5a5a;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-cell img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border: 1px solid #e7d0e6;
  border-radius: 12px;
  background: #ffffff;
  padding: 6px;
}

.product-name {
  font-weight: 600;
  color: #7a7a7a;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e7d0e6;
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #ffffff;
  color: #b59ac9;
  font-size: 18px;
  cursor: pointer;
}

.qty-btn:hover {
  background: #f7f3f2;
}

.qty-control .js-qty {
  min-width: 34px;
  text-align: center;
}

.qty-control .js-qty-input {
  width: 48px;
  height: 34px;
  border: none;
  text-align: center;
  color: #5a5a5a;
}

.qty-control .js-qty-input:focus {
  outline: none;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid #e7d0e6;
  background: #ffffff;
  color: #7a7a7a;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-soft:hover {
  background: #f7f3f2;
}

.cart-summary {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cart-summary p {
  color: #4a4a4a;
}

.cart-empty {
  text-align: center;
  color: #7a7a7a;
  padding: 26px !important;
}

.js-total {
  color: #b59ac9;
}

.btn-whatsapp {
  border: none;
  background: #b59ac9;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #9c7fb8;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transform: translateY(80px);
}

.modal.active {
  display: flex;
}

/* CAIXA DO MODAL */
.modal-content {
  max-width: 700px;
  margin: auto;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.modal-content input {
  padding: 10px;
  border: 1px solid #e7d0e6;
  border-radius: 8px;
}

.modal-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

#close-modal {
  position: absolute;
  top: 10px;
  right: 22px; 
  
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #D09494;
}

/* GRID DO FORM */
.modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* CAMPOS GRANDES ocupam tudo */
.modal-form .full {
  grid-column: 1 / -1;
}

.full label {
  color: #3D3D3D;
}

.full input {
  margin-top: 5px;
}

/* -- REMOVER PRODUTO --*/

/* Container da imagem */
.product-image-wrapper {
    position: relative;
    display: inline-block;
}

/* Botão remover */
.remove-item {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #f29aa3;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
    z-index: 5;
}

.remove-item:hover {
    transform: scale(1.08);
}

/* Mobile */
@media (max-width: 768px) {
    .remove-item {
        width: 22px;
        height: 22px;
        top: -6px;
        right: -6px;
        font-size: 15px;
    }
}

/* MOBILE */
@media (max-width: 600px) {
  .modal-form {
    grid-template-columns: 1fr;
  }
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .cart-page {
    padding: 120px 6% 70px;
  }

  .cart-section {
    padding: 18px;
  }

  .cart-title {
    font-size: 26px;
  }

  .cart-table {
    min-width: 100%;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tbody tr {
    display: block;
    border: 1px solid #e7d0e6;
    border-radius: 12px;
    margin-bottom: 14px;
    padding: 12px;
  }

  .cart-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: none;
    padding: 8px 0;
  }

  .cart-table tbody td::before {
    content: attr(data-label);
    color: #b59ac9;
    font-weight: 600;
  }

  .product-cell {
    flex-direction: row;
    justify-content: flex-start;
  }

  .product-cell::before {
    content: "";
  }

  .cart-actions {
    flex-direction: column;
  }

  .btn-soft,
  .btn-whatsapp {
    width: 100%;
  }
}
