/**
 * Bookshop Essential — Back in Stock Notifications Styling
 *
 * Scoped styling for the frontend restock notification modal and triggers.
 * Compatible with any standard WooCommerce theme and BookRivo.
 *
 * @package Bookshop_Essential
 * @version 1.4.1
 */

/* Modal Backdrop Container */
.bookshop-stock-modal,
.projonmo-stock-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* Semi-Transparent Overlay */
.bookshop-stock-overlay,
.projonmo-stock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 35, 27, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
}

/* Dialog Box */
.bookshop-stock-dialog,
.projonmo-stock-dialog {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  padding: 24px 22px;
  box-sizing: border-box;
  z-index: 2;
  font-family: "Noto Sans Bengali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #24352d;
  line-height: 1.5;
  animation: bookshopModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bookshopModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header & Title */
.bookshop-stock-header,
.projonmo-stock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f3f1;
}

.bookshop-stock-title,
.projonmo-stock-title,
.bookshop-stock-header h3,
.projonmo-stock-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #12372D;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}

.bookshop-stock-title .dashicons,
.projonmo-stock-title .dashicons {
  color: #12372D;
  font-size: 20px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Close Button */
.bookshop-stock-close,
.projonmo-stock-close {
  position: relative;
  background: #f1f4f2;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #4a5d55;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.bookshop-stock-close:hover,
.projonmo-stock-close:hover,
.bookshop-stock-close:focus,
.projonmo-stock-close:focus {
  background: #e2e8e5;
  color: #12372D;
  outline: none;
}

/* Introductory Copy & Product Name */
.bookshop-stock-intro,
.projonmo-stock-intro {
  font-size: 13px;
  color: #555555;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.bookshop-stock-product-name,
.projonmo-stock-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #8c6a28;
  margin: 0 0 16px 0;
  line-height: 1.4;
  word-break: break-word;
}

/* Form Layout */
.bookshop-stock-form,
.projonmo-stock-form {
  margin: 0;
  padding: 0;
}

.bookshop-stock-body,
.projonmo-stock-body {
  margin-bottom: 16px;
}

/* Form Field Groups (Strictly Vertical Alignment) */
.bookshop-stock-field,
.projonmo-stock-field,
.bookshop-stock-form .form-group,
.projonmo-stock-form .form-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  margin-bottom: 15px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Labels */
.bookshop-stock-field label,
.projonmo-stock-field label,
.bookshop-stock-form .form-group label,
.projonmo-stock-form .form-group label {
  display: block !important;
  width: 100% !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #2b3933 !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  cursor: pointer;
}

.bookshop-stock-field label .required,
.projonmo-stock-field label .required,
.bookshop-stock-form .form-group label .required,
.projonmo-stock-form .form-group label .required-note {
  color: #b91c1c !important;
  font-weight: 700 !important;
  margin-left: 2px;
}

/* Full-Width Text, Tel, and Email Inputs */
.bookshop-stock-input,
.projonmo-stock-input,
.projonmo-stock-form .stock-input,
.bookshop-stock-form input[type="tel"],
.bookshop-stock-form input[type="email"],
.bookshop-stock-form input[type="text"],
.projonmo-stock-form input[type="tel"],
.projonmo-stock-form input[type="email"],
.projonmo-stock-form input[type="text"] {
  display: block !important;
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  line-height: 44px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border: 1.5px solid #d5ded9 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  font-size: 14px !important;
  font-family: "Noto Sans Bengali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: #24352d !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Input Focus States */
.bookshop-stock-input:focus,
.projonmo-stock-input:focus,
.projonmo-stock-form .stock-input:focus,
.bookshop-stock-form input[type="tel"]:focus,
.bookshop-stock-form input[type="email"]:focus,
.bookshop-stock-form input[type="text"]:focus,
.projonmo-stock-form input[type="tel"]:focus,
.projonmo-stock-form input[type="email"]:focus,
.projonmo-stock-form input[type="text"]:focus {
  border-color: #12372D !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(18, 55, 45, 0.12) !important;
  background-color: #ffffff !important;
}

/* Helper Text (Placed Strictly BELOW the input) */
.field-hint,
.bookshop-stock-hint,
.bookshop-stock-field small,
.projonmo-stock-field small,
.bookshop-stock-form .form-group small,
.projonmo-stock-form .form-group small {
  display: block !important;
  width: 100% !important;
  font-size: 11.5px !important;
  color: #66756e !important;
  margin-top: 5px !important;
  margin-bottom: 0 !important;
  line-height: 1.35 !important;
}

/* Submit Button */
.bookshop-stock-footer,
.projonmo-stock-footer {
  margin-top: 8px;
  width: 100%;
}

.bookshop-stock-submit-btn,
.stock-submit-btn,
.bookshop-stock-form #projonmoStockSubmitBtn,
.projonmo-stock-form #projonmoStockSubmitBtn,
.bookshop-stock-form button[type="submit"],
.projonmo-stock-form button[type="submit"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 46px !important;
  height: 46px !important;
  background: #12372D !important;
  background-color: #12372D !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: "Noto Sans Bengali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  padding: 0 20px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(18, 55, 45, 0.18) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.bookshop-stock-submit-btn:hover,
.stock-submit-btn:hover,
.bookshop-stock-form #projonmoStockSubmitBtn:hover,
.projonmo-stock-form #projonmoStockSubmitBtn:hover,
.bookshop-stock-form button[type="submit"]:hover,
.projonmo-stock-form button[type="submit"]:hover {
  background: #1b4d40 !important;
  background-color: #1b4d40 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(18, 55, 45, 0.25) !important;
}

.bookshop-stock-submit-btn:active,
.stock-submit-btn:active,
.bookshop-stock-form #projonmoStockSubmitBtn:active,
.projonmo-stock-form #projonmoStockSubmitBtn:active {
  transform: translateY(0);
}

.bookshop-stock-submit-btn:focus,
.stock-submit-btn:focus,
.bookshop-stock-form #projonmoStockSubmitBtn:focus,
.projonmo-stock-form #projonmoStockSubmitBtn:focus {
  outline: 2px solid #12372D !important;
  outline-offset: 2px !important;
}

.bookshop-stock-submit-btn:disabled,
.stock-submit-btn:disabled,
.bookshop-stock-form #projonmoStockSubmitBtn:disabled,
.projonmo-stock-form #projonmoStockSubmitBtn:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Feedback / Messages */
.bookshop-stock-feedback,
.projonmo-stock-feedback {
  padding: 11px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  margin-top: 12px !important;
  margin-bottom: 6px !important;
  box-sizing: border-box !important;
}

.bookshop-stock-feedback.is-error,
.projonmo-stock-feedback.is-error {
  background: #fef2f2 !important;
  border: 1px solid #f87171 !important;
  color: #991b1b !important;
}

.bookshop-stock-feedback.is-success,
.projonmo-stock-feedback.is-success {
  background: #f0fdf4 !important;
  border: 1px solid #4ade80 !important;
  color: #166534 !important;
}

/* Body Modal Lock */
body.projonmo-modal-open,
body.bookshop-modal-open {
  overflow: hidden !important;
}

/* Responsive Overrides */
@media (max-width: 480px) {
  .bookshop-stock-modal,
  .projonmo-stock-modal {
    padding: 12px;
  }

  .bookshop-stock-dialog,
  .projonmo-stock-dialog {
    padding: 20px 16px;
    border-radius: 10px;
    max-height: calc(100vh - 24px);
  }

  .bookshop-stock-title,
  .projonmo-stock-title,
  .bookshop-stock-header h3,
  .projonmo-stock-header h3 {
    font-size: 16px;
  }

  .bookshop-stock-input,
  .projonmo-stock-input,
  .projonmo-stock-form .stock-input,
  .bookshop-stock-form input[type="tel"],
  .bookshop-stock-form input[type="email"],
  .bookshop-stock-form input[type="text"],
  .projonmo-stock-form input[type="tel"],
  .projonmo-stock-form input[type="email"],
  .projonmo-stock-form input[type="text"] {
    height: 44px !important;
    min-height: 44px !important;
    line-height: 42px !important;
    font-size: 14px !important;
  }

  .bookshop-stock-submit-btn,
  .stock-submit-btn,
  .bookshop-stock-form #projonmoStockSubmitBtn,
  .projonmo-stock-form #projonmoStockSubmitBtn,
  .bookshop-stock-form button[type="submit"],
  .projonmo-stock-form button[type="submit"] {
    min-height: 44px !important;
    height: 44px !important;
    font-size: 14.5px !important;
  }
}
