
:root {
    --gold: #B78D44;
    --gold-dark: #8f7d43;
    --brown: #402B18;
    --brown-light: #5a402d;
    --bg: #F9F9F9;
    --header-bg: #F0EFEE;
    --white: #ffffff;
    --text: #1a1a1a;
    --radius: 1rem;
    --shadow: 0 6px 11px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html{
    font-size:18px;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.8;
}

img { max-width: 100%; height: auto; display: block; }
a {text-decoration:none;}

.container { width: min(94%, 1280px); margin-inline: auto; }

/* ----------------------------------------------
   Header
---------------------------------------------- */
.site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 300;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.brand-badge {
    background: var(--gold);
    color: var(--white);
    padding: 0.4rem .8rem 0.9rem 1.8rem;
    border-bottom-left-radius: 3rem;
    border-top-right-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-bottom: -1.6rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2)
}

.brand-logo {
    width: 250px;
}
@media(max-width:600px){
.brand-logo {
    width: 200px;
}
}
.brand-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 700;
}

/* --- Nav --- */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 3rem;
  margin: 0;
  padding: 0;
  
}

.main-nav a {
  text-decoration: none;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--gold-dark);
}

/* --- Search & burger buttons --- */
.search-btn,
.nav-toggle {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
padding:6px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-right: auto;
}

.nav-toggle .bar {
  width: 20px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.3s;
}

/* --- Mobile nav overlay --- */
.main-nav {
  transition: transform 0.35s ease;
}

@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 260px;
    background: var(--white);
    padding: 5rem 2rem;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1.25rem;
  }

  .main-nav.is-active {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .search-btn {
    display: none; 
  }
}

/* ----------------------------------------------
   Hero section
---------------------------------------------- */
.hero {
  position: relative;
  background: var(--brown) url("/assets/img/texture.jpg") repeat;
  color: var(--white);
  padding-block: clamp(4rem, 10vw, 6rem) clamp(6rem, 14vw, 9rem);
  overflow: hidden;
}

.hero-img {
  position: absolute;
}

.hero-img--books {
  left: 0;
  bottom: 0;
  width: clamp(240px, 45vw, 440px);
}

.hero-img--calligraphy {
  right: -80px;
  top: 40px;
  width: clamp(380px, 75vw, 760px);
  opacity: 0.9;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    padding: 0rem 1rem 2rem 1rem;
}

    .hero-content  .hero-footer {
        text-align: end;
    }

@media(min-width: 600px) {
    .hero-content {
        max-width: 940px;
        padding: 0rem 4rem 2rem 4rem;
    }
}


.hero-title {
  margin: 0 0 clamp(1.5rem, 4vw, 1rem);
  font-size: clamp(1.6rem, 4vw + 1rem, 3.2rem);
  font-weight: 700;
  line-height: 1.4;
  text-align:center;
}
/* ——— Search overlay ——— */
.search-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,.35);
    z-index: 1200; /* above header / mobile nav */
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
}

    .search-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

.search-overlay-form {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    padding: 2rem 1.75rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 900px;
    width: 92%;
}

    .search-overlay-form input {
        flex: 1 1 240px;
        padding: .85rem 1rem;
        border-radius: var(--radius);
        border: 1px solid #e5e5e5;
    }

    .search-overlay-form button[type="submit"] {
        padding: .85rem 2rem;
        background: var(--gold);
        color: var(--white);
        font-weight: 700;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        transition: background .2s;
    }

        .search-overlay-form button[type="submit"]:hover {
            background: var(--gold-dark);
        }

/* Close (×) button */
.close-search {
    position: absolute;
    top: 22px;
    right: 26px;
    background: none;
    border: none;
    font-size: 2.25rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
}

/* Show icon on mobile too */
@media (max-width:768px) {
    .search-btn {
        display: flex;
    }
}

