/*
Theme Name: Rumaysa Edition
Theme URI: https://roumaissa-edition.dz
Author: دار رميسة إيديسيو للنشر والترجمة والتوزيع
Author URI: https://roumaissa-edition.dz
Description: قالب ووردبريس مخصص ومستقل لدار رميسة للنشر والترجمة والتوزيع بالجزائر - يدعم إدارة الكتب الورقية والإلكترونية، الفيديوهات، العروض، المقالات النقدية المحمية، نظام الطلبات لـ 69 ولاية، والربط المباشر مع جميع شركات التوصيل الجزائرية (Ecotrack، Yalidine، ZR Express، Anderson، DHD...).
Version: 2.5.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rumaysa-edition
Domain Path: /languages
*/

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --stone-950: #0c0a09;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-900: #78350f;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--stone-900);
  color: var(--stone-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-editorial {
  font-family: 'Amiri', 'Cairo', serif;
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.container {
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: 2rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--stone-950);
}

::-webkit-scrollbar-thumb {
  background: var(--stone-700);
  border-radius: 9999px;
}

/* Anti-copy protection for regular visitors */
body.protected-anti-copy {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

body.protected-anti-copy input,
body.protected-anti-copy textarea,
body.protected-anti-copy select {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* Announcement & Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stone-200);
  color: var(--stone-900);
}

.announcement-bar {
  background-color: var(--stone-900);
  color: var(--stone-200);
  font-size: 0.75rem;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.announcement-text {
  margin: 0 auto;
  font-weight: 500;
  text-align: center;
}

.announcement-close {
  background: transparent;
  border: 0;
  color: var(--stone-400);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.announcement-close:hover {
  color: #ffffff;
}

.navbar-inner {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: var(--stone-900);
  color: var(--amber-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 1.35rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.brand-logo-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: contain;
  border: 1px solid var(--stone-200);
  background: #fff;
}

.brand-title {
  display: block;
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--stone-900);
  line-height: 1.15;
}

.brand-subtitle {
  display: block;
  font-size: 0.65rem;
  color: var(--stone-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--stone-700);
}

.primary-nav a:hover {
  color: var(--amber-700);
}

@media (min-width: 1024px) {
  .primary-nav {
    display: flex;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-dark {
  background-color: var(--stone-900);
  color: #ffffff;
}

.btn-dark:hover {
  background-color: var(--stone-800);
}

.btn-amber {
  background-color: var(--amber-600);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.35);
}

.btn-amber:hover {
  background-color: var(--amber-500);
}

.btn-whatsapp {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
  font-size: 0.75rem;
}

.btn-whatsapp:hover {
  background-color: #d1fae5;
}

.btn-ghost-dark {
  background-color: var(--stone-800);
  color: var(--amber-300);
  border-color: rgba(245, 158, 11, 0.35);
}

.btn-ghost-dark:hover {
  background-color: var(--stone-700);
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 0.3rem;
  border-radius: 9999px;
  background-color: var(--amber-500);
  color: var(--stone-950);
  font-size: 0.7rem;
  font-weight: 800;
}

.mobile-menu-btn {
  display: inline-flex;
  padding: 0.4rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid var(--stone-200);
  color: var(--stone-800);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-drawer {
  display: none;
  background-color: var(--stone-50);
  border-top: 1px solid var(--stone-200);
  padding: 1rem;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--stone-800);
  font-weight: 600;
}

.mobile-drawer a:hover {
  background-color: var(--stone-200);
}

/* Hero & Bestseller Stage */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--stone-950), var(--stone-900));
  color: var(--stone-100);
  padding-block: 3.25rem 4rem;
  border-bottom: 1px solid var(--stone-800);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(var(--amber-600) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.hero-header {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 3rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber-400);
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.18;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--stone-300);
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Bestseller Showcase */
.bestseller-stage {
  position: relative;
  z-index: 2;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--stone-950), var(--stone-900), var(--stone-950));
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.bestseller-topbar {
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(41, 37, 36, 0.8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.bestseller-grid {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .bestseller-grid {
    grid-template-columns: 5fr 7fr;
    padding: 2.5rem;
  }
}

/* 3D Book Covers & Gold Glow */
@keyframes goldHaloBreath {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes goldRimPulse {
  0%, 100% {
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.35), 0 0 36px rgba(217, 119, 6, 0.2);
  }
  50% {
    box-shadow: 0 0 32px rgba(251, 191, 36, 0.65), 0 0 60px rgba(245, 158, 11, 0.4);
  }
}

.book-pedestal {
  position: relative;
  width: min(17rem, 100%);
  aspect-ratio: 3 / 4;
  margin-inline: auto;
}

.bestseller-gold-glow {
  position: absolute;
  inset: -1.5rem;
  border-radius: 1.5rem;
  background: radial-gradient(circle at center, rgba(253, 224, 71, 0.48) 0%, rgba(245, 158, 11, 0.24) 48%, transparent 78%);
  filter: blur(22px);
  animation: goldHaloBreath 2.8s ease-in-out infinite;
  pointer-events: none;
}

.book-cover-3d {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0.35rem 0.65rem 0.65rem 0.35rem;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  box-shadow: -6px 8px 18px rgba(28, 25, 23, 0.22), -1px 1px 4px rgba(28, 25, 23, 0.14);
}

.book-cover-3d:hover {
  transform: translateY(-4px);
}

.book-cover-3d.is-bestseller {
  border: 1px solid rgba(252, 211, 77, 0.65);
  animation: goldRimPulse 2.8s ease-in-out infinite;
}

.book-spine {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0.85rem;
  z-index: 5;
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.25) 50%, rgba(255,255,255,0.15) 100%);
  border-left: 1px solid rgba(0, 0, 0, 0.22);
}

.book-cover-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #881337, #4c0519);
  color: #ffffff;
  padding: 1.25rem 1.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

/* Guarantees Strip */
.guarantees-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(41, 37, 36, 0.85);
}

