/**
 * Quote Wizard Shared Styles - FIXED VERSION
 * Upload this file to Power Pages and reference it in all wizard pages
 * 
 * To upload:
 * 1. Go to Power Pages Studio
 * 2. Navigate to "Web files" or "Web templates"
 * 3. Upload this CSS file
 * 4. Reference in your pages with: <link rel="stylesheet" href="/quote-wizard-styles.css">
 */

/* === Quote Wizard Container === */
.quote-wizard {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 40px;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  font-family: inherit;
}

@media (max-width: 768px) {
  .quote-wizard {
    margin: 20px;
    padding: 20px;
  }
}

/* === Wizard Header / Steps === */
.wizard-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 60px;
  position: relative;
  gap: 0;
  border-bottom: 1px solid #f0f0f0;
}

.wizard-header::before {
  display: none;
}

.step {
  flex: 1;
  text-align: center;
  padding: 20px;
  background: none;
  border-radius: 0;
  position: relative;
  z-index: 1;
  color: #999;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  border: none;
  border-bottom: 3px solid transparent;
}

.step.active {
  background: none;
  color: #000;
  font-weight: 800;
  border-color: #000;
  box-shadow: none;
}

.step.completed {
  background: none;
  color: #000;
  border-color: #000;
}

.step.completed[onclick]:hover {
  background: #f9f9f9;
  transform: none;
  box-shadow: none;
  cursor: pointer;
}

.step.completed::after {
  content: '';
  margin-left: 0;
}

/* === Page Title === */
.wizard-title {
  margin-bottom: 50px;
  text-align: left;
  border-left: 3px solid #000;
  padding-left: 30px;
}

.wizard-title h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.wizard-title .subtitle {
  font-size: 1.2rem;
  color: #444;
  margin: 0;
}

/* === Form Sections === */
.form-section {
  margin-bottom: 50px;
  padding: 0;
  border-bottom: none;
}

.form-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #000;
  margin: 0 0 25px 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.form-section h2::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: #eee;
}

.section-description {
  color: #666;
  font-size: 0.95rem;
  margin: -15px 0 30px 0;
}

/* === Form Groups === */
.form-group {
  margin-bottom: 35px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100% !important;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid #e0e0e0;
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: transparent;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-bottom-color: #000;
  box-shadow: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a19f9d;
  opacity: 1;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background: #f3f2f1;
  color: #a19f9d;
  cursor: not-allowed;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.help-text {
  display: block;
  font-size: 12px;
  color: #605e5c;
  margin-top: 6px;
}

.required {
  color: #d13438;
}

.optional {
  color: #999;
  font-weight: normal;
  font-size: 13px;
}

/* === Validation Styles === */
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #d13438;
}

.form-group input:valid:not(:focus):not(:placeholder-shown),
.form-group textarea:valid:not(:focus):not(:placeholder-shown) {
  border-color: #107c10;
}

.error-message {
  color: #d13438;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.form-group.error .error-message {
  display: block;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
  border-color: #d13438;
  background-color: #fff5f5;
}

/* === Radio Cards === */
.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 25px;
}

.radio-card {
  position: relative;
  border: 1px solid #eee;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-content {
  border: 1px solid #eee;
  border-radius: 0;
  padding: 30px;
  background: white;
  transition: all 0.3s ease;
  color: #000;
}

.radio-card:hover .radio-content {
  border-color: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.radio-card input[type="radio"]:checked ~ .radio-content {
  border-color: #000;
  background: #fff;
  box-shadow: none;
}

.radio-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.radio-header strong {
  font-weight: 800;
}

.radio-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
}

.radio-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.radio-details li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: #333;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.radio-details li::before {
  content: "•";
  color: #000;
  font-weight: bold;
}

/* === Step 1 Delivery Cards With Photo Backgrounds === */
.radio-card.radio-card-with-bg {
  overflow: hidden;
  min-height: 340px;
  background-color: #0f1720;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.radio-card.radio-card-with-bg .radio-content {
  position: relative;
  z-index: 1;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  border-color: rgba(255, 255, 255, 0.38);
  background: linear-gradient(165deg, rgba(7, 12, 18, 0.16) 0%, rgba(7, 12, 18, 0.42) 56%, rgba(7, 12, 18, 0.58) 100%);
}

