:root{
    --default-font: 'Playfair';
}

/* Package Builder CSS */
.package-builder-section {
  padding: 30px 0;
}

.package-builder-section h1,
.package-builder-section h2,
.package-builder-section h3,
.package-builder-section h4,
.package-builder-section h5 {
  font-family: var(--event-font), var(--default-font);
  font-display: swap;
}

.package-builder-container {
  display: grid;
  gap: 40px;
  margin-top: 40px;
  grid-template-columns: 2fr 1fr;
  align-items: start;
}

.services-selection {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Scroll Hint */
.services-scroll-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(232, 180, 184, 0.1);
  border-radius: 8px;
  font-style: italic;
}

.services-scroll-hint span {
  font-weight: 500;
}

.package-service-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-height: 180px;
  justify-content: space-between;
  scroll-snap-align: start;
  width: 280px; /* Fixed width for consistent layout */
  flex-shrink: 0; /* Prevent shrinking */
}

.package-service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 180, 184, 0.3);
}

.package-service-card.selected {
  background: linear-gradient(135deg, #fdf9f7 0%, #f7f1f0 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 180, 184, 0.4);
}

.package-service-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(232, 180, 184, 0.3);
}

.package-service-card.selected .package-service-icon {
  box-shadow: 0 8px 25px rgba(232, 180, 184, 0.5);
  transform: scale(1.1);
}

.package-service-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.package-service-content h4 {
  color: #2c3e50;
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-weight: 600;
  font-display: swap;
}

.package-service-content p {
  display: -webkit-box;
  -webkit-line-clamp: 3;           /* number of lines before truncating */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;             /* must NOT be nowrap for multiline */
  line-height: 1.3;
  font-size: 0.8rem;
  color: #666;
  max-height: 2.6em;               /* roughly 2 lines of text */
  word-break: break-word;
}

.selection-indicator {
  width: 24px;
  height: 24px;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: absolute;
  top: 15px;
  right: 15px;
}

.selection-indicator i {
  font-size: 0.8rem;
  color: white;
  opacity: 0;
  transition: all 0.3s ease;
}

.package-service-card.selected .selection-indicator i {
  opacity: 1;
}

.package-summary-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 100px;
  height: fit-content;
}

.summary-header {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.summary-header h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 8px;
  font-display: swap;
}

.summary-header p {
  color: #7a7a7a;
  margin: 0;
  font-size: 0.9rem;
}

.selected-items {
  margin-bottom: 25px;
  min-height: 200px;
}

.empty-state {
  text-align: center;
  color: #7a7a7a;
  padding: 40px 20px;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 15px;
  display: block;
}

.selected-service-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  background: linear-gradient(135deg, #fdf9f7 0%, #f7f1f0 100%);
  border-radius: 8px;
  margin-bottom: 8px;
}

.selected-service-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.selected-service-name {
  color: #2c3e50;
  font-size: 0.9rem;
  font-weight: 500;
  font-display: swap;
}

.summary-footer {
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
  text-align: center;
}

.items-count {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.package-quote-btn {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  color: white;
  border: none;
}

.package-quote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 180, 184, 0.4);
  text-decoration: none;
  color: white;
}

.package-quote-btn.disabled,
.package-quote-btn[disabled] {
  background: #dee2e6 !important;
  color: #6c757d !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

  .package-service-icon {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
    margin-bottom: 10px;
    flex-shrink: 0;
  }

  .package-service-content h4 {
    font-size: 1rem;
  }

  .package-service-content p {
    font-size: 0.8rem;
  }

  .selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .selected-items {
    min-height: 150px;
  }

  .services-scroll-hint {
    font-size: 0.85rem;
    padding: 8px;
  }

  .services-scroll-hint span {
    display: block;
    margin-top: 5px;
  }

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.premade-packages-section {
  margin-bottom: 50px;
}

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

.premade-package-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.premade-package-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.premade-package-card.expanded .premade-package-details {
  max-height: 500px; /* enough space for description */
  opacity: 1;
  margin-top: 10px;
}

.premade-package-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 180, 184, 0.3);
}

.premade-package-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  margin: 0 auto 12px;
  box-shadow: 0 5px 15px rgba(232, 180, 184, 0.3);
}


.premade-package-title {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.premade-package-subtitle {
  color: #7a7a7a;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.premade-package-btn {
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.premade-package-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(232, 180, 184, 0.4);
  text-decoration: none;
  color: white;
}

.packages-divider {
  display: flex;
  align-items: center;
  margin: 40px 0 30px;
  text-align: center;
}

.packages-divider::before,
.packages-divider::after {
  content: '';
  flex: 1;
  height: 1px;
}

.packages-divider-text {
  padding: 0 25px;
  font-size: 0.95rem;
  color: #7a7a7a;
  font-weight: 500;
}

.hidden { display: none !important; }
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-content a.btn-primary {
  margin-top: 20px;
  margin-bottom: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
  font-size: 1rem;
  font-weight: 600;
}

/* Modal services */
.modal-service-item {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  padding: 12px 15px;
  background: linear-gradient(135deg, #fdf9f7 0%, #f7f1f0 100%);
  border-radius: 8px;
  margin-bottom: 8px;
}

.modal-service-item .service-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.modal-service-item .service-description {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  padding: 0;
}

.modal-service-item .service-description.expanded {
  max-height: 500px;
  padding: 8px 0;
}

/* Category block */
.services-category {
  margin-bottom: 26px;
}

.services-category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 0 4px;
}

.services-category-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Row = horizontal scroll strip of cards */
.services-category-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 10px 0;
  max-width: 100%;
}

/* Reuse your existing card styles: .package-service-card {...} */
.services-category-row .package-service-card {
  scroll-snap-align: start;
  flex: 0 0 280px;
}

/* tweak on smaller screens */
@media (max-width: 992px) {

  /* --- Layout adjustments --- */
  .package-builder-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .summary-col {
    order: 2;
    margin-top: 25px;
    position: static !important;
  }

  .package-summary-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 18px;
    position: relative;
    top: auto;
  }

  /* --- Category and card grid adjustments --- */
  .services-category-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
  }

  .services-scroll-hint {
    font-size: 0.75rem;
    padding: 5px;
  }

  .services-category-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  /* --- Service card resizing --- */
  .package-service-card {
    flex: 0 0 180px;
    min-height: 120px;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
  }

  .package-service-icon {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .package-service-content h4 {
    font-size: 0.85rem;
    margin-bottom: 3px;
    line-height: 1.1;
  }

  .package-service-content p {
    font-size: 0.7rem;
    line-height: 1.1;
    color: #666;
  }

  .selection-indicator {
    width: 18px;
    height: 18px;
    top: 6px;
    right: 6px;
  }

  /* --- Summary content scaling --- */
  .package-summary-card h3 {
    font-size: 1rem;
  }

  .selected-service-name {
    font-size: 0.8rem;
  }

  .items-count {
    font-size: 0.9rem;
  }

  .package-quote-btn {
    font-size: 0.9rem;
    padding: 12px;
  }

  /* --- Premade packages adjustments --- */
  .premade-packages-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .premade-package-card {
    height: 180px;
    padding: 15px;
  }

  .premade-package-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .premade-package-title {
    font-size: 1rem;
  }

  .packages-divider-text {
    padding: 0 20px;
    font-size: 0.9rem;
  }
}

/* Fix for grid container overflow */
.package-builder-container > * {
  min-width: 0;
}
