/* ===================================== */
/* SERVICES SECTION UI OPTIMIZATION      */
/* Fixed Overlapping Issues              */
/* ===================================== */

/* Services Section - Improved Layout */
.services-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #fce4ec 100%);
  position: relative;
  overflow: hidden;
}

/* Container - Better spacing */
.services-section .container {
  max-width: 1400px; /* Increased max width */
  margin: 0 auto;
  padding: 0 20px; /* Consistent padding */
}

/* Section Header - Improved spacing */
.services-section .section-header {
  text-align: center;
  margin-bottom: 80px; /* Increased margin */
}

.services-section .section-badge {
  display: inline-block;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.services-section .section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

.services-section .section-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #666;
  max-width: 800px; /* Increased max width */
  margin: 0 auto;
  line-height: 1.6;
}

/* Services Grid - Fixed Layout */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); /* Increased min width */
  gap: 40px; /* Increased gap */
  margin-bottom: 80px;
  align-items: stretch; /* Ensure equal heights */
  /* Fixed overlapping with better spacing */
  grid-auto-rows: minmax(550px, auto); /* Increased minimum height for full content */
}

/* Service Card - Fixed Overlapping Issues */
.service-card {
  position: relative;
  height: auto; /* Changed from fixed height */
  min-height: 550px; /* Increased minimum height for full content */
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 20px; /* Added margin for safety */
  z-index: 1; /* Base z-index */
  transition: z-index 0.3s ease;
}

/* Fix z-index when hovering to prevent overlapping */
.service-card:hover {
  z-index: 10; /* Elevated z-index on hover */
}

.service-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 550px; /* Increased minimum height for full content */
  text-align: center;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
  transform: rotateY(180deg);
}

/* Card Front & Back - Improved Layout */
.service-card-front,
.service-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 550px; /* Increased minimum height for full content */
  backface-visibility: hidden;
  background: white;
  border-radius: 15px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(233, 30, 99, 0.15);
  border: 1px solid rgba(233, 30, 99, 0.1);
  /* Fixed overlapping */
  overflow: visible; /* Changed to visible to show all content */
}

.service-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
}

/* Service Icon - Better positioning */
.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 25px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
  flex-shrink: 0; /* Prevent shrinking */
}

