/* WRAPPER */
.carandini-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* STEPS */
.cd-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.step {
  width: 36px;       /* Aumentado de 28px */
  height: 36px;      /* Aumentado de 28px */
  border-radius: 50%;
  background: #f2f2f2; /* Un gris más claro */
  color: #999;       /* Color de texto más suave */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;   /* Texto un poco más grande */
  font-weight: 500;
}

.step.active {
  background: #c40000;
  color: #fff;
}

.step.done {
  background: #5f5f5fc2;
  color: #e0e0e0;
}

.step-arrow {
  color: #bbb;
  font-size: 14px;
}

/* HEADER ROW */
.cd-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.cd-main-title {
  font-size: 32px;
  font-weight: 300;
}

.cd-main-title strong {
  font-weight: 700;
}

/* TOGGLE */
.cd-toggle {
  display: flex;
  border: 1px solid #c40000;
  border-radius: 30px;
  overflow: hidden;
}

.toggle-btn {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #c40000;
  cursor: pointer;
}

.toggle-btn.active {
  background: #c40000;
  color: #fff;
}

/* GRID */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* CARD BASE */
.cd-card {
  position: relative;
  height: 500px;      /* Aumentado de 280px para que sea alargado */
  border-radius: 4px; /* Bordes menos redondeados, más elegantes */
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Texto arriba a la izquierda */
  justify-content: flex-start;
  padding: 30px 25px;      /* Más margen interno */
  transition: transform 0.3s ease;
}

/* Overlay */
.cd-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1;
}

/* Text */
.card-title {
  position: relative;
  z-index: 2;
  font-size: 24px;    /* Título más grande */
  font-weight: 300;
  line-height: 1.1;
  text-transform: none;
}

.card-title strong {
  display: block;     /* Hace que la palabra en negrita baje a la siguiente línea */
  font-weight: 700;
}

/* Action button */
.card-action {
  position: absolute;
  bottom: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #c40000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* El texto "VER PRODUCTOS" oculto por defecto */
.action-text {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  opacity: 0;
  max-width: 0;
  transition: all 0.3s ease;
  margin-right: 0;
}

/* La flecha siempre visible */
.action-arrow {
  font-size: 18px;
  color: #fff;
}

/* EFECTO HOVER: Transformación a botón rojo */
.cd-card:hover .card-action {
  border-color: #c40000;
  padding: 0 10px;
  min-width: 280px; /* Se expande */
}

.cd-card:hover .action-text {
  opacity: 1;
  max-width: 800px;
  margin-right: 15px; /* Separa el texto de la flecha */
}

/* Ajuste opcional: oscurecer un poco más la imagen al hacer hover */
.cd-card:hover::before {
  background: rgba(0,0,0,0.6);
  transition: background 0.3s ease;
}

/* Efecto hover opcional para darle vida */
.cd-card:hover {
  transform: translateY(-5px);
}

/* BACKGROUNDS (ejemplo, luego irán imágenes reales) */
.cd-card.public {
  background: url('/img/public.jpg') center/cover no-repeat;
}

.cd-card.industrial {
  background: url('/img/industrial.jpg') center/cover no-repeat;
}

.cd-card.sport {
  background: url('/img/sport.jpg') center/cover no-repeat;
}

.cd-card.tunnel {
  background: url('/img/tunnel.jpg') center/cover no-repeat;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .cd-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cd-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

.cd-search-box {
  position: relative;
  border: 1px solid #c40000;
  border-radius: 20px;
  padding: 6px 35px 6px 15px;
}

.cd-search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 160px;
}

.cd-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #c40000;
  font-size: 14px;
}

.cd-product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px 25px;
}

.cd-product-card {
  cursor: pointer;
}

.cd-product-img {
  background: #8c8f92;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  margin-bottom: 15px;
}

.cd-product-cat {
  display: block;
  font-size: 11px;
  color: #c40000;
  margin-bottom: 3px;
}

.cd-product-name {
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

@media (max-width: 1200px) {
  .cd-product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .cd-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- ESTRUCTURA PRINCIPAL PASO 3 --- */
.cd-config-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}


/* COLUMNA IZQUIERDA: ACORDEÓN */
.cd-config-left {
  flex: 2;
}

.cd-section-title {
  font-size: 22px;
  margin-bottom: 25px;
  font-weight: 400;
}

/* Item del Acordeón */
.cd-accordion-item {
  background: #e9e9e9;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 15px;
  border: none;
  transition: background 0.2s ease;
}

.cd-accordion-item.active {
  background: #e3dfdc;
}

/* Cabecera del Item (Siempre visible) */
.cd-acc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px 0;
}

.cd-acc-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: #666;
}

.cd-acc-value {
  color: #c40000;
  font-size: 13px;
  font-weight: 500;
}

.cd-acc-arrow {
  font-size: 14px;
  color: #999;
  transition: transform 0.3s ease;
}

