/* Apply border-box globally */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* General Section Styling */
.customservice-section {
  padding: 60px 0;
  background-color: #f5f5f5; /* Light background for contrast */
}

.page-title h1 {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.page-title p {
  font-size: 16px;
  color: #666;
}

/* Category Filter Styles */
.category-filter {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

.filter-label {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.category-form select {
  padding: 12px 15px;
  font-size: 16px;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px; /* Ensures select box doesn't get too small */
}

.category-form select:hover {
  border-color: #28a745;
  background-color: #ffffff;
}

.category-form select:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.category-form select option {
  padding: 10px;
  background: #ffffff;
}

/* Card Styles */
.customservice-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Allows children to take full width */
  height: 100%; /* Ensure all cards stretch to the same height */
  overflow: hidden; /* Prevent any overflow */
}

.customservice-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
}

.customservice-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

.customservice-content h4,
.customservice-content span,
.customservice-content p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Truncate to one line */
  width: 100%;
  text-align: center; /* Center the text */
  min-width: 0; /* Allow shrinking to prevent overflow */
}

.customservice-content h4 {
  font-size: 20px;
  font-weight: bold;
  font-family: 'Raleway', Arial, sans-serif;
  color: #333;
}

.customservice-content span {
  font-size: 16px;
  font-weight: 600;
  font-family: 'Raleway', Arial, sans-serif;
  color: #242323;
}

.customservice-content p {
  font-size: 14px;
  font-family: 'Raleway', Arial, sans-serif;
  color: #555;
  margin: 10px 0 20px 0;
}

.customservice-price {
  font-size: 18px;
  color: green;
  font-weight: bold;
  white-space: nowrap; /* Ensure no wrapping */
  min-width: 0; /* Allow shrinking */
}

.customservice-enroll-btn {
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.3s;
  white-space: nowrap; /* Ensure no wrapping */
  min-width: 0; /* Allow shrinking */
}

.customservice-enroll-btn:hover {
  background-color: #218838;
}

/* Ensure .customservice-info is a flex container */
.customservice-info {
  display: flex;
  justify-content: space-between; /* Space elements evenly */
  align-items: center;
  width: 100%;
  margin-top: auto; /* Pushes the info section to the bottom */
  gap: 10px; /* Adds space between price and button */
  flex-wrap: wrap; /* Prevents overflow on smaller screens */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .customservice-section {
    padding: 50px 0;
  }

  .page-title h1 {
    font-size: 28px;
  }

  .category-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .category-form select {
    width: 100%;
    min-width: unset; /* Remove min-width on smaller screens */
  }

  /* Adjust text alignment if needed */
  .customservice-content h4,
  .customservice-content span,
  .customservice-content p {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .customservice-section {
    padding: 40px 0;
  }

  .page-title h1 {
    font-size: 24px;
  }

  .customservice-content h4 {
    font-size: 18px;
  }

  .customservice-content span {
    font-size: 14px;
  }

  .customservice-content p {
    font-size: 12px;
    margin: 8px 0 16px 0;
  }

  .customservice-price {
    font-size: 16px;
  }

  .customservice-enroll-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .customservice-section {
    padding: 30px 0;
  }

  .page-title h1 {
    font-size: 20px;
  }

  .customservice-content h4 {
    font-size: 16px;
  }

  .customservice-content span {
    font-size: 12px;
  }

  .customservice-content p {
    font-size: 11px;
    margin: 6px 0 12px 0;
  }

  .customservice-price {
    font-size: 14px;
  }

  .customservice-enroll-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}
