/**
 * @file
 * Custom Callback Popup and Informer Widget Styles.
 */

/* ==========================================================================
Modal Layout & Container
========================================================================== */

#cart-callback-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal visibility states */
.cart-popup-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cart-popup-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Semi-transparent backdrop overlay */
.cart-popup-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  transition: opacity 0.3s ease;
}

/* ==========================================================================
Modal Content Box
========================================================================== */

.cart-popup-content {
  position: relative;
  background: #ffffff;
  padding: 40px 30px 30px;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  border-top: 6px solid #205736;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pop-in animation when visible */
.cart-popup-visible .cart-popup-content {
  transform: scale(1) translateY(0);
}

.popup-intro-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.4;
}

/* Close button */
.cart-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.cart-popup-close:hover {
  color: #d25f0e;
  transform: rotate(90deg) scale(1.15);
}

.cart-popup-close:active {
  transform: rotate(90deg) scale(0.9);
  color: #b9520b;
}

/* ==========================================================================
Form Controls
========================================================================== */

/* Phone input field */
.cart-popup-content input[type="tel"] {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cart-popup-content div:has(input[type="tel"]) {
  margin-top: 0 !important;
}

.cart-popup-content input[type="tel"]:focus {
  border-color: #205736;
  outline: none;
  box-shadow: 0 0 8px rgba(32, 87, 54, 0.3);
}

/* Submit button */
.cart-popup-content input[type="submit"],
.cart-popup-content button[type="submit"] {
  background-color: #205736;
  color: #ffffff;
  border: none;
  border-radius: 25px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 10px rgba(32, 87, 54, 0.2);
  outline: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cart-popup-content input[type="submit"]:hover,
.cart-popup-content button[type="submit"]:hover {
  background-color: #174229;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(32, 87, 54, 0.3);
}

.cart-popup-content input[type="submit"]:active,
.cart-popup-content button[type="submit"]:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 5px rgba(32, 87, 54, 0.2);
  background-color: #12331f;
}

/* ==========================================================================
Floating Informer Widget (FAB)
========================================================================== */

.cart-informer-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999;
  background-color: #d25f0e;
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(210, 95, 14, 0.4);
  outline: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cart-informer-btn:hover {
  background-color: #b9520b;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(210, 95, 14, 0.5);
}

.cart-informer-btn:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 2px 6px rgba(210, 95, 14, 0.3);
  background-color: #a04508;
}

/* ==========================================================================
Validation Error States
========================================================================== */

.phone-validation-error {
  display: none;
  width: 100%;
  color: #d9534f;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: left;
  line-height: 1.2;
}

.phone-validation-error.is-visible {
  display: block !important;
}

.cart-popup-content input[name="phone_number"].input-error {
  border-color: #d9534f !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 5px rgba(217, 83, 79, 0.3) !important;
}

/* ==========================================================================
Page-Specific Adjustments (Cart & Checkout)
========================================================================== */

/* Adjust scroll-to-top button clearance to prevent overlap with the FAB widget */
body.path-cart .material-scrolltop.reveal,
body.path-checkout .material-scrolltop.reveal {
  bottom: 100px;
}