/* ==========================================================================
   Fonts (load first)
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap");
@import url("https://fonts.googleapis.com/earlyaccess/lateef.css");

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --bg: #fafafa;
  --card: #fff;
  --text: #111;
  --muted: #666a70;
  --subtle: #6b7280;
  --line: #e5e7eb;
  --brand: #111;
  --brand-contrast: #fff;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --container: 1120px;

  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;

  --fs-h1: 30px;
  --fs-h2: 28px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-small: 12px;

  --tr-fast: 0.15s ease;
  --tr-med: 0.2s ease;
}

/* ==========================================================================
   Base / Reset
   ========================================================================== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

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

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

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-16);
}

.section {
  padding: 64px 0;
}

.soft {
  background: #fff;
  border-block: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.space-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.wrap {
  flex-wrap: wrap;
}

.gap-8 {
  gap: var(--space-8);
}

.gap-12 {
  gap: var(--space-12);
}

.gap-16 {
  gap: var(--space-16);
}

.gap-24 {
  gap: var(--space-24);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mt-12 {
  margin-top: var(--space-12);
}

.mt-16 {
  margin-top: var(--space-16);
}

.mt-24 {
  margin-top: var(--space-24);
}

.pad {
  padding: var(--space-16);
}

.hidden {
  display: none;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--space-16);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.col-span-2 {
  grid-column: span 2;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .hide-sm {
    display: block;
  }
}

@media (max-width: 899px) {
  .hide-sm {
    display: none;
  }
}

/* =========================================
   HEADER — full updated section (RTL-safe)
   ========================================= */
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  transition: transform 0.25s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.topbar.is-hidden {
  transform: translateY(-100%);
}

.topbar.is-scrolled {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.95);
}

.topbar:focus-within {
  transform: none !important;
}

/* Logo stack */
.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.logo-stack img {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.logo-stack .brand {
  margin-top: 6px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.header-grid > .logo {
  min-width: 110px;
}

/* Center area */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-search-row {
  justify-content: center;
  width: 100%;
}

.header-search-row .input-wrap {
  flex: 0 1 580px;
  min-width: 260px;
}

#categories.chips {
  justify-content: center;
}

.nav {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.nav a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--tr-fast);
}

.nav a:hover {
  opacity: 0.75;
}

/* Header icons */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  transition: transform var(--tr-fast), box-shadow var(--tr-fast), background var(--tr-fast);
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: #f8f8f8;
}

.icon-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Inputs + buttons */
.input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.input-wrap input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  outline: none;
  background: #fff;
  transition: box-shadow var(--tr-fast), border-color var(--tr-fast);
}

.input-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
  border-color: #aaa;
}

.input-wrap .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

/* ==========================================================================
   Hero (optional)
   ========================================================================== */
.hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7f7f8);
}

.hero-wrap {
  align-items: center;
  direction: ltr;
}

.hero-wrap > div:first-child {
  order: 1;
}

.hero-wrap > .hero-photo {
  order: 2;
}

.hero-photo {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
  background: #f3f4f6;
}

/* ==========================================================================
   Generic Card Grid (catalog & wishlist)
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform var(--tr-med), box-shadow var(--tr-med);
}

.card-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #f3f4f6;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  min-height: 60px;
  background: #f9f9f9;
  box-sizing: border-box;
}

.card-info .title {
  font-weight: 400;
  font-size: clamp(10px, 2.2vw, 14px);
  text-align: right;
  line-height: 1.2;
  word-wrap: break-word;
  max-width: 70%;
  overflow: hidden;
  color: var(--text);
}

.card-info .price {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Hover actions overlay */
.card-actions {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.card-item:hover .card-actions {
  opacity: 1;
  pointer-events: auto;
}

.card-actions .btn {
  width: 80%;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.card-actions .btn-cart {
  background: #111;
  color: #fff;
  border: none;
}

.card-actions .btn-save {
  background: #3d3d3e;
  color: #fff;
  border: none;
}

.card-actions .btn-info {
  background: #f6f7f8;
  border: 1px solid #ccc;
}

/* Stars (optional) */
.stars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.star {
  width: 16px;
  height: 16px;
}

.star.filled {
  fill: #eab308;
  color: #eab308;
}

.star.outline {
  fill: none;
  stroke: #eab308;
  stroke-width: 1.5;
}

.score {
  font-size: 11px;
  color: var(--muted);
}

/* ==========================================================================
   Wishlist Page
   ========================================================================== */
.wishlist-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.wishlist-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
}

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
}

