/* =====================================================================
   منارة الكتب — Visual identity
   Literary bookstore: deep ink navy, restrained parchment, brass accent.
   Layered on top of Bootstrap 5.3 RTL.
   ===================================================================== */

:root {
    --ink:        #17233D;
    --ink-deep:   #0F1626;
    --parchment:  #F7F4EE;
    --surface:    #FFFFFF;
    --brass:      #B08542;
    --brass-soft: #C9A15E;
    --burgundy:   #7A2E37;
    --slate:      #55606F;
    --line:       #E7E1D5;
    --line-soft:  #F0EBE1;
    --wa:         #25D366;
    --wa-dark:    #1EA952;

    --radius:      14px;
    --radius-sm:   9px;
    --radius-lg:   22px;
    --shadow:      0 10px 30px -18px rgba(23, 35, 61, .35);
    --shadow-soft: 0 4px 18px -12px rgba(23, 35, 61, .28);

    --font-body: "Cairo", system-ui, sans-serif;
    --font-head: "El Messiri", "Cairo", serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .font-head {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}

a { color: var(--ink); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brass); }

.text-brass { color: var(--brass) !important; }
.text-slate { color: var(--slate) !important; }
.bg-ink { background: var(--ink) !important; }
.bg-parchment { background: var(--parchment) !important; }

/* ---------- Container rhythm ---------- */
.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-tight { padding-block: clamp(1.75rem, 3vw, 2.75rem); }

.section-head { margin-bottom: 1.75rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0; position: relative; padding-inline-start: .9rem; }
.section-head h2::before { content: ""; position: absolute; inset-inline-start: 0; top: .35em; bottom: .35em; width: 4px; border-radius: 4px; background: var(--brass); }
.section-head .more-link { font-weight: 600; color: var(--slate); font-size: .95rem; }
.section-head .more-link:hover { color: var(--brass); }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-body); font-weight: 600; border-radius: var(--radius-sm); padding: .6rem 1.3rem; transition: all .18s ease; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-deep); color: #fff; }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: #9a7135; color: #fff; }
.btn-outline-ink { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-outline-ink:hover { background: var(--ink); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-wa svg { width: 1.15em; height: 1.15em; fill: currentColor; }

/* ---------- Header ---------- */
.site-header { background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.site-header .brand { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--ink); display: inline-flex; align-items: center; gap: .55rem; }
.site-header .brand .mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--brass-soft); border-radius: 9px; font-size: 1.1rem; }
.site-header .nav-link { color: var(--ink); font-weight: 600; padding: .4rem .85rem; border-radius: 8px; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brass); background: var(--line-soft); }
.header-search .form-control { border-radius: 999px; border: 1px solid var(--line); background: var(--parchment); padding-inline: 1.1rem; }
.header-search .form-control:focus { box-shadow: none; border-color: var(--brass-soft); background: #fff; }
.cart-pill { position: relative; }
.cart-pill .badge { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--brass); font-size: .68rem; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(120% 140% at 85% 0%, #1d2c4c 0%, var(--ink) 45%, var(--ink-deep) 100%); color: #fff; border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 12% 85%, rgba(201,161,94,.18), transparent 38%); pointer-events: none; }
.hero-inner { padding: clamp(2.5rem, 6vw, 5rem); position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.25; margin-bottom: 1rem; }
.hero p.lead { color: #d9dee9; font-size: clamp(1rem, 2vw, 1.2rem); max-width: 46ch; }
.hero .hero-search { margin-top: 2rem; max-width: 560px; }
.hero .hero-search .form-control { border: none; border-radius: 999px; padding: 1rem 1.4rem; font-size: 1.05rem; }
.hero .hero-search .btn { border-radius: 999px; padding-inline: 1.6rem; }
.hero-stack { display: flex; gap: -1rem; }

/* Floating cover collage in hero */
.hero-covers { display: flex; justify-content: center; align-items: center; gap: .9rem; position: relative; z-index: 1; }
.hero-covers .cover { width: 120px; aspect-ratio: 2/3; border-radius: 8px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.6); object-fit: cover; }
.hero-covers .cover:nth-child(1) { transform: rotate(-6deg) translateY(10px); }
.hero-covers .cover:nth-child(2) { transform: translateY(-14px) scale(1.12); z-index: 2; }
.hero-covers .cover:nth-child(3) { transform: rotate(6deg) translateY(10px); }

/* ---------- Book card ---------- */
.book-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brass-soft); }
.book-card .cover-wrap { position: relative; aspect-ratio: 3/4; background: var(--line-soft); overflow: hidden; }
.book-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.book-card .badge-featured { position: absolute; top: .6rem; inset-inline-start: .6rem; background: var(--brass); color: #fff; font-size: .7rem; font-weight: 700; padding: .25rem .55rem; border-radius: 6px; }
.book-card .card-body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.book-card .book-title { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.book-card .book-author { color: var(--slate); font-size: .85rem; margin-bottom: .5rem; }
.book-card .book-cat { font-size: .72rem; color: var(--brass); font-weight: 600; margin-bottom: .6rem; }
.book-card .price-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; margin-bottom: .8rem; }
.price-tag { display: inline-flex; flex-direction: column; line-height: 1.1; background: var(--line-soft); border-radius: 8px; padding: .35rem .6rem; }
.price-tag .label { font-size: .66rem; color: var(--slate); }
.price-tag .value { font-size: .92rem; font-weight: 700; color: var(--ink); }
.book-card .btn { width: 100%; }

/* ---------- Book detail ---------- */
.book-detail-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--line-soft); aspect-ratio: 3/4; }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-meta-list { list-style: none; padding: 0; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.book-meta-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1.1rem; }
.book-meta-list li:nth-child(odd) { background: var(--line-soft); }
.book-meta-list .k { color: var(--slate); font-size: .9rem; }
.book-meta-list .v { font-weight: 600; text-align: end; }

