/**
 * Quote Flow Wizard Styles
 * Mobile-first, following design system from design-system.md
 */

:root {
  --color-blue-primary: #003366;
  --color-blue-light: #E6F0FA;
  --color-orange-primary: #FF6600;
  --color-orange-light: #FFF4E6;
}

/* ===== LAYOUT ===== */
.quote-flow-container {
  min-height: calc(100vh - 200px);
}

.step-container {
  display: none;
}

.step-container.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

/* ===== PROGRESS BAR ===== */
.progress-container {
  max-width: 600px;
  margin: 0 auto;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: #E5E7EB;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--color-blue-primary);
  transition: width 0.3s ease-in-out;
  border-radius: 9999px;
}

/* ===== STEP CONTENT ===== */
.step-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .step-content {
    padding: 3rem;
  }
}

.step-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .step-title {
    font-size: 2.25rem;
  }
}

.step-description {
  font-size: 1rem;
  color: #6B7280;
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== STEP 1: PROPERTY TYPE CARDS ===== */
.property-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .property-type-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.property-card {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.property-card:hover {
  border-color: var(--color-blue-primary);
  box-shadow: 0 4px 6px rgba(0, 51, 102, 0.1);
}

.property-card.selected {
  border-color: var(--color-blue-primary);
  background: rgba(0, 51, 102, 0.05);
}

.property-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.property-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.property-description {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.5;
}

/* ===== STEP 2: ROOM SELECTION ===== */
.room-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .room-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .room-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.room-checkbox {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.room-checkbox:hover {
  border-color: var(--color-blue-primary);
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.1);
}

.room-checkbox.selected {
  border-color: var(--color-blue-primary);
  background: rgba(0, 51, 102, 0.05);
}

.room-checkbox.selected::after {
  content: '✓';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--color-blue-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.room-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.room-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.stairs-badge {
  font-size: 0.75rem;
  color: #FF6600;
  background: #FFF4E6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  font-weight: 600;
}

.remove-custom-room {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  background: #EF4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-custom-room:hover {
  background: #DC2626;
}

.custom-room-section {
  margin-bottom: 2rem;
}

.btn-add-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px dashed #D1D5DB;
  background: white;
  color: #6B7280;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-custom:hover {
  border-color: var(--color-blue-primary);
  color: var(--color-blue-primary);
}

.custom-room-input {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.custom-room-input .form-input {
  flex: 1;
  min-width: 200px;
}

.btn-primary-small,
.btn-outline-small {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-small {
  background: var(--color-blue-primary);
  color: white;
  border: none;
}

.btn-primary-small:hover {
  background: #002244;
}

.btn-outline-small {
  background: white;
  color: #6B7280;
  border: 1px solid #D1D5DB;
}

.btn-outline-small:hover {
  background: #F3F4F6;
}

/* ===== STEP 3: MEASUREMENTS ===== */
.measurements-form {
  margin-bottom: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.measurement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #E5E7EB;
}

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

.measurement-label {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
  flex: 1;
}

.stairs-note {
  display: block;
  font-size: 0.75rem;
  color: #FF6600;
  font-weight: 400;
  margin-top: 0.25rem;
}

.measurement-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.measurement-input {
  width: 100px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 1rem;
  text-align: right;
}

.measurement-input:focus {
  outline: none;
  border-color: var(--color-blue-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.measurement-unit {
  font-size: 0.875rem;
  color: #6B7280;
  white-space: nowrap;
}

.total-sqft-display {
  background: var(--color-blue-light);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.total-sqft-label {
  font-size: 1rem;
  color: #6B7280;
  margin-right: 0.5rem;
}

.total-sqft-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-blue-primary);
}

/* ===== STEP 4: CARPET SELECTION ===== */
.carpet-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.5rem;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.875rem;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.carpet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .carpet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .carpet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .carpet-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.carpet-card {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.carpet-card:hover {
  border-color: var(--color-blue-primary);
  box-shadow: 0 4px 6px rgba(0, 51, 102, 0.1);
}

.carpet-card.selected {
  border-color: var(--color-blue-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.carpet-image {
  aspect-ratio: 3 / 4;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.carpet-card-image-container {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carpet-placeholder {
  color: #9CA3AF;
  font-size: 0.875rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Carousel Controls */
.carousel-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  padding: 16px 8px 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.carpet-card:hover .carousel-controls {
  opacity: 1;
}

.carousel-btn {
  background: rgba(0, 51, 102, 0.8);
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.carousel-btn:hover {
  background: rgba(0, 51, 102, 1);
}

.carousel-dots {
  display: flex;
  gap: 4px;
}

.carousel-dot {
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
  background: white;
}

.carpet-details {
  padding: 1rem;
}

.carpet-name {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.carpet-fiber-badge {
  display: inline-block;
  font-size: 0.75rem;
  background: #E6F0FA;
  color: #003366;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.carpet-durability {
  font-size: 0.875rem;
  color: #FBBF24;
  margin-bottom: 0.5rem;
}

.carpet-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-blue-primary);
}

.price-unit {
  font-size: 0.875rem;
  color: #6B7280;
  font-weight: 400;
}

.loading-spinner,
.no-results,
.error-message {
  text-align: center;
  padding: 3rem;
  color: #6B7280;
}

/* ===== STEP 5 & 6: FORMS ===== */
.address-form,
.contact-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group-small {
  flex: 0 0 auto;
  width: 100px;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.5rem;
}

.required {
  color: #EF4444;
}

.required-indicator {
  color: #EF4444;
  font-weight: 600;
  margin-left: 0.25rem;
  display: inline;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.form-input::placeholder {
  color: #9CA3AF;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.radio-label input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

/* ===== STEP 7: REVIEW ===== */
.review-section {
  background: #F9FAFB;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.review-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.edit-btn {
  color: var(--color-blue-primary);
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.edit-btn:hover {
  color: #002244;
}

.review-content {
  color: #374151;
  line-height: 1.75;
}

.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.review-list li {
  padding: 0.25rem 0;
}

.review-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #D1D5DB;
  font-weight: 600;
  color: #111827;
}

.review-carpet-details strong {
  color: #111827;
}

.pricing-section {
  background: var(--color-blue-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pricing-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}

.pricing-breakdown {
  margin-bottom: 1rem;
}

.pricing-line {
  padding: 0.5rem 0;
  color: #374151;
}

.pricing-breakdown-list {
  list-style: none;
  padding-left: 1rem;
  margin: 0.5rem 0;
}

.pricing-breakdown-list li {
  padding: 0.25rem 0;
  color: #6B7280;
  font-size: 0.875rem;
}

.pricing-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px solid var(--color-blue-primary);
  margin-top: 1rem;
}

.pricing-total-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.pricing-total-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-blue-primary);
}

.terms-section {
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  cursor: pointer;
}

.checkbox-label a {
  color: var(--color-blue-primary);
  text-decoration: underline;
}

.submit-note {
  text-align: center;
  color: #6B7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ===== ACTION BUTTONS ===== */
.step-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-continue,
.btn-submit {
  background: var(--color-blue-primary);
  color: white;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2);
}

.btn-continue:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
  background: #002244;
  box-shadow: 0 4px 6px rgba(0, 51, 102, 0.3);
}

.btn-continue:disabled,
.btn-submit:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-back {
  background: white;
  color: #6B7280;
  padding: 0.875rem 2rem;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}

.hidden {
  display: none !important;
}

/* ===== ICONS ===== */
.icon-sm {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
  vertical-align: middle;
}

/* ===== COLORWAY MODAL STYLES (Phase 2) ===== */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1001;
  animation: modalSlideIn 0.3s ease-out;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  position: relative;
  padding: 32px;
}

.modal-header {
  margin-bottom: 24px;
}

.modal-header h3 {
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 600;
  color: #003366;
}

.style-info-recap {
  background: #f9fafb;
  padding: 16px;
  border-left: 4px solid #003366;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
}

.style-info-recap strong {
  font-size: 18px;
  color: #003366;
  display: block;
  margin-bottom: 8px;
}

.specs-text {
  font-size: 13px;
  color: #666;
  margin: 4px 0;
  line-height: 1.4;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-button:hover {
  background: #f0f0f0;
  color: #333;
}

/* ===== COLORWAY GRID STYLES ===== */

.colorway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.colorway-item {
  cursor: pointer;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  background: white;
  padding-bottom: 0;
}

.colorway-item:hover {
  border-color: #003366;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.15);
  transform: translateY(-2px);
}

.colorway-item.selected {
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
  background-color: rgba(255, 102, 0, 0.03);
}

.colorway-item.selected .colorway-name {
  color: #ff6600;
  font-weight: 600;
}

/* ===== MODAL FOOTER ===== */

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #003366;
  color: white;
}

.btn-primary:hover {
  background: #002244;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.btn-secondary {
  background: #e5e7eb;
  color: #333;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* ===== CARPET GRID ENHANCEMENT ===== */

.carpet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.carpet-card {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  display: flex;
  flex-direction: column;
}

.carpet-card:hover {
  border-color: #003366;
  box-shadow: 0 8px 16px rgba(0, 51, 102, 0.15);
  transform: translateY(-4px);
}

.carpet-card.selected {
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
}

.carpet-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0f0f0;
}

.carpet-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.carpet-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.carpet-name {
  font-weight: 600;
  font-size: 15px;
  color: #003366;
  margin: 0 0 4px 0;
}

.carpet-price {
  font-size: 18px;
  font-weight: 700;
  color: #ff6600;
  margin: 4px 0;
}

.carpet-specs {
  font-size: 12px;
  color: #666;
  margin: 8px 0 0 0;
  flex-grow: 1;
  line-height: 1.3;
}

.colorway-count {
  font-size: 11px;
  background: #f0f0f0;
  color: #666;
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 8px;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}

/* ===== INTERACTIVE STATES ===== */

/* Colorway Item States */
.colorway-item {
  transition: all 0.2s ease-out;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  position: relative;
}

.colorway-item:hover {
  border-color: #003366;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.15);
  transform: translateY(-2px);
}

.colorway-item.selected {
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
  background-color: rgba(255, 102, 0, 0.03);
}

.colorway-item.selected .colorway-name {
  color: #ff6600;
  font-weight: 600;
}

/* Carpet Card States */
.carpet-card {
  transition: all 0.2s ease-out;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  position: relative;
}

.carpet-card:hover {
  border-color: #003366;
  box-shadow: 0 8px 16px rgba(0, 51, 102, 0.1);
  transform: translateY(-4px);
}

.carpet-card.selected {
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
  background-color: rgba(255, 102, 0, 0.02);
}

/* Button States */
.btn-primary,
.btn-secondary {
  transition: all 0.2s ease-out;
}

.btn-primary:hover {
  background-color: #002244;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary:hover {
  border-color: #003366;
  background-color: #f9fafb;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.1);
}

/* Close Button States */
.close-button {
  transition: all 0.2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #666;
}

.close-button:hover {
  background: #f0f0f0;
  color: #333;
}

.close-button:active {
  background: #e0e0e0;
}

/* ===== ANIMATIONS ===== */

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ===== CARPET FILTERS ===== */
.carpet-filters {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.filters-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.btn-clear-filters {
  padding: 8px 16px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-clear-filters:hover {
  background-color: #dc2626;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.filter-select,
.filter-input {
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-help-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  font-style: italic;
}

.filters-presets {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  margin-right: 4px;
}

.preset-btn {
  padding: 8px 16px;
  background-color: #f3f4f6;
  border: 2px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.preset-btn:hover {
  background-color: #e5e7eb;
  border-color: #9ca3af;
}

.preset-btn.active {
  background-color: #3b82f6;
  color: white;
  border-color: #2563eb;
}

.filters-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  font-size: 14px;
  color: #6b7280;
}

.results-count {
  font-weight: 500;
  color: #1f2937;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
  .carpet-filters {
    padding: 16px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filters-presets {
    flex-direction: column;
    align-items: flex-start;
  }

  .preset-btn {
    width: 100%;
    text-align: center;
  }

  .modal {
    max-width: 95vw;
    width: 95vw;
  }

  .modal-content {
    padding: 20px;
  }

  .colorway-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
  }

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

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 16px;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .colorway-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 375px) {
  .step-content {
    padding: 1.5rem;
  }

  .step-title {
    font-size: 1.5rem;
  }

  .property-card {
    padding: 1.5rem 1rem;
  }
}

/* ===== STEP HEADER WITH ACTIONS ===== */
.step-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .step-header-actions {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Tertiary Button - Start Fresh */
.btn-tertiary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-tertiary:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.btn-tertiary:active {
  background: #d1d5db;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .btn-tertiary {
    width: 100%;
    padding: 10px;
  }
}

/* Visualize Button on Carpet Card */
.visualize-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-blue-primary);
  border: 1px solid var(--color-blue-primary);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
  z-index: 10;
}

.carpet-card:hover .visualize-btn {
  opacity: 1;
}

.visualize-btn:hover {
  background: var(--color-blue-primary);
  color: white;
}

/* ===== DIMENSIONS INPUTS (STEP 3 UPDATE) ===== */
.measurement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

.room-sqft-display {
  font-size: 0.875rem;
  color: #6B7280;
  background: #F3F4F6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.dimensions-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
}

.dimensions-inputs .input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dimensions-inputs .sub-label {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.25rem;
}

.dimension-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
}

.dimension-input:focus {
  outline: none;
  border-color: var(--color-blue-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.multiply-symbol {
  font-size: 1.25rem;
  color: #9CA3AF;
  padding-bottom: 0.5rem;
}

@media (max-width: 480px) {
  .measurement-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .measurement-header {
    margin-bottom: 0.5rem;
  }
  
  .dimensions-inputs {
    width: 100%;
  }
}