.wishlist-actions {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.page-size {
  display: none;
}

.grid-books {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

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

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

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

@media (max-width: 420px) {
  .grid-books {
    grid-template-columns: 1fr;
  }
}

.book-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.book-card:hover {
  transform: translateY(-2px);
}

.book-img {
  aspect-ratio: 3/4;
  width: 100%;
  object-fit: cover;
  display: block;
}

.book-meta {
  padding: 10px 12px;
  text-align: center;
}

.book-title {
  font-size: 14px;
  line-height: 1.4;
  margin: 6px 0 4px;
}

.book-price {
  font-weight: 700;
  font-size: 13px;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0) 40%);
  z-index: 2;
}

.card-item:hover .card-overlay,
.book-card:hover .card-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-overlay .button {
  width: 40px;
  height: 40px;
  box-shadow: none;
}

/* Delete button (reusable) */
.button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #141414;
  border: none;
  color: #fff;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.164);
  cursor: pointer;
  transition: background 0.3s;
  overflow: hidden;
  position: relative;
  gap: 2px;
}

.svgIcon {
  width: 12px;
  transition: transform 0.3s;
}

.svgIcon path {
  fill: currentColor;
}

.button:hover {
  background: rgb(255, 69, 69);
}

.bin-top {
  transform-origin: bottom right;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.button:hover .bin-top {
  transform: rotate(160deg);
}

.svgIcon,
.svgIcon * {
  pointer-events: none;
}

/* ==========================================================================
   Pages (About / Policy / Contact)
   ========================================================================== */
.about-grid {
  direction: ltr;
}

.about-grid > div {
  direction: rtl;
}

.site-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.policy-card,
.contact-card {
  width: min(800px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  color: #111;
  font-family: "Cairo", system-ui, sans-serif;
}

.policy-card h1,
.contact-card h1 {
  font-size: 22px;
  margin: 0 0 16px;
  line-height: 1.6;
  text-align: center;
  color: #2b3647;
}

.policy-list {
  margin: 0 0 16px;
  padding: 0 1.25rem 0 0;
  list-style: decimal inside;
}

.policy-list li {
  margin: 8px 0;
  line-height: 1.9;
}

.contact-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #d6d9de;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  color: #374151;
}

.contact-box a,
.contact-list a {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
}

.contact-box a:hover,
.contact-list a:hover {
  text-decoration: underline;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.contact-list li {
  margin: 8px 0;
  line-height: 1.9;
  font-size: 16px;
}

/* ==========================================================================
   Loader (optional)
   ========================================================================== */
.center-body {
  background: #202628;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.loader {
  width: 24px;
  height: 24px;
  position: relative;
  transform: rotate(45deg);
  display: inline-block;
}

.loader:before,
.loader:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 0 50%;
  background: #0000;
  background-image: radial-gradient(circle 6px at 50% 50%, #0000 94%, #D98E04);
}

.loader:after {
  animation: pulse-ytk0dhmd 1s infinite;
  transform: perspective(200px) translateZ(0px);
}

@keyframes pulse-ytk0dhmd {
  to {
    transform: perspective(200px) translateZ(100px);
    opacity: 0;
  }
}

/* ==========================================================================
   Auth & Account
   ========================================================================== */
main.auth,
main.account {
  padding: 140px 0 48px;
}

@media (max-width: 600px) {
  main.auth,
  main.account {
    padding-top: 120px;
  }
  .logo-stack img {
    width: 72px;
    height: 72px;
  }
}

.auth-card,
.account-card {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card h1,
.account-card h1 {
  text-align: center;
  margin: 0 0 16px;
}

.btn.full {
  width: 100%;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.auth-msg {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}

.auth-msg.show {
  display: block;
}

.auth-msg.error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
}

.auth-msg.info {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.account-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

.sidemenu {
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.sidemenu h3 {
  margin: 8px 12px;
  font-size: 18px;
}

.sidemenu a {
  display: block;
  padding: 12px;
  border-radius: 10px;
  color: #333;
}

.sidemenu a.active,
.sidemenu a:hover {
  background: #fff;
  border: 1px solid var(--line);
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.rowline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.rowline:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.avatar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f3f4f6;
}

.file {
  display: none;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  min-width: 260px;
  max-width: 420px;
}

.panel .rowline > div:first-child {
  min-width: 240px;
}

#passForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 460px;
}

#passForm input {
  width: 100%;
}

#passForm .btn {
  justify-self: start;
}

.danger {
  color: #b91c1c;
}

.btn-delete svg {
  pointer-events: none;
}

/* ==========================================================================
   Book Details — updated layout & styles
   Maps: .book-detail / .book-media / .book-info / .book-cover / .book-title / .actions
   ========================================================================== */
/* ================= Book Detail — EXACT LAYOUT ================= */
.book-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px; /* left info | right cover */
  grid-template-areas:
    "info media"
    "reviews reviews";
  gap: clamp(16px, 3vw, 36px);
  align-items: start;
  margin-top: 12px;
}

/* Areas */
.book-info {
  grid-area: info;
  display: grid;
  gap: 14px;
}

.book-media {
  grid-area: media;
  position: sticky;
  top: 88px;
}

.book-reviews {
  grid-area: reviews;
  margin-top: 20px;
}

/* Cover */
.book-cover {
  width: 100%;
  display: block;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
}

/* Title */
.book-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.3vw, 2rem);
  line-height: 1.35;
  font-weight: 700;
}

