﻿/* ==========================================================================
   Abay Books (ዓባይ መጽሐፍት) - Modern Design System & Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Ethiopic:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  --primary: #0D3866;
  --primary-hover: #154C88;
  --primary-dark: #07213F;
  --primary-light: #EBF2FA;

  --accent: #C88A2E;
  --accent-hover: #B07421;
  --accent-soft: #FEF6E8;
  --accent-glow: rgba(200, 138, 46, 0.25);

  --bg-page: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-muted: #F3EFEA;
  
  --border-subtle: #E7E0D5;
  --border-strong: #D1C4B2;

  --text-main: #1C2430;
  --text-muted: #5C6B7E;
  --text-light: #8E9BAE;
  --text-inverse: #FFFFFF;

  --success: #059669;
  --success-bg: #ECFDF5;
  --danger: #DC2626;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(13, 56, 102, 0.06);
  --shadow-md: 0 4px 12px rgba(13, 56, 102, 0.08);
  --shadow-lg: 0 10px 30px rgba(13, 56, 102, 0.12);
  --shadow-book: 0 12px 28px -6px rgba(13, 56, 102, 0.22), 0 2px 4px rgba(0, 0, 0, 0.06);

  --font-main: 'Plus Jakarta Sans', 'Noto Sans Ethiopic', 'Nyala', system-ui, -apple-system, sans-serif;
  --font-ethiopic: 'Noto Sans Ethiopic', 'Nyala', 'Abyssinica SIL', sans-serif;
  --font-heading: 'Playfair Display', 'Noto Sans Ethiopic', serif;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open,
body.drawer-open {
  overflow: hidden;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s ease;
}

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

/* Helper Utilities */
.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Top Announcement Bar --- */
.top-announcement-bar {
  background: linear-gradient(90deg, #07213F 0%, #0D3866 50%, #0A2E54 100%);
  color: #FFFFFF;
  font-size: 0.82rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.top-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #E2E8F0;
}

.top-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.top-contact {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.top-contact a {
  color: #F8FAFC;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.top-contact a:hover {
  color: var(--accent);
}

/* --- Main Navigation Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 20px;
}

/* Brand & Logo */
.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(13, 56, 102, 0.15);
  border: 1px solid rgba(13, 56, 102, 0.1);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
}

/* Search Bar */
.search-wrapper {
  flex: 1;
  max-width: 460px;
  margin: 0 20px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-muted);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(13, 56, 102, 0.12);
}

.search-box svg {
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text-main);
}

.search-box input::placeholder {
  color: var(--text-light);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background-color: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
}

.btn-lang-toggle:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.btn-cart-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  transition: all 0.2s;
}

.btn-cart-nav:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}

.cart-counter {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--accent);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  transform: scale(0.9);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-counter.has-items {
  transform: scale(1);
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-admin-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #FFFFFF;
}

