/* Variables CSS */
:root {
  --primary-color: #e63946;
  --primary-hover: #d62828;
  --secondary-color: #f1faee;
  --accent-color: #ffb703;
  --bg-light: #ffffff;
  --bg-beige: #fef9e7;
  --bg-card: #ffffff;
  --border-color: #e0e0e0;
  --border-hover: #e63946;
  --text-primary: #2b2d42;
  --text-secondary: #8d99ae;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-sm: 8px;
  --spacing: 24px;
}

/* Container principal */
.pizza-config-container {
  display: flex;
  gap: var(--spacing);
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing);
  flex-wrap: wrap;
}

/* Section principale */
.pizza-config-main {
  flex: 1 1 65%;
  min-width: 0;
}

/* Section de prévisualisation de la pizza */
.pizza-preview-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing);
  text-align: center;
}

.pizza-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--bg-beige);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

#pizza-canvas {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.pizza-preview-info h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.pizza-status {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
}

/* Navigation entre les étapes */
.pizza-steps-navigation {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: var(--spacing);
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.step-nav-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: var(--secondary-color);
}

.step-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-nav-btn.active {
  border-color: var(--primary-color);
  background: rgba(230, 57, 70, 0.1);
}

.step-nav-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}

.step-nav-btn:disabled .step-nav-number {
  background: var(--text-secondary);
}

.step-nav-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Étapes de configuration */
.pizza-steps {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

.pizza-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.4s ease;
}

.step-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.step-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
}

.step-back {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.step-back:hover {
  color: var(--primary-color);
}

.step-info {
  width: 100%;
  color: var(--text-secondary);
  font-size: 14px;
  margin: 8px 0 0 0;
}

/* Grille des options */
.pizza-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* Cartes d'options */
.pizza-option-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  background: var(--bg-light);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  position: relative;
}

.pizza-option-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.pizza-option-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.pizza-option-card:hover::before {
  transform: scaleX(1);
}

.pizza-option-card.selected {
  border-color: var(--primary-color);
  background: rgba(230, 57, 70, 0.05);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.pizza-option-card.selected::before {
  transform: scaleX(1);
}

.option-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.option-card-body img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.option-color-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.option-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.option-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  display: block;
  line-height: 1.4;
}

.option-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  display: block;
}

/* Récapitulatif */
.pizza-summary {
  flex: 0 1 32%;
  min-width: 300px;
  max-width: 400px;
}

.summary-card {
  position: sticky;
  top: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-color);
}

.summary-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.summary-content {
  margin-bottom: 20px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.summary-item:last-of-type {
  border-bottom: none;
}

.summary-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  flex: 1;
  margin-left: 12px;
}

.summary-condiments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  flex: 1;
  margin-left: 12px;
}

.condiment-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--secondary-color);
  color: var(--text-primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.total-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.total-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-order {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-order:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-order:active:not(:disabled) {
  transform: translateY(0);
}

.btn-order:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .pizza-config-main {
    flex: 1 1 60%;
  }
  
  .pizza-summary {
    flex: 0 1 35%;
  }
  
  .pizza-options-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 992px) {
  .pizza-config-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .pizza-config-main,
  .pizza-summary {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  .pizza-summary {
    order: -1;
  }
  
  .summary-card {
    position: relative;
    top: 0;
  }
  
  .pizza-options-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }
  
  .pizza-step {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .pizza-config-container {
    padding: 16px;
  }
  
  .pizza-preview-section {
    padding: 16px;
  }
  
  .pizza-canvas-wrapper {
    padding: 16px;
  }
  
  #pizza-canvas {
    width: 100%;
    max-width: 300px;
  }
  
  .pizza-step {
    padding: 16px;
  }
  
  .step-header h2 {
    font-size: 18px;
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .pizza-options-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .pizza-option-card {
    padding: 16px 12px;
    min-height: 160px;
  }
  
  .option-card-body img,
  .option-color-box {
    width: 60px;
    height: 60px;
  }
  
  .option-icon {
    width: 50px;
    height: 50px;
  }
  
  .summary-card {
    padding: 16px;
  }
  
  .total-price {
    font-size: 24px;
  }
  
  .btn-order {
    padding: 14px 20px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .pizza-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .pizza-option-card {
    padding: 12px 8px;
    min-height: 140px;
  }
  
  .option-card-body img,
  .option-color-box {
    width: 50px;
    height: 50px;
  }
  
  .option-icon {
    width: 40px;
    height: 40px;
  }
  
  .option-title {
    font-size: 13px;
  }
  
  .option-price {
    font-size: 12px;
  }
  
  .step-header h2 {
    font-size: 16px;
  }
  
  .summary-card h3 {
    font-size: 18px;
  }
}