.search-form {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-form input {
  flex: 1 1 clamp(240px, 60vw, 400px);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: none;
  min-width: 200px;
}

.search-form button {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease;
}

.search-form button:hover {
  background: var(--gold-dark);
}

/* ----------------------------------------------
   Switcher
---------------------------------------------- */
.switcher {
  margin-top: -5.5rem;
  position: relative;
  z-index: 50;
}

.switcher-inner {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:0;
}

.switch-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem 2.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.switch-btn i {
  font-size:2.5rem;
}
    .switch-btn:hover > * {
        transform: translateY(-3px);
    }
.switch-btn--white {
  background: var(--white);
  color: var(--brown);
}

.switch-btn--gold {
  background: var(--gold);
  color: var(--white);
}

/*.switch-btn:hover {
  transform: translateY(-4px);
}*/

@media (max-width: 600px) {
  .switcher-inner {
    flex-direction: column;
  }

  .switch-btn {
    padding: 2.5rem 1rem 2.25rem;
    font-size: 1.15rem;
  }
}

/* ----------------------------------------------
   Book categories
---------------------------------------------- */
.book-cats {
  padding-block: clamp(3rem, 8vw, 6rem) 3rem;
}

.cats-card {
  position: relative;
  min-height: clamp(180px, 45vw, 280px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 3rem;
}
.cats-card::before { content:""; position:absolute; inset:0; background:url("/assets/img/books-stack.jpg") center/cover no-repeat; z-index:1; }
.cats-card::after  { content:""; position:absolute; inset:0; background: linear-gradient(to left, rgba(171, 146, 79, 0.82), rgba(41,27,20,0)); z-index:2; }

.cats-title { position:relative; z-index:3; color:var(--white); font-size:1.25rem; font-weight:700; }

/* ——— NEW two‑line grid ——— */
.cats-tags {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 0.5rem;
  justify-items: center;
  margin-top: -3rem; 
  position: relative;
  z-index: 5;
  padding-inline: 20px
}

/*.tag-btn {
  width: 100%;
  padding: 0.6rem 1.7rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}*/

.cats-tags .tag-btn:nth-child(-n+4)  { background: var(--brown); }
.cats-tags .tag-btn:nth-child(n+5)  { background: var(--gold);  }

.tag-btn:hover { transform: translateY(-3px); }

@media (max-width: 990px) {
    .cats-tags {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -6.5rem;
    }
}
@media (max-width: 768px) {
    .cats-tags {
        grid-template-columns: repeat(1, 1fr);
        margin-top: -10.5rem;
    }
    .cats-card {
        min-height: clamp(216px, 75vw, 380px);
        align-items: start;
    }
}
@media (max-width: 480px) {
    .cats-tags {
        gap: 0.75rem;
    }
  .tag-btn   { font-size: 0.85rem; padding: 0.55rem 1rem; }
}

/* ----------------------------------------------
   Stats
---------------------------------------------- */
.stats {
  padding-block: clamp(3rem, 8vw, 5rem) clamp(4rem, 10vw, 6rem);
  background: var(--white);
}

.stats-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: right;
  color: var(--brown);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  gap: 2rem 3rem;
  justify-content: center;
}

.stat-item { text-align:center; }
.stat-icon{ width:66px; height:66px; border-radius:50%; background:var(--white); border:2px solid var(--gold); display:flex; align-items:center; justify-content:center; margin-inline:auto; box-shadow:var(--shadow); }
    .stat-icon img { max-width: 66%; }
.stat-number{ font-size:1.5rem; font-weight:700; margin:1rem 0 0.25rem; color:var(--brown); }
.stat-label { font-size:1rem; font-weight:600; }

@media(max-width:480px){ .stats-grid{ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); justify-content:center; } }


/* ----------------------------------------------
   Footer
---------------------------------------------- */
.site-footer {
  background: var(--gold);
  color: var(--white);
  padding-block: 3rem 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 3rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.footer-links h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight:600;
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-brand {
  text-align: center;
}

.footer-brand img {
  width: 330px;
  margin-inline: auto;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.copyright{
    text-align:center;
}

@media (max-width: 480px) {
    .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
  }
}
.page-header {
  background: var(--brown);
  color: var(--white);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}

.page-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw + 1rem, 2.25rem);
  font-weight: 700;
}

/* ----- Books grid ----- */
.books-list-section {
  padding-block: clamp(2rem, 8vw, 3rem);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem 1.5rem;
}

.book-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.book-icon {
  font-size: 2rem;

}

.book-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.book-meta {
    font-size: 0.85rem;
    margin: 0;
    /*  color: #645c55;*/
}

.book-desc {
  font-size: 0.9rem;
  flex-grow: 1;
}

.details-link {
  align-self: flex-start;
  margin-top: 0.5rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.details-link:hover {
  color: var(--gold-dark);
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-link {
  min-width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  color: var(--brown);
  background: var(--white);
  transition: background 0.2s, color 0.2s;
}

.page-link--active,
.page-link:hover {
  background: var(--gold);
  color: var(--white);
}

.page-ellipsis {
  padding-inline: 0.75rem;
}

@media(max-width:480px){
  .page-link{min-width:36px;height:36px;font-size:0.9rem;}
}

/* =========================================== */
.category-hero {
  padding-block: 2.5rem 1.5rem;
}

.cat-hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  gap:20px;
  align-items: center;
  justify-content: flex-start;
  padding: 1.75rem 2.5rem;
  box-shadow: var(--shadow);
  background: url("/assets/img/books-stack.jpg") center/cover no-repeat;
}

.cat-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgba(171, 146, 79, 0.95), rgba(171, 146, 79, 0));
  z-index: 1;
}

.cat-hero-title,
.cat-breadcrumb {
  position: relative;
  z-index: 2;
  color: var(--white);
  margin: 0;
}

.cat-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.cat-breadcrumb {
  font-size: 0.87rem;
  opacity: 0.9;
}

    .cat-breadcrumb a {
        color: var(--white);
    }

