/* ==========================================================================
   RODARCOL - Estilos de la Pestaña Pedidos & Checkout (css/pedidos.css)
   ========================================================================== */

.checkout-header-banner {
  background: var(--dark-bg);
  color: white;
  padding: 35px 0;
  border-bottom: 3px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.checkout-header-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(circle, rgba(229, 39, 39, 0.15) 0%, transparent 70%);
}

.checkout-banner-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
}

.checkout-banner-title span {
  color: var(--primary);
}

.checkout-main {
  padding: 40px 0 70px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Tarjetas de Sección */
.checkout-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.checkout-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.checkout-card-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.checkout-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Tabla del Carrito */
.cart-table-wrapper {
  overflow-x: auto;
}

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

.cart-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.cart-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item-img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.3;
}

.cart-item-ref {
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: monospace;
}

/* Controles de Cantidad */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}

.qty-btn {
  background: #f8fafc;
  border: none;
  width: 28px;
  height: 28px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.qty-btn:hover {
  background: var(--primary);
  color: white;
}

.qty-number {
  width: 32px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-remove-item:hover {
  background: #fef2f2;
}

/* Formulario del Cliente */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.erp-notice-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.erp-notice-badge svg {
  width: 18px;
  height: 18px;
  color: #16a34a;
  flex-shrink: 0;
}

/* Opciones de Envío y Pago */
.radio-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.radio-option-card:hover {
  border-color: var(--primary);
  background: #fff8f8;
}

.radio-option-card input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.radio-option-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.radio-option-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.radio-option-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.radio-option-price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
}

/* Resumen del Pedido (Sidebar Derecho) */
.order-summary-box {
  background: white;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 100px;
}

.summary-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.summary-line.total {
  font-size: 1.3rem;
  font-weight: 900;
  font-family: var(--font-heading);
  color: var(--text-main);
  border-top: 2px dashed var(--border-color);
  padding-top: 14px;
  margin-top: 14px;
}

.summary-line.total span:last-child {
  color: var(--primary);
}

.btn-submit-order {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 800;
}

/* Barra de Progreso de Envío de Pedido */
.order-progress-stepper {
  display: none;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 18px;
}

.order-progress-stepper.active {
  display: block;
}

.progress-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-step-item.done {
  color: var(--success);
  font-weight: 600;
}

.progress-step-item.active {
  color: var(--primary);
  font-weight: 700;
}

.progress-step-item.error {
  color: var(--danger);
  font-weight: 700;
}

.progress-step-icon {
  width: 16px;
  height: 16px;
}

/* Responsividad de Checkout */
@media (max-width: 992px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .order-summary-box {
    position: static;
  }
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
