/* v2025.11.27 */
/* Cart */
.modal {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.modal-content2 {
  background: white;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: absolute;
  width: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}
/*
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #495057;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
}
*/

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Step Tracker Container */
.step-tracker-container {
  /* Limit width for better readability 
   width: 100%;
   max-width: 400px; 
   */
  margin: 10px;
}

.more-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.more-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.list-item.selected .more-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.more-menu {
  position: relative;
  right: 0px;
  /* background: white; */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.more-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.more-menu button {
  width: 100%;
  /* padding: 12px 16px; */
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: #dc3545;
  font-size: 0.875rem;
  transition: background 0.3s ease;
}

.more-menu:hover {
  background: #f8f9fa;
}

/* Step Tracker List */
.step-tracker {
  display: flex;
  flex: 1 1;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative; /* Needed for absolute positioning of children */
  height: 100%;
}

/* Individual Step Item */
.step-item {
  position: relative;
  padding-left: 40px; /* Space for the circle marker */
  /*min-height: 100px;  Total height including connector space */
  box-sizing: border-box;

  .active-too {
    display: none;
  }
}

/* Remove bottom spacing for the last item */
.step-item:last-child {
  min-height: auto; /* Adjust height as it has no connector below */
  padding-bottom: 20px; /* Add some padding at the end */
}

/* Step Marker (Circle + Connector Container) */
.step-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px; /* Max width to accommodate active circle */
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer; /* Indicate clickability on the whole marker */
}

/* Step Circle */
.step-circle {
  width: 24px;
  height: 24px;
  background-color: #e0e0e0; /* Default background */
  border: 2px solid #b0b0b0; /* Default border */
  border-radius: 50%;
  position: relative; /* For centering checkmark */
  z-index: 2; /* Above the connector */
  display: flex;
  justify-content: center;
  align-items: center;
  /* cursor: pointer; /* Moved cursor to parent .step-marker */
  transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease,
    border-color 0.3s ease;
}

/* Step Connector Line */
.step-connector {
  width: 2px;
  /* Adjusted height calculation based on default circle size */
  height: calc(
    100% - 28px
  ); /* 100px min-height - (24px height + 2px border * 2) */
  background-color: #b0b0b0; /* Default color */
  position: relative;
  /* Adjust top position to align correctly below the default circle */
  top: 0;
  z-index: 1;
  transition: background-color 0.3s ease;
  /* Ensure connector starts below the circle */
  margin-top: 4px;
}

/* Hide connector for the last item */
.step-item:last-child .step-connector {
  display: none;
}

/* Step Content Area */
.step-content {
  /*padding-left: 20px;  Offset from the marker center */
  padding-top: 4px; /* Align roughly with circle center */
  padding-bottom: 20px; /* Space below content */
}

#step-headers {
  display: flex;

  .step-header {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563; /* text-gray-600 */
    transition: color 0.2s;
    position: relative;
  }

  .step-header:hover:not(.active-tab) {
    background-color: #e5e7eb; /* hover:bg-gray-200 */
  }

  .step-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    border-radius: 2px;
    transition: background-color 0.3s ease-in-out;
  }

  .active-tab {
    color: #111827; /* text-gray-900 */
  }

  .active-tab::after {
    background-color: #ffd700;
  }
}

/* Step Header */
.step-header {
  padding-left: 20px;
  font-weight: bold;
  font-size: 1.1rem; /* Slightly larger header */
  margin-bottom: 10px;
  color: #333;
}

/* Step Details (Form Content) */
.step-details {
  /*
  opacity: 0;
  visibility: hidden;
  max-height: 0; 
   Use max-height for transition */
  overflow: auto; /* Hide content when collapsed */
  transition: opacity 0.3s ease, visibility 0s linear 0.3s, max-height 0.3s ease; /* Delay visibility change */
  font-size: 0.875rem;
  color: #555;
}

.step-footer {
  padding: 8px;
}

.step-total {
  font-size: 1.2em;
  font-weight: bold;
  display: flex;
  /* justify-content: center;
  min-height: 39px;
   */
  align-items: center;
  position: relative;
}

.step-total div {
  position: absolute;
  right: 0;
}

/* Show details when .details-visible class is added */
.step-details.details-visible {
  opacity: 1;
  visibility: visible;
  max-height: 100%; /* Set a large enough max-height */
  transition: opacity 0.3s ease, visibility 0s linear 0s, max-height 0.3s ease;
}

/* --- Step States --- */

/* Active State */
.step-item.active .step-circle {
  width: 32px;
  height: 32px;
  background-color: #4a90e2; /* Blue background */
  border-color: #2a70c2; /* Darker blue border */
}

/* Connector adjustment when active (larger circle) */
.step-item.active .step-connector {
  /* Adjust height based on active circle size */
  height: calc(
    100% - 36px
  ); /* 100px min-height - (32px height + 2px border * 2) */
}

/*
.step-item.active.connector-active {
  .active-too {
    display: block;
  }
}*/

#step1Ctrl {
  /* Use flexbox to control the layout */
  display: flex;
  /* Center the items horizontally within the container */
  justify-content: center;
}

#saveCart {
  /* Position the button absolutely within its parent */
  position: absolute;
  left: 50%;
  /* This is a common hack to center an element without `transform`. */
  /* It's not the most modern approach, but it works without `transform`. */
  margin-left: -20px; /* Adjust this value if the button width changes */
  margin-top: -10px;
}

/* The second button is pushed to the far right */
#step1Ctrl button[data-c="app#sc2#b"] {
  /* The 'auto' margin on the left pushes this element as far left as possible,
               effectively aligning it to the right within the centered flex container. */
  margin-left: auto;
}

/* Active Connector Color (applied by JS to the item) */
.step-item.connector-active .step-connector {
  background-color: #4a90e2; /* Blue connector */
}

.step-item.active {
  display: flex;
  flex: 1 1;
}

/* Completed State */
.step-item.completed .step-circle {
  background-color: #28a745; /* Green background */
  border-color: #1e7e34; /* Darker green border */
  color: white; /* For the checkmark */
  /* Ensure size remains default when completed */
  width: 24px;
  height: 24px;
}

/* Completed Connector Color (applied by JS to the item) */
.step-item.connector-completed .step-connector {
  background-color: #28a745; /* Green connector */
}

/* Connector adjustment when completed (default circle size) */
.step-item.completed .step-connector {
  height: calc(100% - 28px); /* Back to default */
}

/* Checkmark SVG */
.step-circle svg {
  width: 16px;
  height: 16px;
  stroke: white;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