/* --- Hero Section --- */
.hero-section {
  background: radial-gradient(circle at 80% 20%, rgba(200, 138, 46, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 10% 80%, rgba(13, 56, 102, 0.06) 0%, transparent 60%),
              var(--bg-page);
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(200, 138, 46, 0.3);
  border-radius: var(--radius-full);
  color: #925405;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: 18px;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(13, 56, 102, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(13, 56, 102, 0.3);
}

.btn-telegram {
  background-color: #229ED9;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.25);
}

.btn-telegram:hover {
  background-color: #1E88E5;
  transform: translateY(-2px);
}

.btn-outline {
  background-color: #FFFFFF;
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

/* Hero Showcase Card */
.hero-visual-card {
  position: relative;
  background: #FFFFFF;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.hero-logo-frame {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-book);
}

.hero-visual-caption {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

.hero-visual-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Feature Strips */
.features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.feature-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Catalog Section --- */
.catalog-section {
  padding: 50px 0 80px;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Category Filter Tabs */
.categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.category-pill {
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  background-color: #FFFFFF;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-pill.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(13, 56, 102, 0.2);
}

/* Filter & Sort Controls Bar */
.catalog-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.sort-select {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #FFFFFF;
  color: var(--text-main);
  outline: none;
  font-size: 0.88rem;
}

/* --- Books Grid --- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

/* Book Card */
.book-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-book);
  border-color: var(--border-strong);
}

.book-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.3;
  background-color: #F1EBE4;
  overflow: hidden;
  cursor: pointer;
}

.book-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.book-card:hover .book-card-cover {
  transform: scale(1.04);
}

.book-badge-stack {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.badge-bestseller {
  background-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(200, 138, 46, 0.35);
}

.badge-featured {
  background-color: var(--primary);
  color: #FFFFFF;
}

.book-quick-view-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: rgba(13, 56, 102, 0.92);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  z-index: 3;
}

.book-card:hover .book-quick-view-btn {
  transform: translate(-50%, 0);
  opacity: 1;
}

.book-card-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-category-tag {
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.book-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 4px;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  transition: color 0.2s;
}

.book-title:hover {
  color: var(--primary);
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.book-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.stars-visual {
  color: #EAB308;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.rating-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.book-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.book-price-box {
  display: flex;
  flex-direction: column;
}

.book-current-price {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--primary);
}

.book-current-price small {
  font-size: 0.75rem;
  font-weight: 600;
}

.book-original-price {
  font-size: 0.78rem;
  text-decoration: line-through;
  color: var(--text-light);
}

.btn-add-cart {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

/* Empty State */
.empty-state-box {
  text-align: center;
  padding: 60px 20px;
  background-color: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-strong);
  max-width: 500px;
  margin: 40px auto;
}

.empty-state-box svg {
  color: var(--accent);
  margin-bottom: 16px;
}

.empty-state-box h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.empty-state-box p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* --- Cart Slide-over Drawer --- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 33, 63, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background-color: #FFFFFF;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active,
.cart-drawer.active ~ .cart-drawer-overlay,
.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-drawer-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-drawer {
  font-size: 1.5rem;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-close-drawer:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.cart-item-img {
  width: 60px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cart-item-pricing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.cart-item-unit-price {
  color: var(--text-muted);
}

.cart-item-line-total {
  font-weight: 700;
  color: var(--primary);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.quantity-picker-mini {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-qty {
  width: 26px;
  height: 26px;
  background-color: var(--bg-muted);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.btn-qty:hover {
  background-color: var(--border-subtle);
}

.qty-display {
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-remove-item {
  color: var(--text-light);
  padding: 4px;
  transition: color 0.2s;
}

.btn-remove-item:hover {
  color: var(--danger);
}

/* Cart Drawer Footer */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-page);
}

.cart-free-delivery-promo {
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  background-color: #FEF3C7;
  color: #92400E;
  text-align: center;
}

.cart-free-delivery-promo .free-badge {
  color: var(--success);
  font-weight: 700;
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cart-summary-line.total-line {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
}

.free-text {
  color: var(--success);
  font-weight: 700;
}

.cart-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

/* --- Modals Shared Styles --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 33, 63, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-container {
  background-color: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background-color: #FFFFFF;
  z-index: 10;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary);
}

.modal-close-btn {
  font-size: 1.6rem;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.modal-body {
  padding: 24px 28px;
}

/* --- Book Details Modal --- */
.book-details-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
}

.modal-cover-wrap {
  aspect-ratio: 3 / 4.4;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-book);
}

.modal-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo gallery inside Book Details modal */
.modal-gallery {
  max-width: 220px;
}

.modal-cover-wrap {
  position: relative;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(13, 56, 102, 0.75);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 2;
}

.gallery-arrow:hover {
  background-color: var(--primary);
}

.gallery-arrow-prev {
  left: 8px;
}

.gallery-arrow-next {
  right: 8px;
}

.modal-gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumb {
  width: 48px;
  height: 66px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s ease;
  background: none;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb.active {
  border-color: var(--accent);
}

.modal-details-content {
  display: flex;
  flex-direction: column;
}

.modal-book-category {
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.modal-book-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--primary);
  margin-bottom: 6px;
}

.modal-book-author {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-book-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 18px;
}

.modal-specs-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background-color: var(--bg-page);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.spec-item {
  display: flex;
  gap: 6px;
}

.spec-label {
  color: var(--text-muted);
}

.spec-val {
  font-weight: 600;
  color: var(--text-main);
}

.modal-synopsis {
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.quantity-picker-large {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  gap: 8px;
}

.quantity-picker-large input {
  width: 44px;
  text-align: center;
  border: none;
  font-weight: 700;
  outline: none;
  font-size: 1rem;
}

/* --- Seller / Marketplace Styles --- */
/* Book card seller tag & condition badges */
.book-card-seller-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.seller-by-prefix {
  color: var(--text-light);
}

.seller-display-name {
  font-weight: 700;
  color: var(--primary);
}

.badge-official-mini,
.badge-community-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.68rem;
  flex-shrink: 0;
}

.badge-official-mini {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid #A7F3D0;
}

.badge-community-mini {
  background-color: var(--accent-soft);
  border: 1px solid rgba(200, 138, 46, 0.35);
}

.badge-condition-likenew {
  background-color: #E0F2FE;
  color: #0369A1;
}

.badge-condition-used {
  background-color: #FEF3C7;
  color: #92400E;
}

/* Seller profile card in Book Details modal */
.seller-profile-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF8F5 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.seller-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.seller-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.seller-meta {
  flex: 1;
  min-width: 0;
}

.seller-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.seller-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

.seller-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-seller-verified,
.badge-seller-community {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.badge-seller-verified {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid #A7F3D0;
}

.badge-seller-community {
  background-color: var(--accent-soft);
  color: #925405;
  border: 1px solid rgba(200, 138, 46, 0.4);
}

.badge-condition-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  background-color: var(--bg-muted);
  color: var(--text-muted);
}

.badge-condition-pill.condition-new { background-color: var(--success-bg); color: var(--success); }
.badge-condition-pill.condition-likenew { background-color: #E0F2FE; color: #0369A1; }
.badge-condition-pill.condition-used { background-color: #FEF3C7; color: #92400E; }

.seller-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.seller-phone-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.seller-location-row {
  margin-top: 4px;
}

.seller-direct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-telegram-mini,
.btn-call-mini,
.btn-social-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-telegram-mini {
  background-color: #229ED9;
  color: #FFFFFF;
}

.btn-telegram-mini:hover {
  background-color: #1E88E5;
}

.btn-call-mini {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-subtle);
}

.btn-call-mini:hover {
  border-color: var(--primary);
  background-color: #FFFFFF;
}

.btn-social-mini {
  background-color: #FFFFFF;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-facebook-mini:hover {
  color: #1877F2;
  border-color: #1877F2;
}

.btn-instagram-mini:hover {
  color: #E1306C;
  border-color: #E1306C;
}

/* Sell form section */
.sell-form-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  background-color: var(--bg-surface);
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Book photo upload dropzone (multi-image) */
.file-upload-dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background-color: var(--bg-page);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.file-upload-dropzone:hover,
.file-upload-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.dropzone-prompt svg {
  color: var(--accent);
}

.dropzone-main-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.dropzone-sub-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.dropzone-preview-box {
  width: 100%;
}

.cover-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cover-thumb {
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

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

.cover-thumb-cover-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background-color: var(--primary);
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.cover-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(7, 33, 63, 0.75);
  color: #FFFFFF;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
}

.cover-thumb-remove:hover {
  background-color: var(--danger);
}

.cover-upload-count {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Checkout Modal --- */
.checkout-step-block {
  margin-bottom: 24px;
}

.checkout-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-page);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(13, 56, 102, 0.12);
}

/* Payment Method Cards */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.payment-method-card {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  background-color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.payment-method-card:hover {
  border-color: var(--primary-light);
  background-color: var(--bg-page);
}

.payment-method-card.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(13, 56, 102, 0.1);
}

.payment-method-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.icon-telebirr {
  background-color: #0072CE;
  color: #FFFFFF;
}

.icon-cbe {
  background-color: #6C1D5F;
  color: #FFFFFF;
}

.icon-chapa {
  background-color: #00BA7C;
  color: #FFFFFF;
}

.icon-cod {
  background-color: #475569;
  color: #FFFFFF;
}

.payment-method-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.payment-method-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Payment Instructions Box */
.payment-instruction-card {
  background-color: #F8FAFC;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.instruction-guide-text {
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.5;
}

.highlight-box {
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: bold;
  color: #1E40AF;
  margin-bottom: 12px;
}

/* Order Summary Box in Checkout */
.checkout-summary-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.checkout-summary-item strong {
  color: var(--text-main);
}

.checkout-summary-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.checkout-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1.5px dashed var(--border-strong);
}

.form-errors-box {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  color: var(--danger);
  font-size: 0.86rem;
}

/* --- Order Success Modal --- */
.success-modal-content {
  text-align: center;
  padding: 30px 20px;
}

.success-icon-bubble {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success-heading {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.order-receipt-card {
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  margin-bottom: 24px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 0.88rem;
}

.receipt-row:last-child {
  border-bottom: none;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  padding-top: 10px;
}

.telegram-callout-card {
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  border: 1.5px solid #7DD3FC;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.telegram-callout-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0369A1;
  margin-bottom: 6px;
}

.telegram-callout-desc {
  font-size: 0.86rem;
  color: #075985;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Floating Telegram Quick Action */
.floating-telegram-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 800;
  background-color: #229ED9;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.floating-telegram-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background-color: #1A8BC4;
  box-shadow: 0 8px 25px rgba(34, 158, 217, 0.5);
}

/* --- Global Toast --- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--primary-dark);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--primary-dark);
  color: #CBD5E1;
  padding: 60px 0 24px;
  border-top: 4px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.footer-brand-desc {
  font-size: 0.9rem;
  color: #94A3B8;
  line-height: 1.6;
  max-width: 380px;
}

.footer-heading {
  font-size: 1.05rem;
  color: #FFFFFF;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #94A3B8;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.footer-contact-item a {
  color: #FFFFFF;
  font-weight: 600;
}

.footer-bottom-bar {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-subtitle {
    margin: 0 auto 28px;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-visual-card {
    max-width: 440px;
    margin: 0 auto;
  }
  .features-row {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .search-wrapper {
    display: none; /* Show mobile search */
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }
  .book-details-grid {
    grid-template-columns: 1fr;
  }
  .modal-gallery {
    max-width: 300px;
    margin: 0 auto;
    width: 100%;
  }
  .modal-cover-wrap {
    max-width: 220px;
    margin: 0 auto;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .payment-methods-grid {
    grid-template-columns: 1fr;
  }
  .floating-telegram-btn span {
    display: none;
  }
  .floating-telegram-btn {
    padding: 14px;
    border-radius: 50%;
  }
}