/* Rating + Share (row) */
.book-headrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stars {
  display: inline-flex;
  gap: 4px;
  direction: ltr;
  font-size: 18px;
}

.stars .star {
  color: #d1d5db; /* empty */
}

.stars .star.filled {
  color: #f59e0b; /* filled */
}

.btn-share {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

/* Description */
.book-desc {
  color: #374151;
  line-height: 1.8;
}

/* Publisher / Date / Pages */
.book-attrs {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.book-attrs .row {
  display: flex;
  gap: 0.4rem;
}

.book-attrs .label {
  color: var(--text);
  font-weight: 700;
}

/* Category */
.book-category {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
}

/* Actions: two equal buttons */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.actions .btn-dark {
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
  border-radius: 10px;
  padding: 12px 16px;
}

.actions .btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
}

.actions .btn-heart::before {
  content: "❤";
  margin-inline-start: 6px;
  color: #e11d48;
}

/* Reviews block (full width under columns) */
.review-write {
  display: grid;
  gap: 8px;
}

.review-write textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.review-write .btn-submit {
  justify-self: start;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-contrast);
}

.reviews-head {
  font-weight: 700;
  margin: 12px 0 6px;
}

.review-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

/* Mobile: stack info → cover → reviews; cover goes AFTER info */
@media (max-width: 960px) {
  .book-detail {
    grid-template-columns: 1fr;
    grid-template-areas:
      "info"
      "media"
      "reviews";
  }
  .book-media {
    top: 64px;
  }
}

/* Make review section span full width under both columns */
.book-reviews {
  grid-column: 1 / -1; /* spans both columns */
  margin-top: 24px;
  display: block;      /* ensure it’s not flex/grid inherited */
}

/* ==========================================================================
   Footer
   ========================================================================== */
.hours {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

.hours li {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border: none;
}

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 16px 0;
}

