/* ========== HEADER CON CARRITO ========== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--primary) 0%, #c72c33 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 1rem 0;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h2 {
  color: white;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cart-icon {
  position: relative;
  background: white;
  color: var(--primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cart-icon:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cart-icon i {
  font-size: 1.5rem;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary);
  color: var(--text-primary);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

/* Ajustar banner para que no quede detrás del header */
.banner {
  margin-top: 70px;
}

/* ========== MODALES ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
  margin: 2rem auto;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.checkout-modal,
.confirmation-modal {
  max-width: 800px;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary), #c72c33);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.close-modal {
  font-size: 2rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ========== CARRITO VACÍO ========== */
.cart-empty {
  text-align: center;
  padding: 3rem 0;
  color: #999;
}

.cart-empty i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #ddd;
}

.cart-empty p {
  font-size: 1.2rem;
  color: #999;
}

/* ========== ITEMS DEL CARRITO ========== */
.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 2px solid #f0f0f0;
  transition: all 0.3s ease;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.cart-item:hover {
  background: #f8f9fa;
  transform: translateX(5px);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-item-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-item-price {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0f0f0;
  border-radius: 25px;
  padding: 0.3rem 0.8rem;
}

.quantity-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #c72c33;
  transform: scale(1.1);
}

.quantity-display {
  font-weight: 700;
  min-width: 25px;
  text-align: center;
}

.remove-item {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 1.3rem;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 50%;
}

.remove-item:hover {
  background: rgba(220, 53, 69, 0.1);
  transform: scale(1.2);
}

.cart-total {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

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

/* ========== BOTONES ========== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #c72c33);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: var(--border-r-buttom);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(237, 59, 67, 0.5);
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 20px 80px;
  border-radius: var(--border-r-buttom);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #218838);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: var(--border-r-buttom);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-success:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.5);
}

/* ========== CHECKOUT FORM ========== */
.prototype-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
  border-left: 4px solid #ffc107;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.prototype-warning i {
  font-size: 1.5rem;
  color: #ff9800;
}

.prototype-warning p {
  margin: 0;
  color: #856404;
  font-weight: 600;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  background: #f8f9fa;
  color: #666;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ========== MÉTODOS DE PAGO ========== */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-option {
  position: relative;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-option:hover {
  border-color: var(--primary);
  background: rgba(237, 59, 67, 0.05);
}

.payment-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(237, 59, 67, 0.1), rgba(255, 225, 25, 0.1));
}

.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.payment-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}

.payment-option i {
  font-size: 1.5rem;
  color: var(--primary);
}

.card-details {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1rem;
}

/* ========== RESUMEN DE PEDIDO ========== */
.order-summary {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 15px;
  margin-top: 2rem;
}

.order-summary h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.checkout-item:last-child {
  border-bottom: none;
}

.checkout-item-name {
  font-weight: 600;
  color: var(--text-primary);
}

.checkout-item-quantity {
  color: #666;
  margin-left: 10px;
}

.checkout-item-price {
  font-weight: 700;
  color: var(--primary);
}

.summary-totals {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #e0e0e0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.summary-row.total-row {
  font-size: 1.3rem;
  font-weight: 800;
  padding-top: 1rem;
  border-top: 2px solid var(--primary);
  margin-top: 0.5rem;
}

.free-shipping {
  color: #28a745;
  font-weight: 700;
}

/* ========== MODAL DE CONFIRMACIÓN ========== */
.confirmation-modal .modal-body {
  text-align: center;
  padding: 3rem 2rem;
}

.success-animation {
  margin-bottom: 2rem;
}

.checkmark-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  background: linear-gradient(135deg, #28a745, #218838);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.checkmark {
  width: 50px;
  height: 25px;
  border-left: 5px solid white;
  border-bottom: 5px solid white;
  transform: rotate(-45deg);
  animation: drawCheckmark 0.5s ease 0.3s both;
}

@keyframes drawCheckmark {
  from {
    width: 0;
    height: 0;
  }
  to {
    width: 50px;
    height: 25px;
  }
}

.confirmation-modal h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.order-number {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2rem;
}

.order-number span {
  color: var(--primary);
  font-weight: 700;
}

.prototype-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
  border: 2px solid #ffc107;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  margin-bottom: 2rem;
  font-weight: 700;
  color: #856404;
}