@media (min-width: 768px) {
  .guarantees-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.guarantee-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 0.65rem;
  background: rgba(28, 25, 23, 0.65);
  border: 1px solid var(--stone-800);
}

.guarantee-card h4 {
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--stone-100);
  margin: 0 0 0.15rem;
}

.guarantee-card p {
  font-size: 0.72rem;
  color: var(--stone-400);
  margin: 0;
}

/* Storefront Sections */
.store-section {
  padding-block: 3.5rem;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--stone-800);
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber-400);
  margin-bottom: 0.35rem;
  display: block;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--stone-400);
  margin: 0.25rem 0 0;
}

/* Filter Pills & Search */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(41, 37, 36, 0.85);
  color: var(--stone-300);
  border: 1px solid var(--stone-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover,
.filter-pill.is-active {
  background: var(--amber-600);
  color: #ffffff;
  border-color: var(--amber-500);
}

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 21rem;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  background: var(--stone-800);
  border: 1px solid var(--stone-700);
  color: var(--stone-100);
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--amber-500);
}

/* Books Grid & BookCard */
.books-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .books-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.book-card {
  background-color: #ffffff;
  color: var(--stone-900);
  border-radius: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(231, 229, 228, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 28px -10px rgba(0, 0, 0, 0.35);
  border-color: rgba(180, 83, 9, 0.45);
}

.book-card.is-bestseller {
  border-color: rgba(251, 191, 36, 0.75);
}

.book-card-media {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  margin: 0 auto 1rem;
}

.stock-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(5, 150, 105, 0.92);
  color: #ffffff;
}

.stock-badge.out-of-stock {
  background: rgba(190, 18, 60, 0.92);
}

.share-icon-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  height: 2rem;
  min-width: 2rem;
  padding-inline: 0.45rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--stone-700);
  border: 1px solid var(--stone-200);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-icon-btn:hover {
  color: var(--amber-700);
}

.book-card-title {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stone-950);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.book-card-author {
  font-size: 0.78rem;
  color: var(--stone-500);
  margin-bottom: 0.75rem;
}

.book-card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--stone-100);
  margin-bottom: 0.75rem;
}

.book-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amber-700);
}

.book-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

