/* Page Loading Spinner */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex !important;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.3s ease-out;
  visibility: visible !important;
  pointer-events: auto;
}

#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #098DAD;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  visibility: visible !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hide page content until loaded */
body.page-loading {
  overflow: hidden;
}

body.page-loading > *:not(#page-loader):not(script):not(style) {
  opacity: 0 !important;
  pointer-events: none !important;
}


.form-group{
  z-index: 1;
}

.discount-countdown {
  display: inline-block;
  background: #ff7e00;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  /* margin-top: 8px; */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
.discount-countdown:hover {
  background: #e67300;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}
.discount-countdown .icon-clock {
  /* margin-right: 5px; */
  animation: pulse 2s infinite;
}
.countdown-remaining {
  font-weight: bold;
  font-family: monospace;
  letter-spacing: 0.5px;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Out of Stock Badge */
.product-image-wrapper {
  position: relative !important;
}

.out-of-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545 !important;
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 999;
  box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
  border: 2px solid #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Enhanced Product Item Styling */
.product-item-enhanced {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-item-enhanced:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: #d0d0d0;
}

/* Seller Header */
.product-seller-header-enhanced {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  font-size: 13px;
  font-weight: 600;
  color: #495057;
}

.product-seller-header-enhanced a {
  color: #495057;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Password Toggle Functionality */
.password-field-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.password-field-with-toggle {
  padding-right: 45px !important;
  width: 100%;
}

.password-toggle-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #6c757d;
  font-size: 16px;
  z-index: 10;
  transition: color 0.3s ease;
  -webkit-user-select: none;
  user-select: none;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-icon:hover {
  color: #495057;
}

.password-toggle-icon i {
  font-size: 16px;
  line-height: 1;
}

/* Ensure password toggle works with different form styles */
.form-group .password-field-wrapper,
.input-group .password-field-wrapper {
  width: 100%;
}

/* Handle specific form input classes */
.auth-form-input.password-field-with-toggle,
.form-input.password-field-with-toggle,
.form-control.password-field-with-toggle {
  padding-right: 45px !important;
}

/* Admin form specific styling */
.admin-form .password-field-wrapper .password-toggle-icon {
  right: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .password-toggle-icon {
    right: 12px;
    font-size: 14px;
  }
  
  .password-field-with-toggle {
    padding-right: 40px !important;
  }
}

.product-seller-header-enhanced a:hover {
  color: #007bff;
}

/* Image Section */
.product-image-section-enhanced {
  position: relative;
  background: #ffffff;
  overflow: hidden;
}

.product-image-container-enhanced {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f9fa;
}

.img-product-enhanced {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-item-enhanced:hover .img-product-enhanced {
  transform: scale(1.05);
}

/* Product Options (Heart & Cart) */
.product-item-options-enhanced {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-option-enhanced {
  width: 38px;
  height: 38px;
  background: rgba(0, 123, 255, 0.9);
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.item-option-enhanced:hover {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transform: scale(1.1);
}

.item-option-enhanced .icon-heart {
  color: #ffebee;
}

.item-option-enhanced .icon-cart {
  color: #ffffff;
}

/* Discount Badge */
.badge-discount-enhanced {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Product Information Section */
.product-info-section-enhanced {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* Product Title */
.product-title-section-enhanced {
  margin-bottom: 12px;
}

.product-title-enhanced {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px 0;
  color: #212529;
}

.product-title-enhanced a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.product-title-enhanced a:hover {
  color: #007bff;
}

.product-title-separator-enhanced {
  height: 2px;
  background: linear-gradient(90deg, #007bff 0%, #6c757d 100%);
  border-radius: 1px;
  width: 30px;
}

/* Product Description */
.product-description-enhanced {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

/* Rating and Price Combined Section */
.product-rating-price-combined-enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-section-enhanced {
  display: flex;
  align-items: center;
}

.stars-enhanced .rating i {
  color: #ffc107;
  font-size: 14px;
}

.price-section-enhanced {
  text-align: right;
  flex-shrink: 0;
}

.price-section-enhanced .price {
  font-size: 18px;
  font-weight: 700;
  color: #28a745;
}

.discount-original-price {
  color: #6c757d;
  text-decoration: line-through;
  font-size: 14px;
  margin-left: 8px;
}

/* Product Actions Section */
.product-actions-section-enhanced {
  padding: 0 20px 20px;
  margin-top: auto;
}

.btn-add-to-cart-enhanced {
  width: 100%;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-add-to-cart-enhanced:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  color: #ffffff;
}

.btn-add-to-cart-enhanced:active,
.btn-add-to-cart-enhanced:focus {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
  color: #ffffff !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-add-to-cart-enhanced:disabled {
  background: #6c757d;
  color: #ffffff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-add-to-cart-enhanced i {
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-item-enhanced {
    margin-bottom: 20px;
  }

  .product-info-section-enhanced {
    padding: 16px;
  }

  .product-actions-section-enhanced {
    padding: 0 16px 16px;
  }

  .product-seller-header-enhanced {
    padding: 10px 16px;
    font-size: 12px;
  }

  .product-title-enhanced {
    font-size: 15px;
  }

  .product-rating-price-combined-enhanced {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .price-section-enhanced {
    text-align: left;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .product-item-options-enhanced {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .item-option-enhanced {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .badge-discount-enhanced {
    top: 8px;
    left: 8px;
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* RTL Form Input Support */
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="search"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] textarea {
  text-align: right;
}

[dir="rtl"] .form-control {
  text-align: right;
}

[dir="rtl"]
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  text-align: right;
}

[dir="rtl"] .select2-results {
  text-align: right;
}

[dir="rtl"] .search-results-ajax {
  text-align: right;
}

[dir="rtl"] .dropdown-menu {
  text-align: right;
}

/* Fix for item option buttons */
.item-option-enhanced:active,
.item-option-enhanced:focus {
  background: rgba(0, 123, 255, 0.9) !important;
  color: #ffffff !important;
  outline: none;
}

/* Social Login as Secondary Options */
.social-login-secondary {
  position: relative;
  margin-top: 25px;
  padding-top: 20px;
}

.social-login-secondary:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #e0e0e0 20%, #e0e0e0 80%, transparent 100%);
}

.social-login-secondary .btn-social {
  opacity: 0.85;
  transform: scale(0.95);
  transition: all 0.3s ease;
  margin-bottom: 8px;
  border: 1px solid #f0f0f0;
}

.social-login-secondary .btn-social:hover {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-login-secondary .p-social-media {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-bottom: 15px;
  position: relative;
  font-weight: 400;
}

.social-login-secondary .p-social-media:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #f0f0f0;
  z-index: 1;
}

.social-login-secondary .p-social-media span {
  background: #fff;
  padding: 0 15px;
  position: relative;
  z-index: 2;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .social-login-secondary {
    margin-top: 20px;
    padding-top: 15px;
  }
  
  .social-login-secondary .btn-social {
    font-size: 14px;
    padding: 10px 15px;
  }
}