/* Filter / stats dropdown bar */
.cat-filter {
  margin-top: 1rem;
  width: 100%;
  border: none;
  background: var(--gold);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.cat-filter .chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-block-start: 2px solid currentColor; 
  border-inline-end: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.25s;
  margin-bottom: 2px;
}

.cat-filter[aria-expanded="true"] .chevron {
  transform: rotate(135deg);
}

.books-grid.alt-colors {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem 1.5rem;
}

.book-card {
    text-align: center;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s ease;
    text-decoration:none;
}

.book-card:hover {
  transform: translateY(-4px);
}

.book-card .book-icon {
  margin-bottom: 0.5rem;
}

.books-grid.alt-colors .book-card:nth-child(odd) {
  background: var(--white);
  color: var(--gold);
}

.books-grid.alt-colors .book-card:nth-child(even) {
  background: var(--gold);
  color: var(--white);
}

.books-grid.alt-colors .book-card:nth-child(even) a{
    background: var(--gold);
    color: var(--white);
}

.book-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.book-meta {
  font-size: 0.85rem;
}


/* ----- Responsive tweaks ----- */
@media (max-width: 600px) {
  .cat-hero-card {
    min-height: 120px;
    padding: 1.25rem 1.5rem;
  }

  .cat-hero-title { font-size: 1.35rem; }

  .books-grid.alt-colors { grid-template-columns: 1fr; }
}
/* ============================== */
/* ----- Book info card ----- */
.book-info-section {
  padding-block-start: clamp(3rem, 8vw, 5rem);
}

.book-info-card {
  background: var(--white);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-title {
  margin: 0;
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 700;
}

.info-breadcrumb {
    margin: 0;
    font-size: 0.85rem;
    color: #7c7c7c;
}

    .info-breadcrumb a {
        color: #7c7c7c;
    }

.info-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0;
}

.info-divider {
  border: none;
  border-top: 1px solid #e7e4dd;
}

/* Tags */
.info-tags {
  display: flex;
   flex-wrap: wrap; 
  gap: 0.5rem 0.75rem;
}

.info-container {
    display: flex;
    align-items: start;
    gap: 1rem; 
}

@media(max-width: 600px) {
    .info-container {
        flex-direction: column;
    }
}

.tag-btn {
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #0000;
    color: var(--white);
    background: transparent;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    white-space: nowrap;
    margin-top: 6px;
}

.tag-btn--gold {
  background: var(--gold);
  color: var(--white);
}

.tag-btn--outline {
    background: #898989;
    font-weight:normal;
}

.tag-btn--outline:hover {
  color: var(--white);
}

.tag-btn.active {
  background: var(--gold);
  color: var(--white);
}

.cats-tags .tag-btn {
    width: 100% !important;
}
@media(min-width: 600px) {
    .cats-tags .tag-btn {
        padding: 1rem 0.7rem;
    }
}
    .info-desc {
        font-size: 0.95rem;
        line-height: 1.8;
        margin: 0;
        text-align: justify;
    }

    /* Prints header bar */
    .prints-header {
        margin-top: 2.5rem;
        background: var(--gold);
        color: var(--white);
        padding: 0.85rem 1rem;
        border-radius: var(--radius);
        font-size: 1rem;
        font-weight: 700;
    }

    /* Prints table placeholder */
    .prints-table {
        margin-top: 1.25rem;
        background: var(--white);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 3rem 1rem;
        text-align: center;
        color: var(--gold);
        /*  font-size: 1.65rem;*/
        font-weight: 700;
    }

    /* ----- Responsive tweaks ----- */
    @media(max-width: 600px) {
        .info-title {
            font-size: 1.25rem;
        }

        .tag-btn {
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
        }

        .prints-header {
            font-size: 0.95rem;
        }

        .prints-table {
            font-size: 1.35rem;
            padding: 2rem 0.5rem;
        }
    }


    .edition-table {
        background-color: white;
        border-radius: 10px;
        overflow-x: auto;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

        .edition-table th {
            background-color: var(--gold) !important;
            color: white !important;
            white-space: nowrap;
            text-align: center;
        }

        .edition-table td {
            vertical-align: middle;
            text-align: center;
        }

    .cover-thumbnail {
        width: 60px;
        height: 80px;
        object-fit: cover;
        border-radius: 4px;
        cursor: pointer;
        transition: transform 0.3s;
    }

        .cover-thumbnail:hover {
            transform: scale(1.05);
        }

    .pdf-btn {
        background-color: var(--gold);
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.3s;
        cursor: not-allowed !important;
    }

        .pdf-btn:hover {
            background-color: var(--gold-dark);
        }

    .btn-outline-primary {
        color: var(--gold);
        border-color: var(--gold);
    }

        .btn-outline-primary:hover {
            background-color: var(--gold);
            color: white;
        }