/* Service Content - Better spacing */
.service-title {
  font-size: clamp(1.3rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
}

.service-description {
  color: #666;
  line-height: 1.7;
  margin-bottom: 25px;
  flex-grow: 1;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Service Features - Better layout */
.service-features {
  margin-bottom: 25px;
  text-align: left;
  /* FORCE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.feature-item {
  display: flex;
  align-items: flex-start; /* Changed to flex-start */
  margin-bottom: 12px;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  line-height: 1.5;
}

.feature-item i {
  color: #e91e63;
  margin-right: 12px;
  font-size: 12px;
  margin-top: 4px; /* Align with text */
  flex-shrink: 0;
}

/* Service Price - Better styling */
.service-price {
  text-align: center;
  padding: 20px 15px;
  background: rgba(233, 30, 99, 0.05);
  border-radius: 10px;
  margin-top: auto;
  border: 1px solid rgba(233, 30, 99, 0.1);
  /* ENSURE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.price-label {
  font-size: 14px;
  color: #666;
  display: block;
  margin-bottom: 5px;
  /* ENSURE VISIBILITY */
  visibility: visible !important;
  opacity: 1 !important;
}

.price-amount {
  font-size: clamp(1.5rem, 4vw, 1.8rem);
  font-weight: 700;
  color: #e91e63;
  display: block;
  margin-bottom: 5px;
  /* ENSURE VISIBILITY */
  visibility: visible !important;
  opacity: 1 !important;
}

.price-currency {
  font-size: 14px;
  color: #666;
  /* ENSURE VISIBILITY */
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===================================== */
/* FORCE VISIBILITY FOR ALL SERVICE INFO */
/* ===================================== */

/* Ensure service features are visible */
.service-features {
  margin-bottom: 25px;
  text-align: left;
  /* FORCE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure pricing lists are visible */
.pricing-list,
.event-types,
.occasion-list,
.course-modules {
  margin-bottom: 25px;
  flex-grow: 1;
  /* FORCE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure pricing items are visible */
.pricing-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  /* FORCE VISIBILITY */
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure all item names and prices are visible */
.item-name,
.item-price {
  /* FORCE VISIBILITY */
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure service highlights are visible */
.service-highlight,
.pricing-note {
  /* FORCE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: clamp(0.8rem, 1.7vw, 0.9rem);
}

/* Ensure back content header is visible */
.back-content h4 {
  color: white;
  margin-bottom: 25px;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  /* FORCE VISIBILITY */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pricing-item:last-child {
  border-bottom: none;
}

.event-type,
.occasion-item,
.module-item {
  display: flex;
  align-items: flex-start; /* Better alignment */
  margin-bottom: 12px;
  color: white;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  line-height: 1.5;
}

.event-type i,
.occasion-item i,
.module-item i {
  margin-right: 12px;
  opacity: 0.8;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Card Back Content - Better spacing */
.back-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Back CTA - Better button layout */
.back-cta {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  text-align: center;
  justify-content: center;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.3);
}

.btn-secondary {
  background: transparent;
  color: #e91e63;
  border: 2px solid #e91e63;
}

.btn-secondary:hover {
  background: #e91e63;
  color: white;
}

.btn-white {
  background: white;
  color: #e91e63;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.btn-small {
  padding: 10px 16px;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  flex: 1;
}

.btn-large {
  padding: 16px 32px;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Service Badges - Fixed positioning */
.service-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
  padding: 8px 14px;
  border-radius: 15px;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  font-weight: 600;
  z-index: 3; /* Higher z-index to stay on top */
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
  white-space: nowrap;
}

.popular-badge {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.new-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.special-badge {
  background: linear-gradient(135deg, #ff6b9d, #e91e63);
}

.elegant-badge {
  background: linear-gradient(135deg, #6a1b9a, #9c27b0);
}

/* Services CTA - Better spacing */
.services-cta {
  text-align: center;
  margin-top: 80px;
  background: white;
  border-radius: 20px;
  padding: 50px 30px;
  box-shadow: 0 15px 40px rgba(233, 30, 99, 0.1);
  border: 1px solid rgba(233, 30, 99, 0.05);
}

.cta-content {
  margin-bottom: 40px;
}

.cta-title {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  font-family: 'Playfair Display', serif;
}

.cta-description {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  color: #666;
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* Special Offer Link - Improved design */
.services-special-offer {
  margin-top: 50px;
}

.special-wheel-link {
  display: block;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border-radius: 15px;
  padding: 30px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid #e91e63;
  position: relative;
  overflow: hidden;
}

.special-wheel-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(233, 30, 99, 0.2);
  border-color: #c2185b;
}

.wheel-link-content {
  display: flex;
  align-items: center;
  gap: 25px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.wheel-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.3);
}

.wheel-text {
  flex-grow: 1;
  text-align: left;
}

.wheel-title {
  display: block;
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-weight: 700;
  color: #e91e63;
  margin-bottom: 8px;
}

.wheel-subtitle {
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  color: #333;
  margin-bottom: 8px;
}

.wheel-features {
  display: block;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: #666;
  line-height: 1.4;
}

.wheel-arrow {
  color: #e91e63;
  font-size: 1.8rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.special-wheel-link:hover .wheel-arrow {
  transform: translateX(5px);
}

/* ===================================== */
/* RESPONSIVE DESIGN - MOBILE FIRST      */
/* ===================================== */

/* Mobile Styles (up to 767px) */
@media (max-width: 767px) {
  .services-section {
    padding: 60px 0;
  }
  
  .services-section .container {
    padding: 0 15px;
  }
  
  .services-section .section-header {
    margin-bottom: 50px;
  }
  
  .services-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 30px;
    margin-bottom: 60px;
    grid-auto-rows: minmax(500px, auto); /* Adequate height for mobile */
  }
  
  .service-card {
    min-height: 500px; /* Adequate height for mobile content */
    margin-bottom: 15px;
  }
  
  .service-card-inner,
  .service-card-front,
  .service-card-back {
    min-height: 500px; /* Ensure all content is visible */
  }
  
  .service-card-front,
  .service-card-back {
    padding: 25px 20px;
  }
  
  .service-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    font-size: 1.8rem;
  }
  
  .service-features {
    text-align: center; /* Center on mobile */
  }
  
  .back-cta {
    flex-direction: column;
    gap: 10px;
  }
  
  .services-cta {
    padding: 40px 20px;
    margin-top: 60px;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .wheel-link-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .wheel-text {
    text-align: center;
  }
  
  .wheel-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  /* MOBILE: Show both front and back content */
  .service-card:hover .service-card-inner {
    transform: none; /* Disable flip on mobile */
  }
  
  .service-card {
    height: auto;
  }
  
  /* MOBILE: Stack front and back content */
  .service-card-back {
    position: static;
    transform: none;
    margin-top: 20px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    border-radius: 15px;
    /* ENSURE ALL BACK CONTENT IS VISIBLE ON MOBILE */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* MOBILE: Ensure pricing content is visible */
  .pricing-list,
  .event-types,
  .occasion-list,
  .course-modules {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
  .services-grid {
    gap: 25px;
    grid-auto-rows: minmax(480px, auto); /* Adequate height for small mobile */
  }
  
  .service-card {
    min-height: 480px; /* Adequate height for small mobile content */
  }
  
  .service-card-inner,
  .service-card-front,
  .service-card-back {
    min-height: 480px; /* Ensure all content is visible */
  }
  
  .service-card-front,
  .service-card-back {
    padding: 20px 15px;
  }
  
  .services-cta {
    padding: 30px 15px;
  }
  
  .special-wheel-link {
    padding: 25px 20px;
  }
  
  .wheel-link-content {
    gap: 15px;
  }
  
  /* SMALL MOBILE: Ensure all pricing info is visible */
  .pricing-list,
  .event-types,
  .occasion-list,
  .course-modules {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .pricing-item {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Tablet Styles (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
    grid-auto-rows: minmax(520px, auto); /* Adequate height for tablet */
  }
  
  .service-card {
    min-height: 520px; /* Adequate height for tablet content */
  }
  
  .service-card-inner,
  .service-card-front,
  .service-card-back {
    min-height: 520px; /* Ensure all content is visible */
  }
  
  .wheel-link-content {
    gap: 20px;
  }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    grid-auto-rows: minmax(550px, auto); /* Full height for desktop */
  }
  
  .service-card {
    min-height: 550px; /* Full height for desktop content */
  }
  
  .service-card-inner,
  .service-card-front,
  .service-card-back {
    min-height: 550px; /* Ensure all content is visible */
  }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
  .services-section .container {
    max-width: 1400px;
    padding: 0 30px;
  }
  
  .services-grid {
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns on large screens */
    gap: 45px;
  }
}

/* Extra Large Desktop (1400px and up) */
@media (min-width: 1400px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr); /* Maintain 3 columns */
    max-width: 1200px; /* Limit grid width */
    margin: 0 auto 80px; /* Center the grid */
  }
}

/* ===================================== */
/* ACCESSIBILITY IMPROVEMENTS            */
/* ===================================== */

/* Focus States */
.service-card:focus-within {
  outline: 2px solid #e91e63;
  outline-offset: 4px;
  border-radius: 15px;
}

.btn:focus {
  outline: 2px solid #e91e63;
  outline-offset: 2px;
}

.special-wheel-link:focus {
  outline: 2px solid #e91e63;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .service-card-front,
  .service-card-back {
    border: 2px solid #000;
  }
  
  .service-badge {
    background: #000;
    color: #fff;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-card-inner,
  .btn,
  .special-wheel-link,
  .wheel-arrow {
    transition: none;
    animation: none;
  }
  
  .service-card:hover .service-card-inner {
    transform: none;
  }
  
  .service-card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .special-wheel-link:hover {
    transform: none;
  }
  
  .special-wheel-link:hover .wheel-arrow {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .services-section {
    background: none;
    padding: 40px 0;
  }
  
  .service-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .service-card-back {
    display: none; /* Hide back content when printing */
  }
  
  .services-cta,
  .services-special-offer {
    display: none; /* Hide CTAs when printing */
  }
}