.radio-card.radio-card-with-bg .radio-content::after {
  content: 'Selected';
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #062300;
  background: #76f200;
  border: 1px solid rgba(255, 255, 255, 0.55);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.radio-card.radio-card-with-bg .radio-header,
.radio-card.radio-card-with-bg .radio-details li,
.radio-card.radio-card-with-bg .radio-details li::before {
  color: #ffffff;
}

.radio-card.radio-card-with-bg .radio-header,
.radio-card.radio-card-with-bg .radio-details {
  width: min(82%, 470px);
  margin-left: 0;
  margin-right: auto;
  align-self: flex-start;
}

.radio-card.radio-card-with-bg .radio-details li {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.radio-card.radio-card-with-bg .radio-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.radio-card.radio-card-with-bg:hover .radio-content {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.radio-card.radio-card-with-bg input[type="radio"]:checked ~ .radio-content {
  border-color: #76f200;
  background: linear-gradient(165deg, rgba(7, 12, 18, 0.14) 0%, rgba(7, 12, 18, 0.36) 56%, rgba(7, 12, 18, 0.52) 100%);
  box-shadow: inset 0 0 0 1px rgba(118, 242, 0, 0.45), 0 0 0 2px rgba(118, 242, 0, 0.6), 0 14px 30px rgba(0, 0, 0, 0.32);
}

.radio-card.radio-card-with-bg input[type="radio"]:checked ~ .radio-content::after {
  opacity: 1;
  transform: translateY(0);
}

.radio-card.radio-card-localhub {
  background-image: url('/localhub-delivery-bg.jpg');
}

.radio-card.radio-card-production {
  background-image: url('/production-shipping-bg.jpg');
}

@media (max-width: 768px) {
  .radio-card.radio-card-with-bg,
  .radio-card.radio-card-with-bg .radio-content {
    min-height: 280px;
  }

  .radio-card.radio-card-with-bg .radio-header,
  .radio-card.radio-card-with-bg .radio-details {
    width: 100%;
    margin-left: 0;
  }
}

/* === Simple Radio Buttons === */
.radio-simple-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.radio-simple {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 0;
  transition: all 0.2s ease;
}

.radio-simple:hover {
  background: #fafafa;
  border-color: #000;
}

.radio-simple input[type="radio"] {
  margin-right: 15px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 0;
  background: white;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* === Customer Info Grid === */
.customer-info {
  background: #fff;
  padding: 40px;
  border-radius: 0;
  border: 1px solid #eee;
  margin-top: 20px;
}

.info-grid {
  /*display: grid;*/
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item strong {
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item span {
  font-size: 15px;
  color: #323130;
}

/* === Step 3: Review Summary Grid === */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 25px;
}

.summary-card {
  background: #fff;
  padding: 30px;
  border-radius: 0;
  border: 1px solid #eee;
}

.summary-card h3 {
  font-size: 14px;
  font-weight: 800;
  color: #000;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.address-display {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}

.address-display strong {
  color: #000;
  font-weight: 700;
}

/* === Quote Lines Table (Step 3) === */
#quoteLinesContainer {
  overflow-x: auto;
  margin-top: 25px;
  -webkit-overflow-scrolling: touch;
}

.quote-lines-container {
  overflow-x: auto;
  margin-top: 25px;
  -webkit-overflow-scrolling: touch;
}

.quote-lines-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #eee;
}

.quote-lines-table thead {
  background: #000;
}

.quote-lines-table th {
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
}

.quote-lines-table td {
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  color: #333;
  font-size: 14px;
  vertical-align: middle;
}

.quote-lines-table tbody tr:hover {
  background: #fafafa;
}

.quote-lines-table tbody tr:last-child td {
  border-bottom: none;
}

/* === Notice Box === */
.notice-box {
  background: #000;
  border: none;
  border-radius: 0;
  padding: 30px;
  margin-top: 25px;
  color: #fff;
}

.notice-box h3 {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 15px 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.notice-box p {
  font-size: 14px;
  color: #ccc;
  margin: 0 0 15px 0;
}

.notice-box ul {
  margin: 0;
  padding-left: 20px;
  color: #ccc;
}

.notice-box li {
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.notice-box strong {
  font-weight: 700;
  color: #fff;
}

/* === Loading State === */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

/* === Product Selection Form === */
.product-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* All fields take 1 column each - 4 per row */
.product-form .form-group {
  grid-column: span 1;
}

@media (max-width: 768px) {
  .product-form {
    grid-template-columns: 1fr;
  }
  
  .product-form .form-group {
    grid-column: 1 / -1 !important;
  }
}

/* === Products Container (NOT grid anymore!) === */
.products-grid,
#quoteLinesContainer {
  margin-top: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Products Table === */
.products-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #eee;
}

.products-table thead {
  background: #000;
}

.products-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
}

.products-table td {
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  color: #333;
  font-size: 14px;
}

.products-table tbody tr:hover {
  background: #fafafa;
}

.products-table tbody tr:last-child td {
  border-bottom: none;
}

.product-name {
  font-weight: 700;
  color: #000;
}

.variant-badge {
  display: inline-block;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
  margin-bottom: 6px;
  border: 1px solid #eee;
}

/* === Color Circle Styles ===
   Base definitions live in website-custom.css (26px global).
   Only the border-radius force-override stays here for the wizard context. */

/* Force circles — the global * { border-radius: 0 } rule in website-custom.css
   would otherwise square them off. Already set on the global .color-circle but
   kept here as a safety net for any portal component resets. */
.quote-wizard .color-circle,
.quote-wizard .color-circle-img,
.quote-wizard .color-circle-na {
  border-radius: 50% !important;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}

.availability-badge.in-stock {
  background: #dff6dd;
  color: #107c10;
}

.availability-badge.low-stock {
  background: #fff4ce;
  color: #797673;
}

.availability-badge.out-of-stock {
  background: #fde7e9;
  color: #d13438;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #605e5c;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  color: #323130;
  margin: 0 0 8px 0;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* === Summary Section === */
.summary-section {
  display: flex;
  justify-content: flex-end;
  padding: 30px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0;
  margin-top: 30px;
}

.summary-content {
  min-width: 350px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  color: #666;
}

.summary-row.total {
  border-top: 1px solid #000;
  margin-top: 15px;
  padding-top: 20px;
  font-size: 20px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-label {
  color: #666;
}

.summary-value {
  color: #000;
  font-weight: 700;
}

/* === Quote Totals (Step 3 Review) === */
.quote-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 30px;
  padding: 30px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  min-width: 350px;
  padding: 12px 0;
  font-size: 14px;
}

.totals-row-total {
  border-top: 1px solid #000;
  margin-top: 15px;
  padding-top: 20px;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.totals-label {
  color: #666;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.totals-value {
  color: #000 !important;
  font-weight: 700;
  margin-left: 40px;
}

/* === Buttons === */
.btn-primary,
.btn-secondary,
.add-product-btn {
  padding: 16px 40px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 0;
  border: 2px solid #000;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
  min-height: 56px;
  box-sizing: border-box;
}

.btn-primary,
.add-product-btn {
  background: #000;
  color: #fff;
}

.btn-primary:hover:not(:disabled),
.add-product-btn:hover:not(:disabled) {
  background: #fff;
  color: #000;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn-primary:disabled,
.add-product-btn:disabled {
  background: #ccc;
  border-color: #ccc;
  color: #fff;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: #000;
}

.btn-secondary:hover:not(:disabled) {
  background: #000;
  color: #fff;
}

.delete-btn {
  padding: 10px 20px;
  background: transparent;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  color: #000 !important;
  transform: scale(1.1);
}

/* === Action Buttons === */
.wizard-actions {
  display: flex;
  justify-content: flex-end; /* Moved to right corner per user request */
  gap: 20px;
  margin-top: 40px;
  padding: 30px 0;
  border-top: 1px solid #eee;
}

/* === Business Central Style Quote Grid - ELEGANT VERSION === */
.bc-entry-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 80px 120px 100px;
  gap: 25px;
  border-bottom: 1px solid #000;
  background: transparent;
  margin-bottom: 0;
  padding: 0 0 15px 0;
  align-items: end;
}

.bc-entry-row .form-group {
  margin-bottom: 0;
  border-right: none;
  padding: 0;
}

.bc-entry-row label {
  font-size: 8px;
  font-weight: 700;
  color: #bbb;
  margin-bottom: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: block;
}

.bc-entry-row input, 
.bc-entry-row select {
  padding: 10px 0 !important;
  font-size: 12px !important;
  border: none !important;
  border-bottom: 1px solid #f2f2f2 !important;
  background: transparent !important;
  width: 100%;
  color: #000;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bc-entry-row input:focus, 
.bc-entry-row select:focus {
  border-bottom-color: #000 !important;
  outline: none;
}

.bc-add-btn-cell {
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  border-left: none;
  padding-bottom: 0;
}

.add-line-btn {
  background: #000;
  border: 1px solid #000;
  color: #fff;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 2px;
  padding: 14px 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-line-btn:hover:not(:disabled) {
  background: transparent;
  color: #000;
}

.add-line-btn:disabled {
  background: transparent;
  border-color: #f0f0f0;
  color: #ddd;
  cursor: not-allowed;
}

/* === Loading Overlay === */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  border: 2px solid #eee;
  border-top: 2px solid #000;
  border-radius: 50% !important;
  width: 60px;
  height: 60px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  margin-top: 20px;
  font-size: 16px;
  color: #323130;
}

/* === Notification Animations === */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .quote-wizard {
    padding: 0 15px;
    margin: 20px auto;
  }

  .wizard-header {
    flex-direction: column;
    gap: 12px;
  }

  .wizard-header::before {
    display: none;
  }

  .wizard-title h1 {
    font-size: 24px;
  }

  .wizard-title .subtitle {
    font-size: 14px;
  }

  .form-section {
    padding: 20px;
  }

  .radio-group {
    grid-template-columns: 1fr;
  }

  .info-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .products-table {
    font-size: 12px;
  }

  .products-table th,
  .products-table td {
    padding: 10px;
  }

  .summary-content {
    min-width: 100%;
  }

  .wizard-actions {
    flex-direction: column-reverse;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    min-height: 56px;
    white-space: normal;
    padding: 16px 20px;
    line-height: 1.4;
  }
}

/* === Split Layout for Wizard - CENTERED VERSION === */
.wizard-split-layout {
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  gap: 40px;
  align-items: start;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 40px;
}

.wizard-spacer {
  width: 350px;
}

.wizard-split-layout .quote-wizard {
  margin: 60px 0;
  max-width: 1200px;
  width: 100%;
  justify-self: center;
}

.wizard-split-layout .wizard-marketing-sidebar {
  margin-top: 60px;
  width: 350px;
}

@media (max-width: 1600px) {
  .wizard-split-layout {
    grid-template-columns: 1fr 350px;
    padding: 0 20px;
  }
  
  /* Left spacer (container panel wrapper) always hidden — JS moves the panel into the sidebar */
  .wizard-spacer {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .wizard-split-layout {
    grid-template-columns: 1fr;
    max-width: 1200px;
  }
  
  .wizard-split-layout .quote-wizard {
    margin: 40px auto;
  }
  
  .wizard-split-layout .wizard-marketing-sidebar {
    width: 100%;
    margin-top: 40px;
  }
}

/* ===== Tablet range: 769px – 1200px =====
   Row 1: form (full width, centred, max 860px)
   Row 2: Container Analysis | Highlights  — two equal columns, same max-width
*/
@media (min-width: 769px) and (max-width: 1200px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .edit-employee-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Outer layout: single column, constrained, no overflow */
  .wizard-split-layout {
    display: block;          /* override the grid — use normal block flow */
    width: 100%;
    max-width: 860px;        /* same cap as form */
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Row 1 — form */
  .wizard-split-layout .quote-wizard {
    width: 100%;
    margin: 30px 0 0 0;
    box-sizing: border-box;
  }

  /* Row 2 — sidebar becomes a 2-column grid: Container | Highlights */
  .wizard-split-layout .wizard-marketing-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;  /* equal height columns */
    width: 100%;
    margin: 24px 0 40px 0;
    box-sizing: border-box;
  }

  /* Both panels fill their cell fully */
  #containerAnalysisMiniSlot,
  #marketingCarouselWrapper {
    width: 100%;
    min-width: 0;            /* prevent grid blowout */
    box-sizing: border-box;
  }

  /* Carousel inner container stretches to fill wrapper height */
  #marketingCarouselWrapper .marketing-carousel-container {
    min-height: 0;
  }

  /* Container Analysis panel inside mini-slot also stretches */
  #containerAnalysisMiniSlot #containerAnalysisPanel {
    height: 100%;
    box-sizing: border-box;
  }

  /* Carousel height matches the analysis panel — let content decide */
  .marketing-carousel-container {
    width: 100%;
    min-height: 340px;
    margin-top: 0;
    box-sizing: border-box;
  }

  .marketing-slide-img {
    padding: 20px;
  }

  /* Slightly smaller button text so 2-col/3-col fits */
  .btn-marketing {
    font-size: 10px !important;
    padding: 11px 4px !important;
    letter-spacing: 1px !important;
  }
}

.wizard-marketing-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-left: 0;
  border-left: none;
}

@media (max-width: 1024px) {
  .wizard-marketing-sidebar {
    padding-left: 0;
    border-left: none;
    border-top: none;
    padding-top: 0;
  }
}

/* === Marketing Cards === */
.marketing-card {
  border: 2px solid #000;
  padding: 0;
  background: #fff;
  transition: transform 0.3s ease;
}

.marketing-card:hover {
  transform: translateY(-5px);
}

.marketing-card.promo-black {
  background: #000;
  color: #fff;
}

.marketing-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border-bottom: 2px solid #000;
}

.marketing-card-content {
  padding: 20px;
}

.marketing-card-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #000;
}

.promo-black .marketing-card-tag {
  border-color: #fff;
}

.marketing-card-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px 0;
}