/* Articles Magazine Light Section */
.articles-section {
  background-color: var(--stone-50);
  color: var(--stone-900);
  padding-block: 4rem;
  border-top: 1px solid var(--stone-200);
}

.articles-section .section-head {
  border-bottom-color: var(--stone-200);
}

.articles-section .section-title {
  color: var(--stone-950);
}

.articles-section .section-kicker {
  color: var(--amber-700);
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .cards-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  background: #ffffff;
  border: 1px solid var(--stone-200);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
  border-color: rgba(180, 83, 9, 0.4);
  box-shadow: 0 12px 24px -8px rgba(28, 25, 23, 0.12);
}

.article-thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--stone-100);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Videos Section */
.videos-section {
  background-color: var(--stone-900);
  color: var(--stone-100);
  padding-block: 4rem;
}

.video-card {
  background: rgba(41, 37, 36, 0.85);
  border: 1px solid rgba(68, 64, 60, 0.85);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.5);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--stone-950);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.video-play-circle {
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: var(--amber-500);
  color: var(--stone-950);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* Single Pages */
.single-wrapper {
  background: var(--stone-50);
  color: var(--stone-900);
  padding-block: 3rem 4.5rem;
  min-height: 70vh;
}

.single-book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  background: #ffffff;
  border: 1px solid var(--stone-200);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1024px) {
  .single-book-grid {
    grid-template-columns: 4fr 8fr;
    padding: 3rem;
  }
}

.meta-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-block: 1.25rem;
}

@media (min-width: 640px) {
  .meta-table {
    grid-template-columns: repeat(3, 1fr);
  }
}

.meta-cell {
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.meta-cell-label {
  display: block;
  font-size: 0.7rem;
  color: var(--stone-500);
}

.meta-cell-value {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--stone-900);
}

/* Checkout / Direct Order Modal */
.rumaysa-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 10, 9, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.rumaysa-modal-backdrop.is-open {
  display: flex;
}

.rumaysa-modal-card {
  width: 100%;
  max-width: 38rem;
  background: #ffffff;
  color: var(--stone-900);
  border-radius: 1.25rem;
  border: 1px solid var(--stone-200);
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  max-height: 92vh;
  overflow-y: auto;
}