/* Estado ACTIVO (Abierto) */
.cd-accordion-item.active .cd-acc-arrow {
  transform: rotate(90deg);
}
.cd-accordion-item.active .cd-acc-header {
  border-bottom: 1px solid transparent; /* Opcional */
}

/* Cuerpo del Item (Oculto por defecto) */
.cd-acc-body {
  display: none;
  padding-top: 15px;
  padding-bottom: 25px;
}
.cd-accordion-item.active .cd-acc-body {
  display: block;
}

/* GRILLA DE OPCIONES (Dentro del acordeón) */
.cd-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.cd-option-card {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cd-option-card:hover {
  background: #efefef;
}

.cd-option-card.selected {
  background: #f8eaea;
  border: 1px solid #c40000;
}

.cd-opt-check {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #c40000;
  font-weight: bold;
}

.cd-option-card.selected .cd-opt-check { display: block; }

.cd-opt-title { font-weight: bold; margin-bottom: 5px; font-size: 14px; display: block;}
.cd-opt-desc { font-size: 12px; color: #777; line-height: 1.4; display: block; }

/* COLUMNA DERECHA: IMAGEN TÉCNICA */
.cd-config-right {
  background: #e3e3e3;
  border-radius: 20px;
  padding: 25px;
  position: sticky;
  top: 30px;
}

.cd-tech-image-box {
  background-color: #8c8f92;
  border-radius: 14px;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  margin-bottom: 20px;
}

.cd-specs-list {
  list-style: none;
  padding: 0;
  font-size: 13px;
  color: #666;
}

.cd-specs-list li {
  margin-bottom: 10px;
}

/* BARRA DE ACCIONES INFERIOR */
.cd-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.cd-actions-continue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}

.cd-btn-text {
  background: transparent;
  border: 1px solid #c40000;
  color: #c40000;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.cd-btn-text:hover {
  background: #c40000;
  color: #fff;
}

.cd-btn-primary {
  background: #c40000;
  color: #fff;
  border: none;
  padding: 14px 35px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cd-btn-primary:hover {
  background: #a30000;
}

.cd-btn-continue {
  background: #c40000;
  color: #fff;
  border: none;
  padding: 14px 35px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cd-btn-continue:hover {
  background: #a30000;
}

.cd-loader {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cd-loader.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cd-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e5e5;
  border-top: 4px solid #000;
  border-radius: 50%;
  animation: cd-spin 0.8s linear infinite;
}

.cd-grid-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.cd-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #ddd;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes cd-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 992px) {
  .cd-config-container {
    grid-template-columns: 1fr;
  }

  .cd-config-right {
    position: relative;
    top: auto;
  }
}

/* --- ESTRUCTURA ESPECÍFICA PASO 4 --- */
.cd-summary-container {
  display: flex;
  gap: 50px;
  align-items: flex-start;
}

/* COLUMNA IZQUIERDA: IMAGEN Y NAVEGACIÓN */
.cd-summary-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cd-preview-title {
  font-size: 14px;
  font-weight: bold;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.cd-generated-image {
  background-color: #f4f4f4;
  width: 100%;
  aspect-ratio: 4/3; /* Proporción rectangular */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-weight: bold;
  border: 1px solid #ddd;
}

/* Botones secundarios (Volver, Asistencia) */
.cd-secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.cd-btn-outline {
  border: 1px solid #333;
  background: transparent;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  color: #333;
}
.cd-btn-outline:hover { background: #333; color: #fff; }

/* COLUMNA DERECHA: DATOS Y ACCIONES FINALES */
.cd-summary-right {
  flex: 1.5;
}

.cd-product-title {
  font-size: 28px;
  margin: 0 0 20px 0;
  font-weight: 400;
}

.cd-product-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 30px;
}

/* Tabla de Datos Técnicos */
.cd-specs-table-title {
  font-size: 18px;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.cd-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Dos columnas */
  gap: 15px 30px;
  margin-bottom: 40px;
}

.cd-spec-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.cd-spec-label { font-weight: bold; font-size: 12px; color: #000; text-transform: uppercase; }
.cd-spec-value { font-size: 13px; color: #555; text-align: right; }

/* BLOQUE FINAL: PRECIO Y ACCIONES */
.cd-final-actions-box {
  background: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
}

.cd-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}
.cd-info-label { font-weight: bold; }
.cd-info-val { font-family: monospace; }

.cd-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 25px;
  align-items: center;
}

.cd-btn-dark {
  background: #000; color: #fff; border: none;
  padding: 12px 25px; font-weight: bold; cursor: pointer;
  border-radius: 25px; flex: 1; text-align: center;
  min-width: 150px;
}

.cd-link-action {
  color: #000; text-decoration: underline; font-weight: bold;
  cursor: pointer; font-size: 13px; margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .cd-summary-container { flex-direction: column; }
  .cd-specs-grid { grid-template-columns: 1fr; }
  .cd-buttons-row { flex-direction: column; align-items: stretch; }
}
