.my-moving-calculator {
  max-width: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
  font-size: 14px;
  border: 1px solid #b3d9ff;
  background: #f0f8ff;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.my-moving-calculator * {
  box-sizing: border-box;
}

/* Ensure calculator styles win over theme / Elementor defaults */
.my-moving-calculator button,
.my-moving-calculator input,
.my-moving-calculator select,
.my-moving-calculator textarea {
  font-family: inherit;
}

/* Force button styles to override theme defaults */
.my-moving-calculator button.mmc-btn,
.my-moving-calculator .mmc-btn {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  outline: none !important;
}

.mmc-header {
  margin-bottom: 0;
  padding: 0.9rem 1.5rem;
  text-align: center;
  background: #e6f3ff;
  border-bottom: 1px solid #b3d9ff;
}

.mmc-header h2 {
  margin: 0 !important;
  font-size: 1.5rem !important;
  color: #1c242c !important;
  line-height: 1.3 !important;
}

.mmc-header p {
  margin: 0.25rem 0 0;
  color: #3d5e80;
  font-size: 0.95rem;
}

.mmc-steps {
  margin-top: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.mmc-step-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mmc-step-indicator {
  flex: 1 1 120px;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #b3d9ff;
  font-size: 0.85rem;
  background: #e6f3ff;
  color: #1c242c;
}

.mmc-step-indicator-active {
  border-color: #3A25F1;
  background: #3A25F1;
  color: #fff;
  font-weight: 600;
}

.mmc-step {
  display: none;
}

.mmc-step-active {
  display: block;
}

.mmc-step h3 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.15rem !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

/* Override Elementor heading styles */
.my-moving-calculator h1,
.my-moving-calculator h2,
.my-moving-calculator h3,
.my-moving-calculator h4,
.my-moving-calculator h5,
.my-moving-calculator h6 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  line-height: 1.3 !important;
}

.mmc-step-help {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #507aaa;
  font-size: 0.95rem;
}

.mmc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.mmc-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mmc-form-field-full {
  grid-column: 1 / -1;
}

.mmc-form-field label {
  font-size: 0.9rem;
  color: #1c242c;
}

.mmc-form-field input,
.mmc-form-field select,
.mmc-form-field textarea {
  border-radius: 3px;
  border: 1px solid #b3d9ff;
  padding: 0.35rem 0.4rem;
  font-size: 0.9rem;
  background: #ffffff;
}

.mmc-field-error input,
.mmc-field-error select,
.mmc-field-error textarea {
  border-color: #d32f2f;
  background-color: #ffebee;
}

.mmc-field-error label {
  color: #d32f2f;
}

.mmc-form-field select {
  background-color: #ffffff;
  width: 100%;
  min-height: 2.5rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231c242c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
  padding-right: 2rem;
  border: 1px solid #b3d9ff;
}

.mmc-step-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.my-moving-calculator .mmc-btn {
  border-radius: 3px;
  border: 1px solid transparent !important;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  line-height: 1.2;
  font-family: inherit !important;
  text-decoration: none !important;
  display: inline-block !important;
  box-shadow: none !important;
}

.my-moving-calculator .mmc-btn-primary {
  background: #3A25F1 !important;
  background-color: #3A25F1 !important;
  border-color: #3A25F1 !important;
  color: #F1F0FF !important;
  border-style: solid !important;
  border-width: 1px !important;
}

.my-moving-calculator .mmc-btn-primary:hover {
  background: #5A49F4 !important;
  background-color: #5A49F4 !important;
  border-color: #5A49F4 !important;
  color: #F1F0FF !important;
}

.my-moving-calculator .mmc-btn-secondary {
  background: #5A49F4 !important;
  background-color: #5A49F4 !important;
  border-color: #7A6FF6 !important;
  color: #F1F0FF !important;
  border-style: solid !important;
  border-width: 1px !important;
}

.my-moving-calculator .mmc-btn-secondary:hover {
  background: #7A6FF6 !important;
  background-color: #7A6FF6 !important;
  border-color: #9B95F8 !important;
  color: #F1F0FF !important;
}

.my-moving-calculator .mmc-btn-reset:not(:disabled) {
  background: #dc3545 !important;
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
  border-style: solid !important;
  border-width: 1px !important;
}

.my-moving-calculator .mmc-btn-reset:hover:not(:disabled) {
  background: #c82333 !important;
  background-color: #c82333 !important;
  border-color: #c82333 !important;
  color: #ffffff !important;
}

.my-moving-calculator .mmc-btn-reset:active:not(:disabled) {
  background: #bd2130 !important;
  background-color: #bd2130 !important;
  border-color: #bd2130 !important;
  color: #ffffff !important;
}

.my-moving-calculator .mmc-btn-reset.mmc-btn-disabled,
.my-moving-calculator .mmc-btn-reset:disabled {
  background: #d0d0d0 !important;
  background-color: #d0d0d0 !important;
  border-color: #c0c0c0 !important;
  color: #888 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.mmc-summary-block {
  border: 1px solid #b3d9ff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #f0f8ff;
}

.mmc-summary-block h4 {
  margin: 0 0 0.5rem !important;
  font-size: 1.05rem !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

.mmc-summary-block p {
  margin: 0.15rem 0;
}

.mmc-summary-totals {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #b3d9ff;
  flex-wrap: wrap;
}

.mmc-summary-total-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mmc-summary-total-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.mmc-summary-total-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1c242c;
}

.mmc-summary-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.mmc-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}

.mmc-summary-table thead {
  background: #e6f2ff;
}

.mmc-summary-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #1c242c;
  border-bottom: 2px solid #b3d9ff;
}

.mmc-summary-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

.mmc-summary-table tbody tr:hover {
  background: #f5f9ff;
}