.form-field {
  margin-bottom: 0.9rem;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--stone-800);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid var(--stone-300);
  background: #ffffff;
  color: var(--stone-900);
  font-size: 0.875rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--amber-600);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.order-summary-box {
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: 0.85rem;
  padding: 1rem;
  margin-block: 1rem;
  font-size: 0.85rem;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.order-summary-total {
  border-top: 1px solid var(--stone-200);
  padding-top: 0.55rem;
  margin-top: 0.55rem;
  font-weight: 800;
  font-size: 1rem;
  color: var(--amber-700);
}

.alert-box {
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.alert-error {
  background: #fff1f2;
  border: 1px solid #fda4af;
  color: #9f1239;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--stone-800);
  background-color: var(--stone-950);
  color: var(--stone-400);
  padding-block: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-heading {
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--stone-200);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
}

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-links a:hover {
  color: var(--amber-400);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(41, 37, 36, 0.85);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
}
/* تنسيق غلاف الكتاب ثلاثي الأبعاد (3D Book Cover) */
.book-pedestal {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
  position: relative;
}

.book-cover-3d {
  position: relative;
  width: 240px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden;
  transform: rotateY(-14deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
  box-shadow:
    -12px 14px 28px rgba(0, 0, 0, 0.45),
    -3px 0 0 #d6d3d1,
    -5px 0 0 #a8a29e,
    inset 4px 0 10px rgba(0, 0, 0, 0.35);
  background: var(--stone-900);
}

.book-cover-3d:hover {
  transform: rotateY(-4deg) rotateX(0deg) scale(1.03);
  box-shadow:
    -18px 20px 35px rgba(0, 0, 0, 0.55),
    -3px 0 0 #e7e5e4,
    -5px 0 0 #a8a29e;
}

.book-cover-3d img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 14px;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(255, 255, 255, 0.15) 75%,
    rgba(0, 0, 0, 0.45) 100%
  );
  z-index: 3;
  pointer-events: none;
}

.bestseller-gold-glow {
  position: absolute;
  width: 260px;
  height: 360px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}
/* تنسيق العنوان الرئيسي والفرعي لبطاقات الكتب */
.book-card-main-title {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--stone-900);
  line-height: 1.35;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-sub-title {
  font-family: 'Cairo', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--stone-600);
  line-height: 1.45;
  min-height: 2.25rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* تنسيق العنوان الرئيسي والفرعي للكتب وتوحيد ارتفاع البطاقات */
.rumaysa-main-t {
  display: block;
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.rumaysa-sub-t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Cairo', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #57534e;
  line-height: 1.45;
  min-height: 2.25rem;
}
/* الجمع بين إظهار الغلاف كاملاً دون قص واستعادة حلة الكتاب ثلاثية الأبعاد */
.book-pedestal {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
}

.book-card-media {
  height: auto !important;
  min-height: 295px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  perspective: 1100px;
}

.book-cover-3d {
  position: relative;
  width: 220px !important;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: auto !important;
  border-radius: 3px 10px 10px 3px !important;
  border: 1px solid #e7e5e4 !important;
  background: #ffffff !important;
  overflow: hidden !important;
  transform: rotateY(-12deg) rotateX(2deg) !important;
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease !important;
  box-shadow:
    -10px 12px 24px rgba(28, 25, 23, 0.22),
    -3px 0 0 #f5f5f4,
    -5px 0 0 #d6d3d1,
    -7px 0 0 #a8a29e !important;
}

.book-cover-3d:hover {
  transform: rotateY(-3deg) rotateX(0deg) translateY(-4px) scale(1.02) !important;
  box-shadow:
    -14px 16px 30px rgba(28, 25, 23, 0.28),
    -3px 0 0 #f5f5f4,
    -5px 0 0 #d6d3d1,
    -7px 0 0 #a8a29e !important;
}

.book-cover-3d img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}

.book-spine {
  display: block !important;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 12px;
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.14) 0%,
    rgba(255, 255, 255, 0.35) 35%,
    rgba(0, 0, 0, 0.12) 70%,
    rgba(0, 0, 0, 0.22) 100%
  );
  z-index: 3;
  pointer-events: none;
}
/* عكس اتجاه الغلاف والكعب والمحاذاة للكتب باللغة الفرنسية أو الإنجليزية (LTR) */
.book-is-ltr .book-cover-3d {
  border-radius: 10px 3px 3px 10px !important;
  transform: rotateY(12deg) rotateX(2deg) !important;
  box-shadow:
    10px 12px 24px rgba(28, 25, 23, 0.22),
    3px 0 0 #f5f5f4,
    5px 0 0 #d6d3d1,
    7px 0 0 #a8a29e !important;
}

.book-is-ltr .book-cover-3d:hover {
  transform: rotateY(3deg) rotateX(0deg) translateY(-4px) scale(1.02) !important;
  box-shadow:
    14px 16px 30px rgba(28, 25, 23, 0.28),
    3px 0 0 #f5f5f4,
    5px 0 0 #d6d3d1,
    7px 0 0 #a8a29e !important;
}

.book-is-ltr .book-spine {
  right: auto !important;
  left: 0 !important;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.14) 0%,
    rgba(255, 255, 255, 0.35) 35%,
    rgba(0, 0, 0, 0.12) 70%,
    rgba(0, 0, 0, 0.22) 100%
  ) !important;
}

.book-is-ltr .book-card-main-title,
.book-is-ltr .book-card-sub-title,
.book-is-ltr .book-card-author {
  direction: ltr;
  text-align: left;
}
/* تنسيق البطاقة والغلاف للكتب الفرنسية والإنجليزية تلقائياً */
.book-is-ltr {
  direction: ltr !important;
  text-align: left !important;
}

.book-is-ltr .book-cover-3d {
  border-radius: 10px 3px 3px 10px !important;
  transform: rotateY(12deg) rotateX(2deg) !important;
  box-shadow:
    10px 12px 24px rgba(28, 25, 23, 0.22),
    3px 0 0 #f5f5f4,
    5px 0 0 #d6d3d1,
    7px 0 0 #a8a29e !important;
}