.format-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.format-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.2rem; text-align: center; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.format-card:hover { border-color: var(--brass-soft); box-shadow: var(--shadow-soft); }
.format-card .fmt-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.format-card .fmt-price { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin: .35rem 0 1rem; }
.format-card .fmt-price small { font-size: .95rem; font-weight: 600; color: var(--slate); }

/* ---------- Chips / filters ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .88rem; font-weight: 600; color: var(--ink); }
.chip:hover { border-color: var(--brass-soft); color: var(--brass); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.filter-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.filter-panel h3 { font-size: 1rem; margin-bottom: 1rem; }
.filter-panel .form-label { font-weight: 600; font-size: .88rem; }
.form-select, .form-control { border-radius: var(--radius-sm); border-color: var(--line); }
.form-select:focus, .form-control:focus { border-color: var(--brass-soft); box-shadow: 0 0 0 .2rem rgba(176,133,66,.12); }

/* ---------- Category / author tiles ---------- */
.cat-tile { display: block; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.1rem; text-align: center; position: relative; overflow: hidden; transition: transform .2s ease; }
.cat-tile:hover { transform: translateY(-3px); color: #fff; }
.cat-tile .name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.cat-tile .count { font-size: .8rem; color: var(--brass-soft); margin-top: .2rem; }

.author-tile { text-align: center; }
.author-tile .avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 0 auto .7rem; border: 3px solid #fff; box-shadow: var(--shadow-soft); background: var(--line-soft); }
.author-tile .name { font-family: var(--font-head); font-weight: 700; }
.author-tile .count { color: var(--slate); font-size: .82rem; }

.publisher-pill { display: flex; align-items: center; justify-content: center; height: 84px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; font-weight: 700; color: var(--ink); text-align: center; transition: border-color .18s ease; }
.publisher-pill:hover { border-color: var(--brass-soft); color: var(--brass); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--slate); }
.empty-state .icon { font-size: 2.6rem; margin-bottom: .6rem; opacity: .5; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { background: transparent; font-size: .88rem; margin: 0; }
.breadcrumb a { color: var(--slate); }
.breadcrumb .active { color: var(--ink); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep); color: #c7cede; padding-block: 3rem 1.5rem; margin-top: 3rem; }
.site-footer h5 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.site-footer a { color: #c7cede; }
.site-footer a:hover { color: var(--brass-soft); }
.site-footer .footer-brand { font-family: var(--font-head); font-size: 1.4rem; color: #fff; }
.site-footer .social a { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; margin-inline-end: .4rem; }
.site-footer .social a:hover { border-color: var(--brass-soft); background: rgba(176,133,66,.14); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem; font-size: .85rem; color: #97a1b5; }

/* ---------- Sticky mobile CTA ---------- */
.mobile-cta { position: fixed; inset-inline: 0; bottom: 0; z-index: 1040; background: #fff; border-top: 1px solid var(--line); padding: .6rem .9rem calc(.6rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(0,0,0,.4); }
.mobile-cta .btn { width: 100%; padding-block: .8rem; font-size: 1.05rem; }
@media (min-width: 992px) { .mobile-cta { display: none; } }

/* offcanvas nav */
.offcanvas .nav-link { padding: .75rem .25rem; border-bottom: 1px solid var(--line-soft); font-weight: 600; }

/* ---------- Utilities ---------- */
.muted-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-hover-color: var(--brass); }
.text-balance { text-wrap: balance; }
.divider-line { height: 1px; background: var(--line); border: 0; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Editable content pages (about / contact / custom) */
.page-content > :last-child { margin-bottom: 0; }
.page-content p { margin-bottom: 1rem; line-height: 1.9; }
.page-content h2, .page-content h3 { font-family: var(--font-head, inherit); margin: 1.5rem 0 .75rem; }
.page-content ul, .page-content ol { padding-inline-start: 1.4rem; margin-bottom: 1rem; }
.page-content li { margin-bottom: .4rem; }
.page-content a { color: var(--brass, #B08542); }