.footer .hover:hover {
  color: #111;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* About page grid direction fix */
.about-grid {
  direction: ltr;
}

.about-grid > div {
  direction: rtl;
}

/* === Social icons ========================================================= */
.wrapper {
  display: inline-flex;
  list-style: none;
  height: 120px;
  width: 100%;
  padding-top: 40px;
  font-family: "Poppins", sans-serif;
  justify-content: center;
}

.wrapper .icon {
  position: relative;
  background: #fff;
  border-radius: 50%;
  margin: 10px;
  width: 50px;
  height: 50px;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip {
  position: absolute;
  top: 0;
  font-size: 14px;
  background: #fff;
  color: #fff;
  padding: 5px 8px;
  border-radius: 5px;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip::before {
  position: absolute;
  content: "";
  height: 8px;
  width: 8px;
  background: #fff;
  bottom: -3px;
  left: 50%;
  transform: translate(-50%) rotate(45deg);
}

.wrapper .icon:hover .tooltip {
  top: -45px;
  opacity: 1;
  visibility: visible;
}

/* Minimal safe styles if your CSS doesn’t cover */
.cart-container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 12px;
}

.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
}

.between {
  justify-content: space-between;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.qty-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
.btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
}

button:hover,
.btn:hover {
  background: #f3f3f3;
}

.btn-danger {
  border-color: #f5c2c7;
  background: #fde2e4;
}

.btn-primary {
  border-color: #cfe2ff;
  background: #e7f1ff;
}

.thumb {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}

.muted {
  color: #666;
}

.empty {
  text-align: center;
  padding: 48px 16px;
  color: #777;
}

.totals {
  padding: 12px 0;
}

.price {
  font-weight: 700;
}

/* === Wishlist overlay constrained to cover area (inside image) ========== */
.card-item {
  position: relative;
}

.card-image {
  height: 250px;
}

.card-overlay {
  top: 0;
  inset-inline: 0;
  height: 250px;
  bottom: auto;
}

/* =========================================================
   THEME OVERRIDE — Heritage Inspired (apply colors only)
   Paste AFTER your current styles.css
   ========================================================= */
:root {
  /* Palette 3 — Heritage Inspired */
  --bg: #FAF7F0;             /* sand beige background */
  --card: #FFFFFF;           /* clean white cards */
  --text: #2B2B2B;           /* dark gray for body text */
  --muted: #025259;          /* teal for subtle text */
  --subtle: #443e3e;         /* softer brown-gray */
  --line: #E5DEC9;           /* light beige borders */

  --brand: #7c634fea;        /* copper/brown brand */
  --brand-contrast: #FFFFFF;

  /* Accents */
  --accent-teal: #025259;        /* CTA/highlights */
  --accent-terracotta: #3f8c93;  /* secondary CTA */
  --accent-gold: #33b0bc;        /* stars/glow */

  /* Shadow keeps a warm tint */
  --shadow: 0 8px 24px rgba(139, 94, 60, 0.10);
}

/* 2) Header surfaces & hovers (no layout changes) */
.topbar {
  background: rgba(250, 247, 240, 0.85);
  border-bottom: 1px solid var(--line);
}

.topbar.is-scrolled {
  box-shadow: 0 6px 20px rgba(139, 94, 60, 0.12);
  background: rgba(250, 247, 240, 0.95);
}

.nav a {
  color: var(--text);
}

.nav a:hover {
  color: var(--brand);
  opacity: 0.9;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
}

.icon-btn:hover {
  box-shadow: var(--shadow);
  background: #F6F1E7; /* warm paper hover */
}

/* 3) Inputs & focus ring (golden glow) */
.input-wrap input {
  border: 1px solid var(--line);
  background: var(--card);
}

.input-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
  border-color: var(--accent-gold);
}

/* 4) Generic buttons color-safe */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
}

.btn:hover {
  background: #F6F1E7;
}

.btn-dark {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

/* 5) Cards / product tiles — only colors */
.card-item {
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.10);
}

.card-item:hover {
  box-shadow: 0 12px 24px rgba(139, 94, 60, 0.18);
}

.card-image {
  background: #F3F4F6;
}

.card-info {
  background: #F3E9D2; /* warm beige band */
}

.card-info .price {
  color: var(--accent-terracotta);
}

/* Hover overlay tint */
.card-actions {
  background: rgba(250, 247, 240, 0.95);
}

.card-actions .btn-cart {
  background: var(--accent-teal);
  color: #fff;
  border: none;
}

.card-actions .btn-save {
  background: var(--accent-terracotta);
  color: #fff;
  border: none;
}

/* 6) Stars / ratings */
.star.filled {
  color: var(--accent-gold);
  fill: var(--accent-gold);
}

.star.outline {
  stroke: var(--accent-gold);
}

/* 7) Footer */
.footer {
  background: var(--brand);
  color: var(--brand-contrast);
  border-top: 1px solid var(--line);
}

.footer .hover:hover {
  color: var(--accent-gold);
}

/* 8) Account / side menu subtle paper */
.sidemenu {
  background: #F6F1E7;
  border: 1px solid var(--line);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
}

/* 9) Trash button (cart) — keep your behavior, recolor */
.button {
  background-color: var(--brand);
  box-shadow: 0 0 20px rgba(139, 94, 60, 0.16);
}

.button:hover {
  background-color: #C44949; /* warm red on hover */
}

.svgIcon path {
  fill: #fff;
}

/* 10) Social tooltip uses card/brand colors */
.wrapper .tooltip {
  background: var(--card);
  color: var(--brand);
  box-shadow: 0 10px 10px rgba(139, 94, 60, 0.10);
}

.wrapper .tooltip::before {
  background: var(--card);
}

