/*
Theme Name: Maktabati
Theme URI: https://example.com/maktabati
Author: Professional WP Developer
Author URI: https://example.com
Description: قالب ووردبريس احترافي متكامل ومتوافق مع WooCommerce لبيع الكتب الرقمية والورقية. يشتمل على دعم الكامل للغة العربية RTL، وضع الليل/النهار Dark Mode، فلاتر بحث سريعة، حقول ISBN والمؤلف، وعينة قراءة PDF.
Version: 1.3.0
Tested up to: 6.7
Requires at least: 6.0
Requires PHP: 8.1
Text Domain: maktabati
Domain Path: /languages
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: e-commerce, two-columns, custom-header, custom-menu, rtl-language-support, dark-theme, featured-images, theme-options
*/

:root {
  --primary-color: #1e3a8a;
  --primary-hover: #1e40af;
  --secondary-color: #d97706;
  --accent-color: #059669;
  --bg-light: #f8fafc;
  --card-bg-light: #ffffff;
  --text-light: #0f172a;
  --text-muted-light: #64748b;
  --border-light: #e2e8f0;
  --font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

[data-theme="dark"], body.dark-theme {
  --bg-light: #0f172a;
  --card-bg-light: #1e293b;
  --text-light: #f8fafc;
  --text-muted-light: #94a3b8;
  --border-light: #334155;
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .bg-white,
body.dark-theme .bg-white {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .text-dark,
body.dark-theme .text-dark {
  color: #f8fafc !important;
}

[data-theme="dark"] .card,
body.dark-theme .card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Tailwind & Utilities Fallbacks */
.bg-slate-900 { background-color: #0f172a !important; }
.bg-slate-800 { background-color: #1e293b !important; }
.bg-slate-200 { background-color: #e2e8f0 !important; }
.text-slate-200 { color: #e2e8f0 !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-800 { color: #1e293b !important; }
.rounded-3xl { border-radius: 1.5rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.font-black { font-weight: 900 !important; }
.font-bold { font-weight: 700 !important; }

/* Custom Hero Section */
.hero-slider-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e3a8a 100%) !important;
}

.hero-title-animated {
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: opacity, transform;
  min-height: 120px;
  display: flex;
  align-items: center;
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
}

.book-card-shadow, .card-book-item, .woocommerce ul.products li.product {
  border-radius: 1.25rem !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  background: #ffffff !important;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease, border-color 0.4s ease !important;
}

.book-card-shadow:hover, .card-book-item:hover, .woocommerce ul.products li.product:hover {
  transform: translateY(-8px) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 22px 45px -12px rgba(79, 70, 229, 0.18), 0 8px 16px -6px rgba(0, 0, 0, 0.04) !important;
}

.card-book-item .card-img-top, .transition-scale, .woocommerce ul.products li.product img {
  transition: transform 0.5s ease-out !important;
}

.card-book-item:hover .card-img-top, .card-book-item:hover .transition-scale, .woocommerce ul.products li.product:hover img {
  transform: scale(1.1) !important;
}

/* Book Card Hover Overlay & Wishlist Button Stacking */
.card-book-item .book-hover-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 10 !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card-book-item:hover .book-hover-overlay {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}

.card-book-item .book-hover-overlay .btn {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 20 !important;
  transform: translateY(8px) scale(0.95) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease !important;
}

.card-book-item:hover .book-hover-overlay .btn {
  transform: translateY(0) scale(1) !important;
}

.btn-wishlist-heart {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 50 !important;
}

/* Pulsing Beating Heart Keyframes & Glow Effect */
@keyframes wpHeartPulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.25); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

@keyframes wpHeartGlow {
  0%, 100% { box-shadow: 0 0 15px 2px rgba(255, 42, 85, 0.75), 0 0 0 0 rgba(255, 42, 85, 0.5); }
  50% { box-shadow: 0 0 25px 6px rgba(255, 42, 85, 0.95), 0 0 0 12px rgba(255, 42, 85, 0); }
}

.btn-floating-wishlist,
.btn-wishlist-heart {
  animation: wpHeartGlow 2s infinite ease-in-out !important;
}

.btn-floating-wishlist span,
.btn-wishlist-heart .heart-icon,
.btn-wishlist-heart.active .heart-icon,
.btn-wishlist-heart:hover .heart-icon {
  display: inline-block !important;
  animation: wpHeartPulse 1.4s infinite ease-in-out !important;
}

@media (max-width: 767.98px) {
  .btn-floating-wishlist {
    left: calc(18px + env(safe-area-inset-left, 0px)) !important;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
    margin-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
    width: 52px !important;
    height: 52px !important;
  }
}

.card-book-item .position-absolute.top-0.start-0.end-0,
.aspect-ratio-wrapper .position-absolute.top-0.start-0.end-0 {
  z-index: 50 !important;
  pointer-events: none !important;
}

/* WooCommerce Default Style Overrides */
.woocommerce ul.products,
ul.products {
  display: flex !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  float: none !important;
  clear: both !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.products::before,
ul.products::after {
  content: none !important;
  display: none !important;
}

.woocommerce ul.products li.product,
ul.products li.product {
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.06) !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.woocommerce .woocommerce-result-count,
.woocommerce-result-count {
  float: none !important;
  margin-bottom: 0 !important;
  font-weight: 700 !important;
  color: #334155 !important;
  font-size: 0.9rem !important;
}

.woocommerce .woocommerce-ordering,
.woocommerce-ordering {
  float: none !important;
  margin-bottom: 0 !important;
}

.woocommerce .woocommerce-ordering select,
.woocommerce-ordering select {
  border-radius: 9999px !important;
  padding: 0.5rem 1.25rem !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  font-size: 0.875rem !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-weight: 700 !important;
  font-family: var(--font-family) !important;
  padding: 0.5rem 1rem 0 1rem !important;
  font-size: 1rem !important;
}

.woocommerce ul.products li.product .price {
  font-weight: 900 !important;
  color: #0f172a !important;
  padding: 0 1rem !important;
}

.woocommerce ul.products li.product .button {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  padding: 0.5rem 1.25rem !important;
  margin: 0.5rem 1rem !important;
  border: none !important;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  z-index: 1050;
  display: none;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  max-height: 350px;
  overflow-y: auto;
}