.mmc-summary-table tbody tr:last-child td {
  border-bottom: none;
}

.mmc-summary-empty {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 2rem !important;
}

.mmc-room {
  border-top: 1px solid #b3d9ff;
  margin-bottom: 0;
  overflow: hidden;
  background: #ffffff;
}

.mmc-room-header {
  background: #e6f3ff;
  padding: 0.9rem 1.5rem;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  cursor: pointer;
  color: #1c242c;
}

.mmc-room-header h3 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  min-width: 0;
}

.mmc-room-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(4.5rem, max-content));
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-items: center;
  justify-self: center;
  text-align: center;
  font-size: 0.75rem;
  color: #3d5e80;
}

.mmc-room-totals > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
}

.mmc-room-toggle {
  font-size: 0.8rem;
  margin-left: 0.75rem;
  color: #1c242c;
  background: #b3d9ff;
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
  transition: transform 0.15s ease;
  justify-self: end;
}

.mmc-room-open .mmc-room-header {
  background: #d6ebff;
  color: #1c242c;
}

.mmc-room-open .mmc-room-totals {
  color: #3d5e80;
}

.mmc-room-open .mmc-room-toggle {
  color: #1c242c;
  background: #99ccff;
}

.mmc-room-collapsed .mmc-room-toggle {
  transform: rotate(-90deg);
}

.mmc-room-body {
  padding: 0;
}

.mmc-room-collapsed .mmc-room-body {
  display: none;
}

.mmc-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 1.4fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid #b3d9ff;
}

.mmc-row > div {
  padding: 0.45rem 0.9rem;
}

.mmc-row:last-child {
  border-bottom: none;
}

.mmc-row-head {
  font-weight: 600;
  border-bottom: none;
  background: #e6f3ff;
  color: #1c242c;
  text-transform: uppercase;
}

.mmc-col-name {
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.mmc-col-cube,
.mmc-col-weight,
.mmc-col-total {
  text-align: center;
}

.mmc-col-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0.3rem 0.6rem;
}

.my-moving-calculator .mmc-qty-btn {
  border: 1px solid #3A25F1 !important;
  background: #3A25F1 !important;
  color: #F1F0FF !important;
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  cursor: pointer;
  border-radius: 2px !important;
  font-size: 13px !important;
  line-height: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mmc-qty-btn:hover {
  background: #5A49F4 !important;
  border-color: #7A6FF6 !important;
}

.mmc-qty-input {
  width: 2rem;
  margin: 0 0.25rem;
  padding: 0.15rem 0.2rem;
  border-radius: 2px;
  border: 1px solid #b3d9ff;
  text-align: center;
  font-size: 0.8rem;
  background: #f0f8ff;
  color: #1c242c;
  box-sizing: border-box;
}

.mmc-item:nth-child(odd) {
  background: #ffffff;
}

.mmc-item:nth-child(even) {
  background: #f0f8ff;
}

.mmc-summary {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid #b3d9ff;
}

.mmc-summary h3 {
  margin: 0 0 0.5rem !important;
  font-size: 1.15rem !important;
  color: #1c242c !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

.mmc-summary p {
  margin: 0.1rem 0;
}

.mmc-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #777;
}

/* Table wrapper for horizontal scrolling on small screens */
.mmc-rooms {
  overflow-x: auto;
}

@media (max-width: 768px) {
  .my-moving-calculator {
    padding: 0;
    margin: 0 auto;
  }

  .mmc-steps {
    padding: 1rem;
  }

  .mmc-row {
    grid-template-columns: 1.5fr 0.7fr 0.7fr 1fr 0.8fr;
    font-size: 0.85rem;
    gap: 0.3rem;
  }

  .mmc-row > div {
    padding: 0.35rem 0.4rem;
  }

  .mmc-col-name {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
    font-size: 0.85rem;
  }

  .mmc-col-cube,
  .mmc-col-weight,
  .mmc-col-total {
    text-align: center;
    font-size: 0.85rem;
  }

  .mmc-room-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
  }

  .mmc-form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .mmc-room-totals {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
  }

  /* Stack quantity controls vertically on mobile */
  .mmc-col-qty {
    flex-direction: column !important;
    gap: 0.2rem !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.4rem 0.25rem !important;
    min-width: 0;
  }

  .mmc-col-qty .mmc-qty-btn,
  .mmc-col-qty .mmc-qty-input {
    margin: 0 !important;
  }

  .mmc-qty-input {
    width: 1.8rem !important;
    min-width: 1.8rem !important;
    max-width: 1.8rem !important;
    margin: 0 auto !important;
    order: 2 !important;
    text-align: center !important;
    padding: 0.2rem 0.15rem !important;
    font-size: 0.8rem !important;
    border-radius: 2px !important;
    box-sizing: border-box !important;
  }

  .mmc-qty-btn.mmc-qty-plus,
  .mmc-qty-btn.mmc-qty-minus {
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
    min-height: 1.5rem !important;
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  .mmc-qty-btn.mmc-qty-plus {
    order: 1 !important;
  }

  .mmc-qty-btn.mmc-qty-minus {
    order: 3 !important;
  }

  .mmc-col-total {
    text-align: center !important;
    vertical-align: middle !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Mobile-specific select dropdown styles */
  .mmc-form-field select {
    width: 100% !important;
    min-height: 2.75rem;
    font-size: 1rem;
    padding: 0.5rem 2.5rem 0.5rem 0.5rem !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%231c242c' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 14px !important;
    touch-action: manipulation;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Ensure select dropdowns don't overflow on mobile */
  .mmc-form-field {
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }

  /* Better touch targets for mobile */
  .mmc-form-field input,
  .mmc-form-field textarea {
    min-height: 2.75rem;
    font-size: 1rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

