/* Professional Service Cards - Responsive Design */
/* Desktop: 3-4 columns | Tablet: 2 columns | Mobile: 1 column or slider */

/* Services Grid Container */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 1rem;
  width: 100%;
}

/* Service Card Base Styles */
.service-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  border: 1px solid #eee;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Service Card Hover Effects */
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(31, 122, 90, 0.15);
  border-color: #1F7A5A;
}

/* Service Image Container */
.service-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

/* Service Image */
.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Image Hover Effect */
.service-card:hover .service-image img {
  transform: scale(1.05);
}

/* Image Overlay */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 122, 90, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-weight: 500;
}

/* Overlay Hover */
.service-card:hover .overlay {
  opacity: 1;
}

/* Service Content */
.service-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Service Title */
.service-title {
  color: #1F7A5A;
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Service Description */
.service-description {
  color: #666;
  margin: 0 0 1.2rem 0;
  line-height: 1.6;
  flex-grow: 1;
}

/* Service Meta (price and button) */
.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Service Price */
.service-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #C9A24D;
}

/* Details Button */
.service-details-btn {
  padding: 0.6rem 1.2rem;
  background: #1F7A5A;
  color: white;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.service-details-btn:hover {
  background: #1A634A;
  transform: translateY(-2px);
}

/* Touch-friendly styles for mobile */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover {
    transform: none;
  }
  
  .service-card:active {
    transform: translateY(-4px);
  }
  
  .service-details-btn {
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
  }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .service-image {
    aspect-ratio: 16 / 9;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .service-card {
    max-width: 100%;
  }
  
  .service-image {
    aspect-ratio: 16 / 9;
  }
  
  .service-content {
    padding: 1.2rem;
  }
  
  .service-title {
    font-size: 1.2rem;
  }
  
  .service-description {
    font-size: 0.95rem;
  }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
  .services-grid {
    padding: 0.5rem;
    gap: 1rem;
  }
  
  .service-content {
    padding: 1rem;
  }
  
  .service-title {
    font-size: 1.1rem;
  }
  
  .service-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }
  
  .service-details-btn {
    width: 100%;
    text-align: center;
  }
}

/* Horizontal Slider for Mobile (Alternative Option) */
.services-slider {
  display: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 1rem 0;
}

.services-slider::-webkit-scrollbar {
  display: none;
}

.slider-container {
  display: flex;
  gap: 1rem;
  padding: 0 1rem;
}

.slider-card {
  flex: 0 0 calc(85% - 0.5rem);
  scroll-snap-align: start;
}

@media (max-width: 768px) {
  .services-grid-mobile {
    display: none;
  }
  
  .services-slider {
    display: block;
  }
}

/* Loading States */
.service-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.service-card.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Error States */
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  color: #c53030;
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #e53e3e;
}

/* Accessibility */
.service-card:focus-within {
  outline: 2px solid #1F7A5A;
  outline-offset: 2px;
}

.service-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.3);
}

/* Service Details Specific Styles */
.service-details-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.service-back-button {
  margin-bottom: 2rem;
}

.service-details-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.service-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  background-color: #f8f9fa; /* Fallback background */
  /* Ensure proper image containment */
  contain: layout style paint;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
  /* Ensure high-quality image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Prevent image dragging */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
}

.service-image img:hover {
  transform: scale(1.02);
}

/* Ensure image maintains quality */
.service-image img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.service-info {
  display: flex;
  flex-direction: column;
}

.service-title {
  font-size: 2.5rem;
  color: #1F7A5A;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.service-description {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.service-features {
  margin-bottom: 2rem;
}

.service-features h3 {
  color: #1F7A5A;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.service-features ul {
  list-style: none;
  padding: 0;
}

.service-features li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.service-features li:last-child {
  border-bottom: none;
}

.service-features li i {
  color: #1F7A5A;
  min-width: 20px;
}

.service-price {
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

.price-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.price-label {
  font-weight: 600;
  color: #495057;
}

.price-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1F7A5A;
}

.currency {
  color: #6c757d;
  font-weight: 500;
}

.error-container {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-width: 500px;
  margin: 2rem auto;
}

.loading-container {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-width: 500px;
  margin: 2rem auto;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1F7A5A;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-container p {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

.error-icon {
  font-size: 3rem;
  color: #dc3545;
  margin-bottom: 1rem;
}

.error-container h2 {
  color: #333;
  margin-bottom: 1rem;
}

.error-container p {
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Form Validation Styles */
.form-control.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.service-order-info {
  margin: 1rem 0;
}

.service-order-info .card {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 1px solid #90caf9;
}

.service-order-info h4 {
  color: #1976d2;
  margin-bottom: 0.5rem;
}

.service-order-info p {
  margin: 0.25rem 0;
  color: #333;
}

.service-order-info small {
  color: #666;
  font-size: 0.875rem;
}

/* Comprehensive Responsive Design for Service Details */

/* Tablet Landscape */
@media (max-width: 1024px) and (min-width: 769px) {
  .service-details-content {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .service-title {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
  }
  
  .service-image {
    aspect-ratio: 16/9;
  }
  
  .service-description {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
  }
}

/* Tablet Portrait */
@media (max-width: 768px) and (min-width: 481px) {
  .service-details-container {
    padding: 1.5rem;
  }
  
  .service-details-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-title {
    font-size: clamp(1.6rem, 5vw, 1.8rem);
    margin-bottom: 1rem;
  }
  
  .service-description {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .service-image {
    aspect-ratio: 16/9;
    border-radius: 12px;
  }
  
  .service-features h3 {
    font-size: 1.2rem;
  }
  
  .service-features li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
  }
  
  .price-value {
    font-size: 1.5rem;
  }
}

/* Mobile Large */
@media (max-width: 480px) and (min-width: 321px) {
  .service-details-container {
    padding: 1rem;
  }
  
  .service-details-content {
    gap: 1.25rem;
  }
  
  .service-title {
    font-size: clamp(1.4rem, 6vw, 1.6rem);
    line-height: 1.2;
  }
  
  .service-image {
    aspect-ratio: 16/9;
    border-radius: 10px;
  }
  
  .service-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  .service-features li {
    font-size: 0.9rem;
    padding: 0.4rem 0;
  }
  
  .service-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .service-actions .btn-primary,
  .service-actions .btn-accent,
  .service-actions .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 0.8rem;
  }
}

/* Mobile Small */
@media (max-width: 320px) {
  .service-details-container {
    padding: 0.75rem;
  }
  
  .service-title {
    font-size: 1.3rem;
    line-height: 1.1;
  }
  
  .service-image {
    aspect-ratio: 16/9;
    border-radius: 8px;
  }
  
  .service-description {
    font-size: 0.9rem;
  }
  
  .service-features li {
    font-size: 0.85rem;
    padding: 0.3rem 0;
  }
  
  .price-value {
    font-size: 1.2rem;
  }
  
  .service-actions .btn-primary,
  .service-actions .btn-accent,
  .service-actions .btn-secondary {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
  .service-details-container {
    max-width: 1400px;
  }
  
  .service-details-content {
    gap: 4rem;
  }
  
  .service-title {
    font-size: 2.8rem;
  }
  
  .service-image {
    aspect-ratio: 16/9;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .service-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .service-image {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  }
  
  .service-description {
    color: #ccc;
  }
  
  .service-features li {
    border-bottom: 1px solid #444;
  }
}

/* Print Styles */
@media print {
  .service-card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .overlay {
    display: none;
  }
}