/**
 * SIDE CART & CHECKOUT STYLES
 * Carrinho lateral e checkout responsivo
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

* {
  font-family: 'Poppins', sans-serif;
}

/* ============================================================================
   SIDE CART (Carrinho Lateral)
   ============================================================================ */
.side-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.side-cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-cart {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  overflow: hidden;
}

.side-cart.active {
  right: 0;
}

.side-cart-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #000;
  color: #fff;
  flex-shrink: 0;
}

.side-cart-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.side-cart-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: transform 0.2s;
}

.side-cart-close:hover {
  transform: rotate(90deg);
}

.side-cart-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  padding-bottom: 200px;
  -webkit-overflow-scrolling: touch;
}

.side-cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.side-cart-empty i {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.25;
  color: #ccc;
}

.side-cart-empty p {
  font-size: 15px;
  margin: 0;
  color: #999;
  font-weight: 500;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.cart-item:hover {
  background: #fafafa;
}

.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-weight: 600;
  font-size: 13px;
  margin: 0;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-details {
  font-size: 11px;
  color: #666;
  line-height: 1.3;
  margin: 0;
}

.cart-item-price {
  font-weight: 700;
  color: #077c22;
  font-size: 15px;
  margin-top: auto;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 2px;
  background: #fff;
}

.cart-item-quantity button {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s;
  padding: 0;
}

.cart-item-quantity button.decrease {
  color: #e74c3c;
}

.cart-item-quantity button.increase {
  color: #077c22;
}

.cart-item-quantity button:hover {
  background: #f5f5f5;
}

.cart-item-quantity button.decrease:hover {
  background: #fee;
}

.cart-item-quantity button.increase:hover {
  background: #f0f9f0;
}

.cart-item-quantity input {
  width: 30px;
  min-width: 30px;
  text-align: center;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  background: transparent;
  color: #333;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cart-item-remove:hover {
  background: #fee;
  transform: scale(1.05);
}

.side-cart-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #f0f0f0;
  padding: 18px 20px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.cart-summary {
  margin-bottom: 12px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.cart-summary-row:last-child {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 700;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid #e5e5e5;
}

.cart-summary-label {
  color: #666;
  font-weight: 500;
}

.cart-summary-value {
  color: #000;
  font-weight: 600;
}

.cart-summary-row:last-child .cart-summary-value {
  color: #077c22;
  font-size: 20px;
}

.cart-checkout-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #077c22 0%, #0a9d2e 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 16px rgba(7, 124, 34, 0.25), 0 0 0 0 rgba(7, 124, 34, 0);
  position: relative;
  overflow: hidden;
}

.cart-checkout-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cart-checkout-btn:hover::before {
  width: 400px;
  height: 400px;
}

.cart-checkout-btn:hover {
  background: linear-gradient(135deg, #055a18 0%, #077c22 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(7, 124, 34, 0.35), 0 0 20px rgba(7, 124, 34, 0.2);
}

.cart-checkout-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(7, 124, 34, 0.3);
}

.cart-checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Botão do carrinho no header */
.cart-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

/* Ajuste para página de produto - botão do carrinho acima do product-actions */
body:has(.product-actions) .cart-toggle {
  bottom: 80px;
  z-index: 9998;
}

.cart-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.cart-toggle .cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================================
   CHECKOUT PAGE
   ============================================================================ */
.checkout-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.checkout-header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

.checkout-header h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: #000;
}

.checkout-steps {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #999;
  font-size: 14px;
  transition: all 0.3s;
}

.checkout-step.active {
  background: #000;
  color: #fff;
}

.checkout-step.completed {
  background: #077c22;
  color: #fff;
}

.checkout-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.checkout-step.active .checkout-step-number,
.checkout-step.completed .checkout-step-number {
  background: rgba(255, 255, 255, 0.2);
}

.checkout-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  margin-bottom: 40px;
}

.checkout-form {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.checkout-form-section {
  margin-bottom: 30px;
}

.checkout-form-section:last-child {
  margin-bottom: 0;
}

.checkout-form-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #000;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.payment-methods {
  display: grid;
  gap: 15px;
}

.payment-method {
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 15px;
}

.payment-method:hover {
  border-color: #000;
}

.payment-method input[type="radio"] {
  width: auto;
  margin: 0;
}

.payment-method input[type="radio"]:checked + label {
  color: #000;
  font-weight: 600;
}

.payment-method label {
  flex: 1;
  cursor: pointer;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-method-icon {
  font-size: 24px;
}

.checkout-summary {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 25px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.checkout-summary h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #000;
}

.checkout-order-items {
  margin-bottom: 20px;
}

.checkout-order-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #e5e5e5;
}

.checkout-order-item:last-child {
  border-bottom: none;
}

.checkout-order-item-image {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
}

.checkout-order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkout-order-item-info {
  flex: 1;
  min-width: 0;
}

.checkout-order-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  color: #333;
}

.checkout-order-item-details {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.checkout-order-item-price {
  font-weight: 600;
  color: #000;
  font-size: 14px;
}

.checkout-totals {
  border-top: 2px solid #e5e5e5;
  padding-top: 20px;
  margin-top: 20px;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.checkout-total-row:last-child {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 700;
  padding-top: 10px;
  border-top: 2px solid #000;
  margin-top: 10px;
}

.checkout-total-label {
  color: #666;
}

.checkout-total-value {
  color: #000;
  font-weight: 600;
}

.checkout-submit-btn {
  width: 100%;
  padding: 16px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 20px;
}

.checkout-submit-btn:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.checkout-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  .side-cart {
    max-width: 100%;
  }

  .checkout-content {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .checkout-steps {
    flex-direction: column;
    align-items: stretch;
  }

  .checkout-step {
    justify-content: center;
  }

  .cart-toggle {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .side-cart-header {
    padding: 15px;
  }

  .side-cart-body {
    padding: 12px;
  }

  .side-cart-footer {
    padding: 15px;
  }
  
  .cart-item {
    padding: 10px;
    gap: 10px;
  }
  
  .cart-item-image {
    width: 55px;
    height: 55px;
    min-width: 55px;
  }
  
  .cart-item-name {
    font-size: 12px;
  }
  
  .cart-item-details {
    font-size: 10px;
  }
  
  .cart-item-price {
    font-size: 14px;
  }
  
  .cart-item-quantity button {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 12px;
  }
  
  .cart-item-quantity input {
    width: 28px;
    min-width: 28px;
    font-size: 12px;
  }
  
  .cart-item-remove {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
}

  .checkout-container {
    padding: 15px;
  }

  .checkout-form {
    padding: 20px;
  }

  .checkout-summary {
    padding: 20px;
  }
}

/* Animações */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.side-cart.active {
  animation: slideInRight 0.3s ease;
}

/* Loading state */
.cart-loading {
  text-align: center;
  padding: 40px 20px;
}

.cart-loading::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