/* 11) Optional: “paper” hero gradient */
.hero {
  background: linear-gradient(180deg, var(--card), #F6F1E7);
  border-bottom: 1px solid var(--line);
}

/* ===========================
   Header (topbar) – enforced
   =========================== */
.topbar {
  top: 0 !important;
  inset-inline: 0 !important;
  background: #fff !important;
  border-bottom: 1px solid var(--line, #eee) !important;
  z-index: 1000 !important;
}

.container.header-grid {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 10px 16px !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 16px !important;
}

.logo,
.logo-stack {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.logo img {
  height: 40px !important;
  width: auto !important;
  display: block !important;
}

.brand {
  font-weight: 700 !important;
  font-size: 1.125rem !important;
}

.nav {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  justify-content: center !important;
}

.nav a {
  color: inherit !important;
  text-decoration: none !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
}

.nav a:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.header-actions .icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--line, #eee) !important;
  border-radius: 10px !important;
  background: #fff !important;
}

.header-actions .icon-btn img {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

/* ===========================
   Footer – enforced
   =========================== */
.site-footer {
  background: #fff !important;
  border-top: 1px solid var(--line, #eee) !important;
  margin-top: 40px !important;
  padding: 20px 16px !important;
}

.site-footer .footer-grid {
  max-width: 1200px !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

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

.site-footer a {
  color: inherit !important;
  text-decoration: none !important;
}

/* duplicate wrapper block kept (cleaned) to preserve cascade as in original */
.wrapper {
  display: inline-flex;
  list-style: none;
  height: 120px;
  width: 100%;
  padding-top: 40px;
  font-family: "Poppins", sans-serif;
  justify-content: center;
  color: #000;
}

.wrapper .icon {
  position: relative;
  background: #fff;
  border-radius: 50%;
  margin: 10px;
  width: 50px;
  height: 50px;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip {
  position: absolute;
  top: 0;
  font-size: 14px;
  background: #fff;
  color: #fff;
  padding: 5px 8px;
  border-radius: 5px;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .tooltip::before {
  position: absolute;
  content: "";
  height: 8px;
  width: 8px;
  background: #fff;
  bottom: -3px;
  left: 50%;
  transform: translate(-50%) rotate(45deg);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wrapper .icon:hover .tooltip {
  top: -45px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wrapper .icon:hover span,
.wrapper .icon:hover .tooltip {
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.wrapper .facebook:hover,
.wrapper .facebook:hover .tooltip,
.wrapper .facebook:hover .tooltip::before {
  background: #1877f2;
  color: #fff;
}

.wrapper .twitter:hover,
.wrapper .twitter:hover .tooltip,
.wrapper .twitter:hover .tooltip::before {
  background: #000;
  color: #fff;
}
.wrapper .instagram:hover,
.wrapper .instagram:hover .tooltip,
.wrapper .instagram:hover .tooltip::before {
  background: #e4405f;
  color: #fff;
}
/* =========================================================
   Reviews — polished UI (scoped)
   ========================================================= */
#reviews { margin-top: 16px; }

#reviews .reviews-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

#reviews .score-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
}

#reviews .score-main {
  display: grid;
  gap: 2px;
  text-align: center;
}

#reviews .score-main .avg {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
#reviews .score-main .of { color: var(--subtle); font-size: 13px; }
#reviews .score-main .count { color: var(--muted); font-size: 13px; }

#reviews .score-bars { display: grid; gap: 6px; }
#reviews .score-bars .bar {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-size: 14px;
}
#reviews .score-bars .track {
  height: 10px;
  background: #f2f2f2;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
#reviews .score-bars .fill {
  height: 100%;
  width: 0%;
  background: #0d9488; /* brand teal line */
  transition: width .3s ease;
}
#reviews .score-bars .n { color: var(--muted); font-style: normal; }

#reviews .reviews-toolbar { display: flex; align-items: center; gap: 8px; }
#reviews .reviews-sort {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

/* Review cards */
#reviews .reviews {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
}
#reviews .review {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
#reviews .review.empty-state {
  text-align: center;
  color: var(--muted);
  border-style: dashed;
}

#reviews .review-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
#reviews .reviewer { font-weight: 700; }
#reviews .date { color: var(--muted); font-size: .9rem; }

/* Stars */
#reviews .stars { display: inline-flex; gap: 2px; direction: ltr; }
#reviews .stars .star { width: 18px; height: 18px; fill: #d1d5db; }
#reviews .stars .star.filled { fill: #e8a317; }

/* Body with collapsible */
#reviews .review-body { line-height: 1.9; color: var(--text); white-space: pre-wrap; }
#reviews .btn-expand {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

/* Actions row */
#reviews .review-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
#reviews .btn-helpful {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
}
#reviews .btn-helpful.voted {
  background: #E6F7F3;
  border-color: #C6ECE5;
  color: #0E7A6B;
}

@media (max-width: 720px) {
  #reviews .reviews-summary {
    grid-template-columns: 1fr;
  }
  #reviews .score-wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
