/* WooCommerce Check Availability Plugin Styles */

/* Button styles for owl carousel items */
.product-thumbnail .out-of-stock-label {
  font-size: 0.857em;
  text-align: center;
  line-height: 2em !important;
  min-width: 40px;
  font-weight: 700;
  position: absolute;
  margin: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
}

/* General out-of-stock label styles */
.out-of-stock-label {
  display: inline-block;
  margin-top: 16px;
  padding: 2px 10px;
  background: #ee0000;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  font-weight: bold;
}

.out-of-stock-label:hover {
  color: #fff;
  background: #d00000;
  text-decoration: none;
}

/* Legacy support for wca-check-availability-btn class */
.wca-check-availability-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 2px 10px;
  background: #ee0000;
  color: #fff !important;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

.wca-check-availability-btn:hover {
  color: #fff !important;
  background: #d00000;
  text-decoration: none;
}

/* Modal Styles */
.wca-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wca-modal-content {
  background-color: #ffffff;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: wca-modal-appear 0.3s ease-out;
}

@keyframes wca-modal-appear {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wca-modal-header {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.wca-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.wca-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
}

.wca-close:hover,
.wca-close:focus {
  color: #000;
}

.wca-modal-body {
  padding: 0 20px 20px;
}

.wca-form-group {
  margin-bottom: 20px;
}

.wca-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.wca-form-group input[type="text"],
.wca-form-group input[type="email"],
.wca-form-group textarea {
  display: block;
  width: 100%;
  padding: 0.594rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.714;
  color: #333e48;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ddd;
  appearance: none;
  border-radius: 1.375rem;
  box-shadow: 0;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.wca-form-group input[type="text"]:focus,
.wca-form-group input[type="email"]:focus,
.wca-form-group textarea:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.wca-form-group input[readonly] {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.wca-error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  padding-left: 1rem;
}

.wca-form-group.has-error input {
  border-color: #dc3545;
}

.wca-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.wca-form-actions {
  text-align: right;
  margin-top: 30px;
}

.wca-submit-btn {
  display: inline-block;
  font-weight: 400;
  line-height: 1.714;
  color: #333e48;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.594rem 1rem;
  font-size: 0.875rem;
  border-radius: 1.375rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.wca-submit-btn:hover {
  color: #333e48;
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.wca-submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.65;
}

#wca-success-message {
  text-align: center;
  padding: 20px;
}

#wca-success-message p {
  color: #0073aa;
  font-size: 16px;
  margin: 0;
}

/* Loading state */
.wca-loading .wca-submit-btn {
  position: relative;
  color: transparent;
}

.wca-loading .wca-submit-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: wca-spin 1s linear infinite;
}

@keyframes wca-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .wca-modal-content {
    width: 95%;
    margin: 10px;
  }

  .wca-modal-header,
  .wca-modal-body {
    padding-left: 15px;
    padding-right: 15px;
  }

  .wca-form-actions {
    text-align: center;
  }

  .wca-submit-btn {
    width: 100%;
  }
}