.marketing-card-text {
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.4;
}

.promo-black .marketing-card-text {
  color: #ccc;
}

.marketing-card-btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  background: #000;
  color: #fff;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid #000;
}

.marketing-card-btn:hover {
  background: #fff;
  color: #000;
}

.promo-black .marketing-card-btn {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.promo-black .marketing-card-btn:hover {
  background: #000;
  color: #fff;
}

/* === Marketing Sidebar Title === */
.info-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #aaa;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  height: 63px; /* Exact match to stay aligned with the step navigation line */
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}

.info-card-title::after {
  display: none; /* Removed the previous trailing line */
}

/* === Marketing Carousel === */
.wizard-marketing-sidebar {
  padding-top: 0;
}

/* Highlights wrapper — acts as the panel box (same look as #containerAnalysisPanel) */
#marketingCarouselWrapper {
  border: 1px solid #e1dfdd;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
}

/* Highlights title — inside the wrapper, matching Container Analysis panel style */
.marketing-carousel-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 63px;
  border-bottom: 2px solid #000;
  flex-shrink: 0;
}

.marketing-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  min-height: 540px;
  margin-top: 0;
  flex: 1;
}

.marketing-carousel-inner {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.marketing-carousel-item {
  min-width: 100%;
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
}

.marketing-slide-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-bottom: none;
}

