/* ============================================
   PERSONNALISATION TERRARIUM
   Styles dédiés au configurateur 12 étapes
   ============================================ */

/* --- Layout --- */
.perso-app-layout {
  display: grid;
  grid-template-columns: 280px 1fr 370px;
  min-height: 100vh;
}

/* --- Sidebar Navigation --- */
.perso-sidebar {
  background: var(--white, #FFFFFF);
  border-right: 1px solid var(--light-accent, #E8E4DF);
  padding: 32px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.perso-sidebar-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light-accent, #E8E4DF);
}

.perso-sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #2C2C2C);
  margin: 0;
}

.perso-sidebar-subtitle {
  font-size: 0.8rem;
  color: var(--gray-500, #9E9E9E);
  margin-top: 4px;
}

.perso-step-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perso-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.85rem;
  position: relative;
  color: var(--text, #2C2C2C);
}

.perso-step-item:hover { background: #F5F5F5; }

.perso-step-item.active { background: #E8F5E9; }
.perso-step-item.active .perso-step-num { background: #2E7D32; color: #fff; }
.perso-step-item.active .perso-step-title { color: #2E7D32; font-weight: 600; }

.perso-step-item.completed .perso-step-num { background: #81C784; color: #fff; }
.perso-step-item.completed .perso-step-title { color: #757575; }

.perso-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  background: #E0E0E0;
  color: #9E9E9E;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.perso-step-item.completed .perso-step-num::after {
  content: '✓';
  font-size: 0.75rem;
}
.perso-step-item.completed .perso-step-num span { display: none; }

.perso-step-info { flex: 1; min-width: 0; }
.perso-step-title { font-size: 0.85rem; font-weight: 500; color: #616161; transition: color 0.25s ease; }
.perso-step-desc { font-size: 0.7rem; color: #BDBDBD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Main Content --- */
.perso-main {
  padding: 40px 48px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.perso-header { margin-bottom: 36px; }
.perso-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text, #2C2C2C);
  margin: 0;
}
.perso-subtitle {
  font-size: 1rem;
  color: #9E9E9E;
  margin-top: 8px;
  line-height: 1.5;
}

.perso-step-container { animation: persoFadeUp 0.4s ease; }

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

.perso-section { margin-bottom: 40px; }
.perso-section-header { margin-bottom: 20px; }
.perso-section-header h3 { font-size: 1.3rem; font-weight: 600; color: var(--text, #2C2C2C); letter-spacing: -0.02em; margin: 0; }
.perso-section-desc { font-size: 0.9rem; color: #9E9E9E; margin-top: 4px; }

/* --- Cards --- */
.perso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.perso-grid.plants {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.perso-card {
  position: relative;
  background: var(--white, #FFFFFF);
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  overflow: hidden;
}

.perso-card:hover {
  border-color: #BDBDBD;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.perso-card.selected {
  border-color: #2E7D32;
  box-shadow: 0 0 0 1px #2E7D32, 0 4px 12px rgba(0,0,0,0.06);
}

.perso-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #2E7D32;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.perso-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.perso-card.out-of-stock::after {
  content: none;
}

.stock-badge-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(198, 40, 40, 0.85);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.perso-delivery-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.perso-card-img {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: #F5F5F5;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}

.perso-card-name { font-size: 0.85rem; font-weight: 600; color: var(--text, #2C2C2C); margin-bottom: 2px; }
.perso-card-detail { font-size: 0.7rem; color: #BDBDBD; line-height: 1.3; }
.perso-card-price { font-size: 0.85rem; font-weight: 600; color: #2E7D32; margin-top: 6px; }

.ambiance .perso-card-img { height: 120px; font-size: 2.5rem; }

/* Plants */
.perso-card.plant { padding: 12px; }
.perso-card.plant .perso-card-img { height: 90px; font-size: 1.8rem; }

.perso-qty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.perso-qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid #E0E0E0;
  background: var(--white, #FFFFFF);
  color: #616161;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  font-family: inherit;
}

.perso-qty-btn:hover {
  border-color: #2E7D32;
  color: #2E7D32;
  background: #E8F5E9;
}

.perso-qty-val {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Colors */
.perso-card.color .perso-card-img {
  height: 60px;
  border-radius: 50%;
  width: 60px;
  margin: 0 auto 12px;
}

/* Gift */
.perso-gift {
  background: var(--white, #FFFFFF);
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.25s ease;
}

.perso-gift.active { border-color: #2E7D32; }

.perso-gift-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.perso-gift-checkbox input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: #2E7D32;
  cursor: pointer;
}

.perso-gift-msg {
  margin-top: 16px;
  display: none;
}

.perso-gift-msg.show {
  display: block;
  animation: persoFadeUp 0.3s ease;
}

.perso-gift-msg textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.25s ease;
  background: var(--white, #FFFFFF);
}

.perso-gift-msg textarea:focus {
  outline: none;
  border-color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* Delivery */
.perso-delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.perso-delivery-card {
  background: var(--white, #FFFFFF);
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.perso-delivery-card:hover {
  border-color: #BDBDBD;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.perso-delivery-card.selected {
  border-color: #2E7D32;
  box-shadow: 0 0 0 1px #2E7D32;
}

.perso-delivery-icon { font-size: 2rem; margin-bottom: 8px; }
.perso-delivery-name { font-weight: 600; font-size: 0.95rem; }
.perso-delivery-price { font-size: 0.85rem; color: #2E7D32; font-weight: 600; margin-top: 4px; }

/* Nav Buttons */
.perso-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #E0E0E0;
}

.perso-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.perso-btn-prev {
  background: transparent;
  color: #757575;
}

.perso-btn-prev:hover {
  background: #F5F5F5;
  color: #2C2C2C;
}

.perso-btn-next {
  background: #2E7D32;
  color: var(--white, #FFFFFF);
}

.perso-btn-next:hover {
  background: #388E3C;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* --- Summary Panel --- */
.perso-summary {
  background: var(--white, #FFFFFF);
  border-left: 1px solid var(--light-accent, #E8E4DF);
  padding: 32px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.perso-summary-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.perso-preview-wrap {
  margin: 24px 0;
  background: #FAFAFA;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
}

.perso-preview-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.perso-preview-placeholder {
  text-align: center;
  color: #BDBDBD;
}

.perso-preview-placeholder svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.perso-preview-placeholder p {
  font-size: 0.85rem;
}

.perso-summary-details {
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid var(--light-accent, #E8E4DF);
  border-bottom: 1px solid var(--light-accent, #E8E4DF);
}

.perso-summary-details h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9E9E9E;
  margin-bottom: 12px;
}

.perso-summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perso-summary-list li {
  font-size: 0.85rem;
  color: #616161;
  display: flex;
  align-items: center;
  gap: 6px;
}

.perso-tag {
  background: #E8F5E9;
  color: #2E7D32;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.perso-empty {
  font-size: 0.85rem;
  color: #BDBDBD;
  font-style: italic;
}

.perso-pricing {
  margin: 20px 0;
}

.perso-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #757575;
  padding: 6px 0;
}

.perso-price-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #2C2C2C);
  border-top: 1px solid #E0E0E0;
  padding-top: 12px;
  margin-top: 6px;
}

.perso-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: #2E7D32;
  color: var(--white, #FFFFFF);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 10px;
}

.perso-btn-primary:hover {
  background: #388E3C;
  box-shadow: 0 8px 30px rgba(46,125,50,0.2);
  transform: translateY(-1px);
}

.perso-btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: #757575;
  border: 1.5px solid #E0E0E0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.perso-btn-save:hover {
  border-color: #BDBDBD;
  color: #424242;
  background: #F5F5F5;
}

/* --- Summary Toggle (mobile) --- */
.perso-summary-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: #2E7D32;
  color: var(--white, #FFFFFF);
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  align-items: center;
  gap: 6px;
}

.perso-summary-toggle:hover {
  background: #388E3C;
  transform: translateY(-2px);
}

/* --- Mobile --- */
.perso-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--white, #FFFFFF);
  border-bottom: 1px solid var(--light-accent, #E8E4DF);
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
}

.perso-mobile-menu-btn {
  background: none;
  border: none;
  color: #616161;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.perso-progress-track {
  flex: 1;
  height: 6px;
  background: #E0E0E0;
  border-radius: 3px;
  overflow: hidden;
}

.perso-progress-fill {
  height: 100%;
  background: #2E7D32;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.perso-progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9E9E9E;
  flex-shrink: 0;
}

.perso-sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #9E9E9E;
  cursor: pointer;
  padding: 4px;
}

.perso-overlay { display: none; }

/* --- Scrollbar --- */
.perso-sidebar::-webkit-scrollbar,
.perso-summary::-webkit-scrollbar { width: 4px; }
.perso-sidebar::-webkit-scrollbar-thumb,
.perso-summary::-webkit-scrollbar-thumb { background: #E0E0E0; border-radius: 2px; }

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1200px) {
  .perso-app-layout {
    grid-template-columns: 240px 1fr 320px;
  }
  .perso-main {
    padding: 32px 28px;
  }
  .perso-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 992px) {
  .perso-app-layout {
    grid-template-columns: 1fr;
  }

  .perso-sidebar { display: none; }
  .perso-sidebar.open {
    display: block;
    position: fixed;
    inset: 0;
    width: 300px;
    height: 100vh;
    z-index: 300;
    border-right: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    animation: persoSlideIn 0.3s ease;
  }

  @keyframes persoSlideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
  }

  .perso-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 299;
  }

  .perso-sidebar-close { display: block; }
  .perso-mobile-bar { display: flex; }

  .perso-summary {
    position: fixed;
    right: -100%;
    top: 0;
    width: 380px;
    height: 100vh;
    z-index: 250;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: none;
  }

  .perso-summary.open { right: 0; }
  .perso-summary-toggle { display: flex; }

  .perso-main {
    padding: 28px 20px;
    padding-bottom: 80px;
  }

  .perso-header h1 { font-size: 1.6rem; }
}

/* Mobile */
@media (max-width: 640px) {
  .perso-sidebar.open { width: 100%; }
  .perso-summary { width: 100%; }

  .perso-main {
    padding: 20px 16px;
    padding-bottom: 80px;
  }

  .perso-header h1 { font-size: 1.4rem; }
  .perso-subtitle { font-size: 0.9rem; }

  .perso-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .perso-grid.plants { grid-template-columns: repeat(2, 1fr); }
  .perso-delivery-grid { grid-template-columns: 1fr; }

  .perso-card { padding: 12px; }
  .perso-card-img { height: 80px; }
  .ambiance .perso-card-img { height: 100px; }

  .perso-actions {
    flex-direction: column;
    gap: 10px;
  }

  .perso-btn { width: 100%; justify-content: center; }
  .perso-header { margin-bottom: 24px; }
}
