/* ============================================
   CARRINHO DE COMPRAS - IZI STYLE
   Página Completa do Carrinho - COM FRETE
   ============================================ */

/* --- CONTAINER PRINCIPAL --- */
.cart-page-container {
  min-height: 70vh;
  padding: 40px 0 80px;
  background-color: #fafafa;
}

.cart-page-container .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* --- BREADCRUMB --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  font-size: 0.9em;
  color: #666;
}

.breadcrumb a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.breadcrumb .separator {
  color: #ccc;
  margin: 0 5px;
}

.breadcrumb .current {
  color: var(--text-dark);
  font-weight: 600;
}

/* --- CABEÇALHO DA PÁGINA --- */
.cart-page-header {
  margin-bottom: 40px;
}

.cart-page-header h1 {
  font-size: 2.2em;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-page-header h1 i {
  color: var(--primary-color);
  font-size: 0.9em;
}

/* --- GRID PRINCIPAL (2 COLUNAS) --- */
.cart-main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  align-items: start;
}

/* ============================================
   SEÇÃO: LISTA DE PRODUTOS
   ============================================ */

.cart-items-section {
  background-color: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  min-height: 400px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- CARD DE PRODUTO NO CARRINHO (5 COLUNAS) --- */
.cart-item {
  display: grid;
  grid-template-columns: 130px 1fr 160px 130px 40px;
  gap: 20px;
  padding: 20px;
  background-color: #fafafa;
  border-radius: 12px;
  border: 1px solid #eee;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
  align-items: center;
}

.cart-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* COLUNA 1: WRAPPER DA IMAGEM */
.item-image-wrapper {
  width: 130px;
  height: 130px;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cart-item:hover .item-image {
  transform: scale(1.05);
}

/* COLUNA 2: DETALHES DO PRODUTO */
.item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.item-name {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 5px;
  line-height: 1.4;
}

.item-variant {
  font-size: 0.9em;
  color: #777;
  margin: 0;
}

.item-variant strong {
  color: var(--text-dark);
  font-weight: 600;
}

.item-price {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--primary-color);
  margin: 8px 0 0;
}

/* COLUNA 3: CONTROLES DE QUANTIDADE */
.item-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 5px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background-color: transparent;
  color: var(--text-dark);
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-btn:disabled:hover {
  background-color: transparent;
  color: var(--text-dark);
}

.qty-value {
  min-width: 35px;
  text-align: center;
  font-size: 1em;
  font-weight: 700;
  color: var(--text-dark);
}

/* COLUNA 4: SUBTOTAL DO ITEM */
.item-subtotal {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.subtotal-label {
  font-size: 0.85em;
  color: #777;
  display: block;
  margin: 0;
}

.subtotal-value {
  font-size: 1.3em;
  font-weight: 900;
  color: var(--text-dark);
  margin: 0;
}

/* COLUNA 5: BOTÃO REMOVER */
.btn-remove-item {
  width: 32px;
  height: 32px;
  border: none;
  background-color: #fee;
  color: #d32f2f;
  font-size: 1em;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}

.btn-remove-item:hover {
  background-color: #d32f2f;
  color: white;
  transform: rotate(90deg) scale(1.15);
}

.btn-remove-item:active {
  transform: rotate(90deg) scale(0.95);
}

/* ============================================
   SEÇÃO: CARRINHO VAZIO
   ============================================ */

.empty-cart-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 400px;
  width: 100%;
}

.empty-cart-message.hidden {
  display: none;
}

.empty-icon {
  width: 120px;
  height: 120px;
  background-color: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px auto;
}

.empty-icon i {
  font-size: 3.5em;
  color: #ccc;
}

.empty-cart-message h2 {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
}

.empty-cart-message p {
  font-size: 1.1em;
  color: #777;
  margin: 0 auto 30px auto;
  max-width: 400px;
  text-align: center;
}

/* ============================================
   SEÇÃO: RESUMO DO PEDIDO
   ============================================ */

.cart-summary-section {
  position: sticky;
  top: 100px;
}

.cart-summary-section.hidden {
  display: none;
}

.summary-card {
  background-color: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--primary-color);
}

.summary-title {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 25px;
  text-align: center;
}

/* Linhas do resumo */
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 1em;
  color: #555;
}

.summary-value {
  font-weight: 700;
  color: var(--text-dark);
}

.frete-info {
  font-size: 0.9em;
  color: #777;
  font-weight: 400;
}

/* Prazo de entrega */
.prazo-entrega {
  font-size: 0.9em;
  color: #666;
  padding: 8px 0;
}

.prazo-entrega i {
  color: var(--primary-color);
  margin-right: 5px;
}

/* Divisor */
.summary-divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 20px 0;
}

/* Total (destaque) */
.summary-total {
  padding: 15px 0;
  font-size: 1.2em;
  font-weight: 700;
}

.summary-total .total-value {
  font-size: 1.4em;
  color: var(--primary-color);
}

/* ============================================
   CALCULADORA DE FRETE - NOVO
   ============================================ */

.shipping-calculator {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #e9ecef;
}

