/*===================================================================================*/
/*  Advanced Typography and Modern UI Enhancements
/*===================================================================================*/

/* Modern Typography */
body {
  font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-primary);
}

.rtl body {
  font-family: 'Cairo', 'Amiri', Arial, sans-serif;
}

/* Headings Enhancement */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary-color);
  letter-spacing: -0.025em;
}

.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Modern Cards */
.card, .product, .module {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card:hover, .product:hover, .module:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

/* Enhanced Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.5px;
  padding: 12px 24px;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover:before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-white);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--text-white);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: var(--text-white);
}

/* Modern Navigation */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(44, 62, 80, 0.95) !important;
  border: none;
  box-shadow: var(--shadow-medium);
}

.navbar-nav > li > a {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 15px 20px !important;
  transition: all 0.3s ease;
}

.navbar-nav > li > a:hover {
  background: var(--accent-color) !important;
  color: var(--text-white) !important;
  transform: translateY(-2px);
}

/* Enhanced Search Bar */
.search-area {
  position: relative;
  overflow: hidden;
}

.search-field {
  border: 2px solid var(--border-light);
  border-radius: 50px;
  padding: 12px 50px 12px 20px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--bg-white);
}

.search-field:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
  outline: none;
}

.search-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gradient-accent);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  transition: all 0.3s ease;
}

.search-button:hover {
  transform: translateY(-50%) scale(1.05);
}

/* Modern Product Cards */
.product-image {
  position: relative;
  overflow: hidden;
}

.product-image img {
  transition: transform 0.5s ease;
}

.product:hover .product-image img {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product:hover .product-overlay {
  opacity: 1;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.product-actions .btn {
  padding: 8px 12px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Enhanced Price Display */
.price {
  font-weight: 700;
  font-size: 1.2em;
  color: var(--accent-color);
  font-family: 'Montserrat', sans-serif;
}

.old-price {
  text-decoration: line-through;
  color: var(--text-light);
  font-size: 0.9em;
  margin-right: 8px;
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--error-color);
  color: var(--text-white);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
}

/* Modern Dropdowns */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-dark);
  padding: 8px 0;
  margin-top: 8px;
}

.dropdown-menu > li > a {
  padding: 12px 20px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.dropdown-menu > li > a:hover {
  background: var(--bg-lighter);
  color: var(--accent-color);
  transform: translateX(4px);
}

/* Enhanced Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 60px 0 20px;
}

.footer h4 {
  color: var(--text-white);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer h4:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent-color);
}

.rtl .footer h4:after {
  left: auto;
  right: 0;
}

/* Breadcrumb Enhancement */
.breadcrumb {
  background: var(--bg-lighter);
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 30px;
}

.breadcrumb > li + li:before {
  content: '/';
  color: var(--text-secondary);
  padding: 0 8px;
}

/* Form Enhancements */
.form-control {
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  display: block;
}

/* Alert Enhancements */
.alert {
  border-radius: 8px;
  border: none;
  padding: 16px 20px;
  font-weight: 500;
}

.alert-success {
  background: var(--success-color);
  color: var(--text-white);
}

.alert-warning {
  background: var(--warning-color);
  color: var(--text-white);
}

.alert-danger {
  background: var(--error-color);
  color: var(--text-white);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.shadow-sm { box-shadow: var(--shadow-light); }
.shadow-md { box-shadow: var(--shadow-medium); }
.shadow-lg { box-shadow: var(--shadow-dark); }

.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

/* Smooth Transitions */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Enhanced Product Card Buttons */
.product .product-action .action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.product .btn.icon {
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
}

.product .btn.icon:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.product .btn.icon:hover:before {
  left: 100%;
}

.product .btn.icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.product .btn-primary.icon {
  background: var(--gradient-accent);
  color: var(--text-white);
}

.product .btn-primary.icon:hover {
  background: var(--accent-dark);
  color: var(--text-white);
}

/* Quick View and Wishlist buttons */
.product .btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.product .btn-outline-primary:hover {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
}

/* Product Badge Enhancements */
.product .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--error-color);
  color: var(--text-white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: var(--shadow-light);
}

.product .badge.sale {
  background: var(--error-color);
}

.product .badge.new {
  background: var(--success-color);
}

.product .badge.hot {
  background: var(--warning-color);
}

/* Product Rating Stars */
.product .product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0;
}

.product .product-rating .fa-star {
  color: #ffc107;
  font-size: 14px;
}

.product .product-rating .fa-star.empty {
  color: #dee2e6;
}

.product .rating-count {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-lighter);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Modern Modal Styles */
.modern-modal {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-dark);
  overflow: hidden;
}

.modern-modal .modal-header {
  background: var(--gradient-primary);
  border: none;
  padding: 20px 30px;
}

.modern-modal .modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-white);
}

.modern-modal .close {
  opacity: 1;
  color: var(--text-white);
  font-size: 1.5rem;
  font-weight: normal;
  text-shadow: none;
}

.modern-modal .close:hover {
  color: var(--accent-light);
}

.modern-modal .modal-body {
  padding: 30px;
  background: var(--bg-white);
}

/* Product Image Container */
.product-image-container {
  position: relative;
  text-align: center;
}

.product-image-container img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

/* Product Details */
.product-details-container {
  height: 100%;
}

/* Price Section */
.price-section {
  background: var(--bg-lighter);
  padding: 15px 20px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.price-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.price-value {
  font-size: 1.5rem;
  color: var(--accent-color);
  font-weight: 700;
  margin-left: 8px;
}

.old-price {
  color: var(--text-light);
  font-size: 1rem;
}

/* Product Info */
.product-info {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 600;
  color: var(--primary-color);
}

/* Stock Badges */
.stock-badge {
  display: none;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-badge.available {
  background: var(--success-color);
  color: var(--text-white);
}

.stock-badge.out-of-stock {
  background: var(--error-color);
  color: var(--text-white);
}

/* Modern Form Elements */
.modern-select {
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

.modern-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
  outline: none;
}

/* Quantity Input */
.quantity-input-container {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-white);
}

.qty-btn {
  background: var(--bg-lighter);
  border: none;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
}

.qty-btn:hover {
  background: var(--accent-color);
  color: var(--text-white);
}

.quantity-input {
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  width: 80px;
  padding: 12px 8px;
  background: transparent;
}

.quantity-input:focus {
  outline: none;
  box-shadow: none;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--text-white);
  border: none;
  padding: 12px 30px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  color: var(--text-white);
}

/* RTL Support for Modal */
.rtl .modal-actions {
  justify-content: flex-start;
}

.rtl .info-item {
  flex-direction: row-reverse;
}

.rtl .price-value {
  margin-right: 8px;
  margin-left: 0;
}

.rtl .old-price {
  margin-right: 8px;
  margin-left: 0;
}

.rtl .modern-select {
  background-position: left 12px center;
  padding-left: 40px;
  padding-right: 16px;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-lg {
    max-width: 95%;
  }

  .modern-modal .modal-body {
    padding: 20px;
  }

  .product-image-container img {
    max-height: 200px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .btn, .navbar, .footer, .sidebar, .modal {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: black !important;
    background: white !important;
  }
}