.book-is-ltr .book-cover-3d:hover {
  transform: rotateY(3deg) rotateX(0deg) translateY(-4px) scale(1.02) !important;
}

.book-is-ltr .book-spine {
  right: auto !important;
  left: 0 !important;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.14) 0%,
    rgba(255, 255, 255, 0.35) 35%,
    rgba(0, 0, 0, 0.12) 70%,
    rgba(0, 0, 0, 0.22) 100%
  ) !important;
}
/* الأشعة الذهبية والهالة المتوهجة حول الكتاب الأكثر مبيعاً */
@keyframes rumaysaGoldRaysSpin {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.75;
  }
  50% {
    transform: rotate(180deg) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.75;
  }
}

.bestseller-gold-glow {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 340px !important;
  height: 340px !important;
  margin-top: -170px !important;
  margin-left: -170px !important;
  border-radius: 50% !important;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(251, 191, 36, 0.28) 0deg 10deg,
      transparent 10deg 25deg
    ),
    radial-gradient(
      circle,
      rgba(245, 158, 11, 0.55) 0%,
      rgba(217, 119, 6, 0.2) 45%,
      transparent 72%
    ) !important;
  filter: blur(8px);
  animation: rumaysaGoldRaysSpin 18s linear infinite !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.book-cover-3d.is-bestseller {
  z-index: 2 !important;
  border: 1.5px solid rgba(251, 191, 36, 0.85) !important;
  box-shadow:
    0 0 28px rgba(245, 158, 11, 0.45),
    -10px 12px 24px rgba(0, 0, 0, 0.35),
    -3px 0 0 #f5f5f4,
    -5px 0 0 #d6d3d1 !important;
}

.book-card.is-bestseller {
  border: 1.5px solid #f59e0b !important;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.16) !important;
}
// فصل عنوان الكتاب عند النقطتين (:) أو الشرطة (—) إلى عنوان رئيسي كبير وعنوان فرعي صغير
add_filter( 'the_title', function( $title, $id = null ) {
	if ( is_admin() || ! $id || 'books' !== get_post_type( $id ) || ! in_the_loop() ) {
		return $title;
	}
	// تجنب التكرار إذا تم الفصل مسبقاً
	if ( strpos( $title, 'rumaysa-main-t' ) !== false ) {
		return $title;
	}
	$delimiters = array( ' : ', ': ', ' — ', ' – ', ' -- ' );
	foreach ( $delimiters as $sep ) {
		if ( mb_strpos( $title, $sep ) !== false ) {
			$parts = explode( $sep, $title, 2 );
			$main  = esc_html( trim( $parts[0] ) );
			$sub   = esc_html( trim( $parts[1] ) );
			return '<span class="rumaysa-main-t">' . $main . '</span><span class="rumaysa-sub-t">' . $sub . '</span>';
		}
	}
	return '<span class="rumaysa-main-t">' . esc_html( $title ) . '</span><span class="rumaysa-sub-t"></span>';
}, 10, 2 );
/* إبراز العنوان الرئيسي بخط كبير والعنوان الفرعي بخط أصغر في بطاقات الكتب */
.book-card-title {
  line-height: 1.3 !important;
  margin-bottom: 0.35rem !important;
}

.rumaysa-main-t {
  display: block !important;
  font-family: 'Amiri', serif !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #1c1917 !important;
  line-height: 1.35 !important;
  margin-bottom: 0.25rem !important;
}

.rumaysa-sub-t {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  color: #57534e !important;
  line-height: 1.45 !important;
  min-height: 2.25rem !important;
}
/* ضبط أبعاد الغلاف البديل العنابي ومنع تمدده عند العناوين الطويلة */
.book-cover-fallback {
  width: 100% !important;
  height: 295px !important;
  max-height: 295px !important;
  padding: 1.1rem 0.85rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.book-cover-fallback h3,
.book-cover-fallback h4 {
  font-size: 1.05rem !important;
  line-height: 1.4 !important;
  margin: 0.35rem 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
