/* Online Consultation Modal Styles */
.consultation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 42, 67, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start; /* Start from top to allow scrolling */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem 1rem;
  overflow-y: auto; /* Scroll at modal level */
}

.consultation-modal.active {
  opacity: 1;
  visibility: visible;
}

.consultation-container {
  background: #fff;
  width: 100%;
  max-width: 960px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px 1fr;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.97);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto; /* Center in scrollable area */
}

.consultation-modal.active .consultation-container {
  transform: translateY(0) scale(1);
}

/* ========== LEFT: Info & Steps Side ========== */
.consultation-info {
  background: linear-gradient(
    160deg,
    var(--secondary-color) 0%,
    var(--primary-color) 100%
  );
  color: #fff;
  padding: 2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: visible;
}

.consultation-info::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.consultation-info::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.consultation-info h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.consultation-info > p {
  opacity: 0.85;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.consultation-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}

.step-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.step-number {
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.step-text h4 {
  margin: 0 0 0.15rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.step-text p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.8;
  line-height: 1.35;
}

/* ========== RIGHT: Form Side ========== */
.consultation-form-side {
  padding: 2rem 2.5rem;
  position: relative;
  background: #fff;
  overflow-y: auto;
  max-height: 90vh;
}

/* Custom scrollbar for form side */
.consultation-form-side::-webkit-scrollbar {
  width: 5px;
}

.consultation-form-side::-webkit-scrollbar-track {
  background: transparent;
}

.consultation-form-side::-webkit-scrollbar-thumb {
  background: rgba(42, 122, 130, 0.2);
  border-radius: 10px;
}

.consultation-form-side::-webkit-scrollbar-thumb:hover {
  background: rgba(42, 122, 130, 0.4);
}

.close-consultation {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-main);
  z-index: 2;
}

.close-consultation:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
  color: var(--primary-color);
}

.consultation-form-side h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
  font-weight: 700;
  padding-right: 2.5rem;
}

.consultation-form-side .subtitle {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ========== Form Elements ========== */
.consultation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.consultation-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0;
}

.consultation-form .form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-left: 2px;
  letter-spacing: 0.02em;
}

.consultation-form .form-group input,
.consultation-form .form-group select,
.consultation-form .form-group textarea {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  color: var(--text-main);
  width: 100%;
  box-sizing: border-box;
}

.consultation-form .form-group input::placeholder,
.consultation-form .form-group textarea::placeholder {
  color: #94a3b8;
}

.consultation-form .form-group input:focus,
.consultation-form .form-group select:focus,
.consultation-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 122, 130, 0.1);
}

.consultation-form .form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.consultation-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ========== Submit Button ========== */
.submit-consultation {
  margin-top: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.submit-consultation::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.5s ease;
}

.submit-consultation:hover::before {
  left: 100%;
}

.submit-consultation:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(42, 122, 130, 0.4);
}

.submit-consultation:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