.prototype-badge i {
  font-size: 1.2rem;
}

.confirmation-details {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: left;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 5px;
}

.detail-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.detail-item p {
  margin: 0;
  color: #666;
}

.confirmation-message {
  margin: 2rem 0;
}

.confirmation-message p {
  color: #666;
  margin: 0.5rem 0;
}

/* ========== MODAL PERSONALIZAR PIZZA ========== */
.custom-pizza-modal {
  max-width: 900px;
}

.pizza-builder {
  padding: 1rem 0;
}

.builder-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f0f0f0;
}

.builder-section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(237, 59, 67, 0.3);
  flex-shrink: 0;
}

.section-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  margin-left: 50px;
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Selector de Tamaño */
.size-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.size-card {
  background: white;
  border: 3px solid #e0e0e0;
  border-radius: 15px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.size-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(237, 59, 67, 0.2);
}

.size-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(237, 59, 67, 0.1), rgba(255, 225, 25, 0.1));
  box-shadow: 0 10px 30px rgba(237, 59, 67, 0.3);
}

.size-card.selected::before {
  content: '\2713';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(237, 59, 67, 0.4);
}

.size-icon {
  margin-bottom: 1rem;
}

.size-icon i {
  font-size: 3rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.size-card:hover .size-icon i,
.size-card.selected .size-icon i {
  transform: scale(1.2) rotate(10deg);
}

.size-card h4 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

.size-card p {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.size-price {
  display: block;
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Selector de Masa */
.dough-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.dough-card {
  background: white;
  border: 3px solid #e0e0e0;
  border-radius: 15px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.dough-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(237, 59, 67, 0.2);
}

.dough-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(237, 59, 67, 0.1), rgba(255, 225, 25, 0.1));
}

.dough-card.selected::before {
  content: '\2713';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(237, 59, 67, 0.4);
}

.dough-card > i {
  font-size: 2.5rem;
  color: var(--primary);
  display: block;
  margin-bottom: 1rem;
}

.dough-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

.dough-card p {
  color: #666;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.dough-price {
  display: block;
  margin-top: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Selector de Ingredientes */
.ingredients-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.ingredient-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.ingredient-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(237, 59, 67, 0.15);
}

.ingredient-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(237, 59, 67, 0.1), rgba(255, 225, 25, 0.1));
}

.ingredient-card.selected::before {
  content: '\2713';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 25px;
  height: 25px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 3px 10px rgba(237, 59, 67, 0.4);
}

.ingredient-card > i {
  font-size: 2rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.8rem;
}

.ingredient-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

.ingredient-price {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.5rem;
}

/* Resumen de la Pizza */
.pizza-summary {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 2px solid var(--primary);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 2rem;
}

.pizza-summary h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pizza-summary h3::before {
  content: '🍕';
  font-size: 1.8rem;
}

.summary-details {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  background: white;
  border-radius: 10px;
  margin-bottom: 0.8rem;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-item i {
  font-size: 1.2rem;
  color: var(--primary);
  width: 25px;
  text-align: center;
}

.summary-item span {
  flex: 1;
  color: var(--text-primary);
  font-weight: 600;
}

.price-breakdown {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  font-size: 1rem;
  color: #666;
}

.price-row.total {
  border-top: 3px solid var(--primary);
  margin-top: 1rem;
  padding-top: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.price-row.total span:last-child {
  color: var(--primary);
  text-shadow: 0 2px 10px rgba(237, 59, 67, 0.2);
}

#addCustomPizza:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#addCustomPizza:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-footer {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-image {
    width: 100%;
    height: 150px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .cart-total {
    font-size: 1.2rem;
  }

  .confirmation-modal h2 {
    font-size: 1.5rem;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .logo h2 {
    font-size: 1.4rem;
  }

  .cart-icon {
    width: 45px;
    height: 45px;
  }

  .cart-icon i {
    font-size: 1.3rem;
  }

  .modal-header {
    padding: 1rem 1.5rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .checkout-modal,
  .confirmation-modal,
  .custom-pizza-modal {
    max-width: 95%;
  }

  .size-selector,
  .dough-selector {
    grid-template-columns: 1fr;
  }

  .ingredients-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .pizza-summary {
    padding: 1.5rem;
  }
}