.shipping-calculator label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-size: 0.95em;
}

.shipping-calculator label i {
  color: var(--primary-color);
  margin-right: 8px;
}

.cep-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.cep-input-group input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cep-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(247, 10, 49, 0.1);
}

.cep-input-group input::placeholder {
  color: #aaa;
}

.btn-calc-frete {
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn-calc-frete:hover {
  background-color: #c40827;
  transform: translateY(-1px);
}

.btn-calc-frete:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.link-busca-cep {
  display: inline-block;
  font-size: 0.85em;
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.link-busca-cep:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.link-busca-cep i {
  margin-right: 5px;
}

/* Resultado do frete */
.frete-resultado {
  margin-top: 15px;
  border-top: 1px solid #e0e0e0;
  padding-top: 15px;
}

.frete-opcao {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.frete-opcao:hover {
  border-color: var(--primary-color);
  background-color: #fff5f6;
}

.frete-opcao.selecionado {
  border-color: var(--primary-color);
  background-color: #fff5f6;
}

.frete-opcao input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--primary-color);
  width: 18px;
  height: 18px;
}

.frete-opcao-info {
  flex: 1;
}

.frete-opcao-nome {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.frete-opcao-prazo {
  font-size: 0.85em;
  color: #666;
}

.frete-opcao-valor {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1em;
}

/* Loading do frete */
.frete-loading {
  text-align: center;
  padding: 15px;
  color: #666;
  margin-top: 15px;
}

.frete-loading i {
  color: var(--primary-color);
  margin-right: 8px;
}

/* Erro do frete */
.frete-erro {
  margin-top: 15px;
  padding: 12px 15px;
  background-color: #fff5f6;
  border: 1px solid #f70a31;
  border-radius: 8px;
  color: #c40827;
  font-size: 0.9em;
  text-align: center;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn-large {
  width: 100%;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.btn-checkout {
  background-color: var(--primary-color);
  color: white;
  margin-top: 25px;
}

.btn-checkout:hover:not(:disabled) {
  background-color: #c40827;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 10, 49, 0.3);
}

.btn-checkout:disabled {
  background-color: #ccc;
  color: #888;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-continue {
  background-color: white;
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
}

.btn-continue:hover {
  background-color: #f5f5f5;
  transform: translateY(-2px);
}

/* Badges de pagamento */
.payment-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.payment-badges img {
  height: 25px;
  width: auto;
  opacity: 0.7;
  filter: grayscale(50%);
  transition: all 0.3s ease;
}

.payment-badges img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
  .cart-main-grid {
    grid-template-columns: 1fr 350px;
    gap: 30px;
  }

  .cart-item {
    grid-template-columns: 110px 1fr 140px 110px 38px;
    gap: 16px;
  }

  .item-image-wrapper {
    width: 110px;
    height: 110px;
  }
}

/* Mobile Grande */
@media (max-width: 768px) {
  .cart-page-container .container {
    padding: 0 20px;
  }

  .cart-main-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .cart-summary-section {
    position: static;
    order: -1;
  }

  .cart-page-header h1 {
    font-size: 1.8em;
  }

  .cart-items-section {
    padding: 20px;
  }

  .cart-item {
    grid-template-columns: 90px 1fr;
    gap: 12px;
    padding: 15px;
  }

  .item-image-wrapper {
    width: 90px;
    height: 90px;
  }

  .item-quantity-controls {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .item-subtotal {
    grid-column: 2;
    text-align: left;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
  }

  .btn-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .cep-input-group {
    flex-direction: column;
  }

  .btn-calc-frete {
    width: 100%;
  }
}

/* Mobile Pequeno */
@media (max-width: 480px) {
  .cart-page-container .container {
    padding: 0 15px;
  }

  .cart-page-header h1 {
    font-size: 1.5em;
    gap: 10px;
  }

  .breadcrumb {
    font-size: 0.85em;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }

  .item-image-wrapper {
    width: 80px;
    height: 80px;
  }

  .item-name {
    font-size: 1em;
  }

  .item-price {
    font-size: 1.1em;
  }

  .item-quantity-controls {
    gap: 8px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 1em;
  }

  .qty-value {
    min-width: 30px;
    font-size: 0.95em;
  }

  .summary-card {
    padding: 20px;
  }

  .summary-title {
    font-size: 1.3em;
  }

  .btn-large {
    font-size: 1em;
    padding: 14px 20px;
  }

  .empty-cart-message {
    padding: 40px 15px;
  }

  .empty-icon {
    width: 100px;
    height: 100px;
  }

  .empty-icon i {
    font-size: 3em;
  }

  .empty-cart-message h2 {
    font-size: 1.5em;
  }

  .empty-cart-message p {
    font-size: 1em;
  }

  .shipping-calculator {
    padding: 15px;
  }

  .frete-opcao {
    padding: 10px 12px;
  }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cart-item {
  animation: slideInFromRight 0.4s ease;
}

.cart-summary-section {
  animation: fadeIn 0.5s ease;
}

.cart-item.removing {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

.frete-resultado {
  animation: fadeIn 0.3s ease;
}