/* Tablet & smaller — single column */
@media (max-width: 992px) {
  .consultation-modal {
    padding: 0.5rem;
  }

  .consultation-container {
    grid-template-columns: 1fr;
    max-height: none;
  }

  /* Make container itself scroll, not individual sections */
  .consultation-form-side {
    overflow-y: visible;
    max-height: none;
  }

  .consultation-info {
    padding: 1.25rem 1rem;
    overflow: visible;
  }

  .consultation-info h2 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
  }

  .consultation-info > p {
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  /* 2x2 compact grid for steps on tablet */
  .consultation-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .step-item {
    padding: 0.45rem 0.5rem;
    gap: 0.5rem;
    border-radius: 8px;
  }

  .step-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.7rem;
  }

  .step-text h4 {
    font-size: 0.78rem;
    margin-bottom: 0;
  }

  .step-text p {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .consultation-form-side {
    padding: 1.5rem 1.5rem;
  }

  .consultation-form-side h3 {
    font-size: 1.25rem;
  }

  .consultation-form-side .subtitle {
    margin-bottom: 1rem;
    font-size: 0.85rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .consultation-modal {
    padding: 0;
    align-items: flex-end;
  }

  .consultation-container {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .consultation-info {
    padding: 1.5rem 1.25rem;
    display: block;
    height: auto;
  }

  .consultation-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
  }

  .consultation-info > p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }

  .consultation-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
  }

  .step-item {
    padding: 0.35rem 0.45rem;
    gap: 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .step-number {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 0.65rem;
  }

  .step-text h4 {
    font-size: 0.75rem;
    margin-bottom: 0;
  }

  .step-text p {
    font-size: 0.65rem;
    line-height: 1.2;
  }

  .consultation-form-side {
    padding: 1.25rem;
  }

  .consultation-form-side h3 {
    font-size: 1.15rem;
  }

  .consultation-form-side .subtitle {
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
  }

  .consultation-form {
    gap: 0.75rem;
  }

  .consultation-form .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .consultation-form .form-group input,
  .consultation-form .form-group select,
  .consultation-form .form-group textarea {
    padding: 0.6rem 0.75rem;
    font-size: 16px; /* Prevent iOS zoom */
    border-radius: 8px;
  }

  .consultation-form .form-group label {
    font-size: 0.75rem;
  }

  .consultation-form .form-group textarea {
    min-height: 50px;
  }

  .submit-consultation {
    padding: 0.75rem;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .close-consultation {
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .consultation-info {
    padding: 1rem;
  }

  .consultation-info h2 {
    font-size: 1.1rem;
  }

  .consultation-info > p {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .step-text h4 {
    font-size: 0.72rem;
  }

  .step-text p {
    font-size: 0.65rem;
  }

  .consultation-form-side {
    padding: 1rem;
  }

  .consultation-form-side h3 {
    font-size: 1.05rem;
  }
}

/* Spinner animation for submit button */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========== SERVICES GALLERY MODAL ========== */
.services-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 42, 67, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1rem;
  overflow-y: auto;
  pointer-events: none;
  padding-top: 2rem;
}

.services-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.services-modal-container {
  background: #fff;
  width: 100%;
  max-width: 900px;
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.97);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 2rem;
  position: relative;
  margin-bottom: 2rem;
}

.services-modal.active .services-modal-container {
  transform: translateY(0) scale(1);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.services-modal-container h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-align: center;
}

.services-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.services-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  object-fit: contain;
  cursor: pointer;
  display: block;
}

.services-image:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: transform 0.2s ease;
  z-index: 10;
}

.close-modal:hover {
  transform: rotate(90deg);
}

.close-modal svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* ========== RESPONSIVE - Services Modal ========== */
@media (max-width: 768px) {
  .services-modal {
    padding: 0.5rem;
    padding-top: 1.5rem;
    align-items: flex-start;
  }

  .services-modal-container {
    padding: 1.5rem 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
  }

  .services-modal-container h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }

  .services-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .services-image {
    max-height: 400px;
  }

  .close-modal {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }

  .close-modal svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .services-modal {
    padding: 0.5rem;
    padding-top: 1rem;
  }

  .services-modal-container {
    padding: 1rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    box-shadow: 0 15px 40px -12px rgba(0, 0, 0, 0.25);
  }

  .services-modal-container h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .services-gallery {
    gap: 0.75rem;
  }

  .services-image {
    border-radius: 8px;
    max-height: 300px;
  }

  .close-modal {
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
  }

  .close-modal svg {
    width: 18px;
    height: 18px;
  }
}

/* Animation for modal entrance */
@keyframes slideUp {
  from {
    transform: translateY(30px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ========== FULL IMAGE VIEWER MODAL ========== */
.image-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 1rem;
  pointer-events: none;
}

.image-viewer-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 90vh;
}

.full-viewer-image {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-viewer-modal.active .full-viewer-image {
  animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-viewer-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
  border-radius: 50%;
  z-index: 3001;
  backdrop-filter: blur(8px);
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg) scale(1.1);
}

.image-viewer-close svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========== RESPONSIVE - Full Image Viewer ========== */
@media (max-width: 768px) {
  .image-viewer-close {
    top: 1rem;
    right: 1rem;
    padding: 0.5rem;
  }

  .image-viewer-close svg {
    width: 24px;
    height: 24px;
  }

  .full-viewer-image {
    max-height: 85vh;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .image-viewer-modal {
    padding: 0.5rem;
  }

  .image-viewer-close {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem;
  }

  .image-viewer-close svg {
    width: 20px;
    height: 20px;
  }

  .full-viewer-image {
    max-height: 80vh;
  }
}
