/* ========================================
   ESTILOS DO CARRINHO DE COMPRAS
   ======================================== */

/* Estilos gerais da tabela */
.cart-table {
  width: 100%;
  margin-bottom: 1rem;
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

@media (max-width: 768px) {
  /* Esconder a tabela padrão no mobile */
  .cart-table thead {
    display: none;
  }

  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table tr {
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #fff;
  }

  .cart-table td {
    text-align: left;
    padding: 0.35rem 0;
    border: none;
    position: relative;
  }

  /* Adicionar labels antes de cada campo */
  .cart-table td:not(:first-child)::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 0.1rem;
    color: #6c757d;
    font-size: 0.875rem;
  }

  /* Produto - primeira coluna */
  .cart-table td:first-child {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.4rem;
  }

  /* Ajustar o input de quantidade */
  .cart-table .input-group {
    width: 100% !important;
    max-width: 200px;
  }

  /* Espaçamento entre os campos */
  .cart-table td {
    margin-bottom: 0.2rem;
  }

  /* Botões de ação */
  .cart-table td:last-child {
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
    margin-top: 0.4rem;
  }

  .cart-table td:last-child .btn {
    width: 100%;
  }
}

/* Tablets em portrait */
@media (max-width: 991px) and (min-width: 769px) {
  .cart-table th,
  .cart-table td {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .cart-table img,
  .cart-table .bg-secondary {
    width: 50px !important;
    height: 50px !important;
  }

  .cart-table .input-group {
    width: 110px !important;
  }
}

/* ========================================
   RESUMO DO PEDIDO - RESPONSIVIDADE
   ======================================== */

@media (max-width: 767px) {
  /* Fazer o resumo aparecer abaixo da tabela */
  .col-md-4 {
    margin-top: 2rem;
  }

  /* Garantir espaçamento adequado */
  .card {
    margin-bottom: 1.5rem;
  }

  /* Botões do resumo */
  .card-body .btn {
    font-size: 1rem;
    padding: 0.75rem;
  }
}

/* Melhorias visuais gerais */
.cart-table .align-middle {
  vertical-align: middle;
}

.cart-table strong {
  font-weight: 600;
}

/* Hover nos botões mobile */
@media (max-width: 768px) {
  .cart-table .btn-danger:hover {
    transform: none;
  }
}

/* ========================================
   OPÇÕES DE FRETE
   ======================================== */

.shipping-option-item {
  transition: all 0.2s ease;
}

.shipping-option-item:hover {
  background-color: #f8f9fa !important;
  border-color: #0d6efd !important;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shipping-option-item.border-primary {
  border-width: 2px !important;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

/* ========================================
   INDICADOR DE FRETE GRÁTIS
   ======================================== */

#free-shipping-indicator .progress {
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

#free-shipping-indicator .progress-bar {
  transition: width 0.6s ease;
}

#free-shipping-badge {
  animation: slideDown 0.3s ease;
}

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