/* 
 * Modal & Floating Buttons Styles
 */

/* Floating Buttons (Right Side) */
.floating-buttons {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 990;
}

.float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease;
  border: none;
  position: relative;
  text-decoration: none;
}

.float-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.float-btn .tooltip {
  position: absolute;
  right: 70px;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  pointer-events: none;
}

@media (hover: hover) {
  .float-btn:hover {
    transform: scale(1.1);
    background-color: var(--color-primary-dark);
  }

  .float-btn:hover svg {
    width: 24px;
    height: 24px;
    fill: var(--color-primary-dark);
  }

  .float-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
  }
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
  background-color: var(--color-white);
  padding: 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  padding: 5px;
}

.modal-title {
  margin-bottom: 20px;
  font-family: var(--font-heading);
  color: var(--color-heading);
  text-align: center;
}

.modal-description {
  text-align: center;
  margin-bottom: 20px;
}

/* Contact Form 7 Styles in Modal */
.callback-form-wrapper {
  width: 100%;
}

.callback-form-wrapper .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.callback-form-wrapper .wpcf7-form-control-wrap {
  width: 100%;
}

.callback-form-wrapper .wpcf7-form-control {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
  color: var(--color-text, #141414);
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.callback-form-wrapper .checkbox-wrapper .wpcf7-form-control {
  border: none;
}

.callback-form-wrapper .wpcf7-form-control:focus {
  outline: none;
  border-color: var(--color-text, #141414);
}

.callback-form-wrapper .wpcf7-form-control::placeholder {
  color: #999;
}

.callback-form-wrapper .wpcf7-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23141414' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 45px;
}

.callback-form-wrapper .wpcf7-textarea {
  min-height: 120px;
  resize: vertical;
}

.callback-form-wrapper .wpcf7-acceptance,
.callback-form-wrapper .wpcf7-checkbox {
  display: block;
}

.callback-form-wrapper .wpcf7-list-item {
  margin: 0;
  position: relative;
}

.callback-form-wrapper .wpcf7-list-item-label {
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
  margin: 0;
  color: var(--color-text, #141414);
  padding-left: 36px;
  position: relative;
  display: block;
}

/* Hide native checkbox completely */
.callback-form-wrapper input[type="checkbox"],
.callback-form-wrapper input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  left: 0 !important;
  top: 2px !important;
  z-index: 2;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: none !important;
  outline: none !important;
  background: none !important;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

/* Custom checkbox box */
.callback-form-wrapper .wpcf7-list-item-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: -2px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 4px;
  background-color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  z-index: 0;
  box-sizing: border-box;
}

/* Checked state - black background */
.callback-form-wrapper input[type="checkbox"]:checked + .wpcf7-list-item-label::before,
.callback-form-wrapper input[type="checkbox"]:checked ~ .wpcf7-list-item-label::before,
.callback-form-wrapper .wpcf7-list-item input[type="checkbox"]:checked + .wpcf7-list-item-label::before,
.callback-form-wrapper .wpcf7-list-item input[type="checkbox"]:checked ~ .wpcf7-list-item-label::before,
.callback-form-wrapper label input[type="checkbox"]:checked + .wpcf7-list-item-label::before,
.callback-form-wrapper label input[type="checkbox"]:checked ~ .wpcf7-list-item-label::before,
.callback-form-wrapper input[type="radio"]:checked + .wpcf7-list-item-label::before,
.callback-form-wrapper input[type="radio"]:checked ~ .wpcf7-list-item-label::before {
  background-color: var(--color-black, #141414);
  border-color: var(--color-black, #141414);
}

/* Custom checkmark */
.callback-form-wrapper .wpcf7-list-item-label::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  opacity: 0;
}

/* Checked state - show checkmark */
.callback-form-wrapper input[type="checkbox"]:checked + .wpcf7-list-item-label::after,
.callback-form-wrapper input[type="checkbox"]:checked ~ .wpcf7-list-item-label::after,
.callback-form-wrapper .wpcf7-list-item input[type="checkbox"]:checked + .wpcf7-list-item-label::after,
.callback-form-wrapper .wpcf7-list-item input[type="checkbox"]:checked ~ .wpcf7-list-item-label::after,
.callback-form-wrapper label input[type="checkbox"]:checked + .wpcf7-list-item-label::after,
.callback-form-wrapper label input[type="checkbox"]:checked ~ .wpcf7-list-item-label::after,
.callback-form-wrapper input[type="radio"]:checked + .wpcf7-list-item-label::after,
.callback-form-wrapper input[type="radio"]:checked ~ .wpcf7-list-item-label::after {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}

/* Hover effect */
@media (hover: hover) {
  .callback-form-wrapper .wpcf7-list-item-label:hover::before {
    border-color: var(--color-black, #141414);
  }
  
  .callback-form-wrapper input[type="checkbox"]:hover + .wpcf7-list-item-label::before,
  .callback-form-wrapper input[type="checkbox"]:hover ~ .wpcf7-list-item-label::before {
    border-color: var(--color-black, #141414);
  }
}

.callback-form-wrapper .wpcf7-submit {
  width: 100%;
  padding: 16px 28px;
  background-color: var(--color-black, #141414);
  color: #fff;
  border: 1px solid var(--color-black, #141414);
  border-radius: 8px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

@media (hover: hover) {
  .callback-form-wrapper .wpcf7-submit:hover {
    background-color: transparent;
    color: var(--color-black, #141414);
  }
}

.callback-form-wrapper .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.callback-form-wrapper .wpcf7-response-output {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.callback-form-wrapper .wpcf7-mail-sent-ok {
  background-color: #e7f7ed;
  color: #00a32a;
  border: 1px solid #c3e6cb;
}

.callback-form-wrapper .wpcf7-mail-sent-ng,
.callback-form-wrapper .wpcf7-aborted,
.callback-form-wrapper .wpcf7-spam,
.callback-form-wrapper .wpcf7-validation-errors {
  background-color: #fbeaea;
  color: #dc3232;
  border: 1px solid #dc3232;
}

.callback-form-wrapper .wpcf7-not-valid-tip {
  font-size: 0.75rem;
  color: #dc3232;
  margin-top: 5px;
  display: block;
}

.callback-form-wrapper .wpcf7-not-valid {
  border-color: #dc3232 !important;
}

/* Лоадер - красивий overlay з спіннером */
.callback-form-wrapper .wpcf7-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  margin: 0 !important;
}

/* Спіннер всередині */
.callback-form-wrapper .wpcf7-spinner::before {
  content: '';
  width: 48px;
  height: 48px;
  border: 4px solid rgba(20, 20, 20, 0.1);
  border-top-color: var(--color-black, #141414);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Анімація обертання */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.callback-form-wrapper .form-group p {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .floating-buttons {
    bottom: 15px;
    right: 15px;
    gap: 10px;
  }

  .float-btn {
    width: 50px;
    height: 50px;
  }

  .modal-content {
    margin: 20px;
    padding: 30px 20px;
  }
}