.marketing-slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 45px;
}

.marketing-slide-badges {
  position: absolute;
  top: 15px;
  right: 15px;
  text-align: right;
  z-index: 10;
}

.marketing-badge {
  display: block;
  background: #f8f8f8;
  padding: 6px 12px;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  border: none;
}

.marketing-badge-series {
  background: #000;
  color: #fff;
  font-weight: 800;
}

.marketing-slide-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.marketing-slide-title {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 20px 0;
  line-height: 1.2;
  color: #000;
}

.marketing-slide-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: auto;
}

/* 2-column layout when only Details + Add (no Series) */
.marketing-slide-actions-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.btn-marketing {
  padding: 14px 5px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  text-decoration: none !important;
  display: block;
  transition: all 0.2s ease;
  border: none;
}

.btn-marketing-primary {
  background: #000;
  color: #fff;
}

.btn-marketing-primary:hover {
  background: #333 !important;
  color: #fff !important;
  text-decoration: none !important;
}

.btn-marketing-outline {
  background: #f8f8f8;
  color: #000;
  text-decoration: none !important;
}

.btn-marketing-outline:hover {
  background: #000 !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* Pagination Dots */
.marketing-carousel-dots {
  position: absolute;
  top: 350px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0;
  pointer-events: none;
  z-index: 20;
}

.dot {
  width: 20px;
  height: 1px;
  background: #e0e0e0;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.4s ease;
}

.dot.active {
  background: #000;
  width: 50px;
  height: 1px;
}

/* Carousel Arrows */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #000;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  z-index: 30;
  padding: 10px;
  opacity: 0.1;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.carousel-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.carousel-prev {
  left: 5px;
}

.carousel-next {
  right: 5px;
}

.marketing-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 450px;
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* === Inline Table Editors === */
.qty-editor {
  width: 45px;
  padding: 8px;
  border: none !important;
  background-color: #f9f9f9 !important;
  color: #000 !important;
  text-align: center;
  font-family: inherit;
  font-weight: 800;
  border-radius: 0;
  transition: all 0.2s ease;
  font-size: 13px;
}

.qty-editor:hover {
  background-color: #f0f0f0 !important;
}

.qty-editor:focus {
  background-color: #fff !important;
  box-shadow: inset 0 0 0 1px #000;
  outline: none;
}

.qty-editor::-webkit-inner-spin-button,
.qty-editor::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============================================
   MOBILE OVERRIDES FOR STEP 2 - CRITICAL FIXES
   ============================================ */
@media (max-width: 768px) {
  /* Fix root overflow without hiding content */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  /* Container adjustments */
  .quote-wizard {
    margin: 10px !important;
    padding: 15px !important;
    max-width: 100% !important;
  }
  
  /* Split layout - remove grid */
  .wizard-split-layout {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
  }
  
  .wizard-spacer {
    display: none !important;
  }
  
  .wizard-content-column {
    width: 100% !important;
  }
  
  /* CUSTOMER INFORMATION - SINGLE COLUMN */
  .customer-info-section {
    margin: 20px 0 !important;
    padding: 20px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
  }
  
  .customer-info-section .info-grid,
  .info-grid {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    gap: 0 !important;
  }
  
  .info-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  
  .info-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  
  .info-item strong {
    font-size: 11px !important;
    color: #999 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 700 !important;
  }
  
  .info-item span {
    font-size: 14px !important;
    color: #000 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* AUTOCOMPLETE - MUST BE VISIBLE AND CLICKABLE */
  .product-autocomplete {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: 120px !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    z-index: 99999 !important;
    max-height: calc(100vh - 140px) !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
    border-radius: 12px !important;
    background: #fff !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
  }
  
  .autocomplete-header {
    display: grid !important;
    grid-template-columns: 1.5fr 1fr auto !important;
    padding: 12px 10px !important;
    font-size: 10px !important;
    background: #000 !important;
    color: #fff !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    font-weight: 700 !important;
    align-items: center !important;
  }
  
  .close-autocomplete {
    background: none !important;
    border: none !important;
    color: #fff !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    padding: 0 8px !important;
    line-height: 1 !important;
    margin-left: 10px !important;
  }
  
  .close-autocomplete:active {
    opacity: 0.7 !important;
  }
  
  .autocomplete-header span:nth-child(3) {
    display: none !important;
  }
  
  .autocomplete-item {
    display: grid !important;
    grid-template-columns: 1.5fr 1fr !important;
    padding: 14px 10px !important;
    font-size: 13px !important;
    gap: 8px !important;
    border-bottom: 1px solid #eee !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    touch-action: manipulation !important;
  }
  
  .autocomplete-item:hover,
  .autocomplete-item:active {
    background: #f5f5f5 !important;
  }
  
  .autocomplete-item:active {
    background: #e8e8e8 !important;
  }
  
  .autocomplete-item-series {
    display: none !important;
  }
  
  .autocomplete-item-no {
    font-weight: 700 !important;
    color: #000 !important;
  }
  
  .autocomplete-item-description {
    font-size: 11px !important;
    color: #666 !important;
    grid-column: 1 / 2 !important;
  }
  
  .autocomplete-item-price {
    text-align: right !important;
    font-weight: 700 !important;
    color: #000 !important;
  }
  
  .autocomplete-empty {
    padding: 20px !important;
    text-align: center !important;
    color: #666 !important;
  }
  
  /* QUICK ADD FORM - MUST BE VISIBLE */
  .bc-entry-row {
    display: block !important;
    width: 100% !important;
    padding: 15px 10px !important;
    background: #f5f5f5 !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
  }
  
  .bc-entry-row .form-group {
    display: block !important;
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  .bc-entry-row input,
  .bc-entry-row select {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }
  
  .bc-entry-row label {
    display: block !important;
    margin-bottom: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #000 !important;
  }
  
  /* Variants - stack them */
  .bc-entry-row .form-group[style*="flex"] {
    display: block !important;
  }
  
  .bc-entry-row .form-group[style*="flex"] > div {
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  /* Qty and Price - side by side */
  .bc-entry-row .form-group[style*="80px"],
  .bc-entry-row .form-group[style*="120px"] {
    display: inline-block !important;
    width: 48% !important;
    vertical-align: top !important;
  }
  
  .bc-entry-row .form-group[style*="80px"] {
    margin-right: 4% !important;
  }
  
  .add-line-btn {
    width: 100% !important;
    padding: 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }
  
  /* PRODUCTS TABLE - RESTORE TABLE LAYOUT WITH SCROLL */
  .products-grid,
  #quoteLinesContainer {
    width: 100% !important;
    overflow-x: auto !important;
    margin: 20px 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .products-table {
    min-width: 800px !important;
    width: 100% !important;
  }
  
  .products-table thead {
    display: table-header-group !important;
  }
  
  .products-table tbody {
    display: table-row-group !important;
  }
  
  .products-table tr {
    display: table-row !important;
  }
  
  .products-table th,
  .products-table td {
    display: table-cell !important;
    padding: 12px 8px !important;
    font-size: 12px !important;
  }
  
  .products-table th {
    white-space: nowrap !important;
  }
  
  .products-table td {
    border-bottom: 1px solid #eee !important;
  }
  
  /* Summary and totals */
  .summary-section,
  .quote-totals {
    margin: 20px -15px !important;
    padding: 20px 15px !important;
    background: #f9f9f9 !important;
  }
  
  .summary-content {
    width: 100% !important;
  }
  
  /* Action buttons */
  .wizard-actions {
    flex-direction: column-reverse !important;
    gap: 10px !important;
    margin: 20px -15px 0 -15px !important;
    padding: 20px 15px 0 15px !important;
  }
  
  .wizard-actions > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100% !important;
    padding: 16px 20px !important;
    min-height: 56px !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
  }
  
  /* Marketing sidebar */
  .wizard-marketing-sidebar {
    width: 100% !important;
    padding: 0 !important;
    margin-top: 30px !important;
  }

  /* Main form keeps its natural order */
  .wizard-split-layout .quote-wizard {
    order: 1 !important;
  }
  
  /* Quote lines container - enable scroll on mobile */
  .quote-lines-container,
  #quoteLinesContainer {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .quote-lines-table {
    min-width: 800px !important;
  }

  /* ===== Container Analysis inside sidebar (mini slot) — Mobile ===== */
  /* JS moves #containerAnalysisPanel into #containerAnalysisMiniSlot on narrow screens.
     The original wrapper is hidden by JS; we just make the panel readable here. */
  #containerAnalysisMiniSlot #containerAnalysisPanel {
    border-radius: 6px !important;
    padding: 14px !important;
    margin-bottom: 0 !important;
  }

  /* Mode buttons row — wrap on small screens */
  #containerModeSelector {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .container-mode-btn {
    flex: 1 1 auto !important;
    min-width: 60px !important;
    padding: 9px 6px !important;
    font-size: 11px !important;
  }

  /* Stats grid — all 3 in a row */
  #containerStatsSummary {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  #containerStatsSummary .container-stat-card[style*="grid-column"] {
    grid-column: auto !important;
  }

  .container-stat-value {
    font-size: 13px !important;
  }

  .container-fill-pct {
    font-size: 11px !important;
  }

  #containerOptimizationTip,
  #containerMissingCBM {
    font-size: 11px !important;
    padding: 8px !important;
  }

  /* Carousel "Add to Quote" button — full width on tiny screens */
  /* Both 2-col (Details+Add) and 3-col (Details+Series+Add) collapse to 1-col + full-width Add */
  .marketing-slide-actions-3col,
  .marketing-slide-actions-2col {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .btn-marketing-add {
    grid-column: 1 / -1 !important;
    padding: 12px 5px !important;
  }

  /* info-card-title in the mini-slot needs breathing room on mobile */
  #containerAnalysisMiniSlot .info-card-title {
    margin-top: 20px !important;
    padding-top: 12px !important;
    border-top: 1px solid #f0f0f0 !important;
  }
}
