/*
 * improvements.css — Mtandaopublishers.co.ke Complete UI/UX Overhaul
 * Load after style.css and pages.css in header.php
 * Add to header.php: <link rel="stylesheet" href="/assets/improvements.css?v=2.0">
 *
 * Also add to header.php <head> BEFORE stylesheet links:
 * <link rel="preconnect" href="https://fonts.googleapis.com">
 * <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 * <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
 */

/* ════════════════════════════════════════════════════════════
   TOKENS & VARIABLES
   ════════════════════════════════════════════════════════════ */
:root {
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body:    'DM Sans', 'Inter', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition-fast: 0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-std:  0.28s cubic-bezier(0.4,0,0.2,1);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  --primary-rgb: 4,120,87;
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-600: #16a34a;
}

/* ════════════════════════════════════════════════════════════
   GLOBAL TYPOGRAPHY UPGRADE
   ════════════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.page-title, .hero-v2__headline,
.browse-card-title, .catv2-title,
.footer-section h4, .page-divider__title,
.card-title, .recent-card-title,
.document-card-title, .popular-card-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ════════════════════════════════════════════════════════════
   BRAND FIX — Decorative red lines → brand green
   ════════════════════════════════════════════════════════════ */
.page-title::after {
  background-color: var(--primary) !important;
}
.page-divider__line-left {
  background: linear-gradient(to right, transparent, var(--primary)) !important;
}
.page-divider__line-right {
  background: linear-gradient(to left, transparent, var(--primary)) !important;
}

/* ════════════════════════════════════════════════════════════
   SKIP-TO-CONTENT LINK (accessibility)
   ════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Focus-visible ring for keyboard users */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* ════════════════════════════════════════════════════════════
   HEADER — Active nav state + logo height
   ════════════════════════════════════════════════════════════ */
.header-logo {
  height: 40px;
  width: auto;
  display: block;
}

.main-nav > a.nav-active,
.main-nav .nav-dropdown-toggle.nav-active {
  color: var(--primary);
}
.main-nav > a.nav-active::after {
  transform: scaleX(1);
}

/* ════════════════════════════════════════════════════════════
   HERO SECTION — Fix min-height: 200px, improve layout
   ════════════════════════════════════════════════════════════ */
.hero-v2 {
  min-height: clamp(480px, 62vh, 720px);
  background: #f0faf5;
}
.hero-v2__container {
  padding: 2.5rem 2rem;
  min-height: clamp(480px, 62vh, 720px);
  align-items: center;
}
.hero-v2__card {
  padding: 2rem 2.25rem;
  max-width: 560px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.82);
}
.hero-v2__headline {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.hero-v2__features { gap: 0.4rem; margin-bottom: 1.25rem; }
.hero-v2__feature-row {
  padding: 0.45rem 0.9rem;
  gap: 0.75rem;
  border-radius: 12px;
}
.hero-v2__feature-text strong { font-size: 0.88rem; }
.hero-v2__feature-text span   { font-size: 0.78rem; }
.hero-v2__cta { margin-top: 1.25rem; margin-bottom: 1rem; gap: 0.75rem; }

@media (max-width: 768px) {
  .hero-v2, .hero-v2__container { min-height: 0; }
  .hero-v2__container { padding: 2rem 1.25rem; grid-template-columns: 1fr; }
  .hero-v2__card { max-width: 100%; padding: 1.5rem 1.25rem; }
}

/* ════════════════════════════════════════════════════════════
   SPACING — Reduce excessive gaps
   ════════════════════════════════════════════════════════════ */
.section-spacing { margin-top: 2.5rem; margin-bottom: 2.5rem; }
.page-title      { margin-bottom: 1.25rem; }

/* ════════════════════════════════════════════════════════════
   BROWSE PAGE — Title consistency & intro styling
   ════════════════════════════════════════════════════════════ */
.browse-seo-intro {
  background: linear-gradient(to right, #f0fdf4, #e7f9f4);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  margin-bottom: 2rem;
  border-left: 3px solid var(--primary-light);
}
.browse-seo-text {
  font-size: 0.925rem;
  color: var(--neutral-700);
  line-height: 1.65;
  margin: 0;
}
.browse-seo-text strong { color: var(--primary-dark); }

@media (max-width: 768px) {
  .browse-seo-intro { padding: 0.85rem 1rem; margin-bottom: 1.25rem; }
}

/* ════════════════════════════════════════════════════════════
   SHORTCUT PILLS — Consistent brand green across ALL cards
   ════════════════════════════════════════════════════════════ */
.shortcut-pill {
  background: var(--primary) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.22);
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  border-radius: 7px;
  transition: var(--transition-fast);
}
.shortcut-pill:hover {
  background: var(--primary-dark) !important;
  filter: none !important;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb),0.3) !important;
  transform: translateY(-2px) scale(1.03) !important;
}
.shortcut-pill--more {
  background: rgba(255,255,255,0.75) !important;
  color: var(--neutral-700) !important;
  border: 1px dashed rgba(0,0,0,0.15) !important;
  box-shadow: none !important;
  font-weight: 500;
}
.shortcut-pill--more:hover {
  background: rgba(255,255,255,0.95) !important;
  transform: none !important;
}

/* ════════════════════════════════════════════════════════════
   BROWSE GRID — Clean column rules
   ════════════════════════════════════════════════════════════ */
.browse-grid { gap: 1.25rem; }
.browse-grid.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.browse-grid.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) { .browse-grid.grid-cols-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) {
  .browse-grid.grid-cols-2,
  .browse-grid.grid-cols-3 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   DOCUMENT CARDS (recent-card) — Enhanced metadata
   ════════════════════════════════════════════════════════════ */
.recent-card {
  border-radius: var(--radius-lg);
  transition: transform var(--transition-std), box-shadow var(--transition-std), border-color var(--transition-std);
  border: 1px solid var(--neutral-200);
}
.recent-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}
.recent-card-title {
  font-family: var(--font-display);
  font-size: 0.975rem;
  line-height: 1.45;
}
/* Prominent FREE badge */
.recent-card-price {
  font-size: 1rem;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   FREE DOCUMENT BADGE — Stand out for conversion
   ════════════════════════════════════════════════════════════ */
.item-price-badge,
.price-free {
  display: inline-block;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff !important;
  padding: 0.25rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.3);
}

/* File format badges */
.file-format-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.file-format-badge--pdf  { background: #fee2e2; color: #991b1b; }
.file-format-badge--docx,
.file-format-badge--doc  { background: #dbeafe; color: #1e40af; }
.file-format-badge--ppt,
.file-format-badge--pptx { background: #ffedd5; color: #c2410c; }
.file-format-badge--xlsx { background: #d1fae5; color: #065f46; }

/* ════════════════════════════════════════════════════════════
   BACK-TO-TOP BUTTON
   ════════════════════════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb),0.35);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
  z-index: 800;
}
.back-to-top.visible  { opacity: 1; transform: translateY(0); }
.back-to-top:hover    { background: var(--primary-dark); }

/* ════════════════════════════════════════════════════════════
   FOOTER ENHANCEMENTS
   ════════════════════════════════════════════════════════════ */
.site-footer { padding: 3.5rem 2rem 1.5rem; }

.footer-brand-blurb {
  font-size: 0.875rem;
  color: var(--neutral-400);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.footer-socials {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.footer-social {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-300);
  font-size: 1.05rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.footer-social:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* Newsletter input polish */
.newsletter-form {
  padding: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  gap: 0.5rem;
}
.newsletter-form input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  border-radius: 8px;
  padding: 0.7rem 1rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.42); }
.newsletter-form input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
  outline: none;
}

/* Footer trust row */
.footer-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--neutral-400);
  margin-top: 0.75rem;
}
.footer-trust i { color: var(--primary-light); font-size: 0.95rem; }

@media (max-width: 768px) { .site-footer { padding: 2.5rem 1rem 1.25rem; } }

/* ════════════════════════════════════════════════════════════
   BREADCRUMB — Cleaner with chevron separators
   ════════════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--neutral-500);
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline;
  padding: 0;
}
.breadcrumb a:hover { color: var(--primary-dark); text-decoration: underline; }
.breadcrumb > span { color: var(--neutral-400); font-size: 0.7rem; }

/* ════════════════════════════════════════════════════════════
   ALERT COMPONENTS — Softer full-border style
   ════════════════════════════════════════════════════════════ */
.alert { border-radius: var(--radius-md); border-left: none; border: 1px solid transparent; }
.alert-success { border-color: #86efac; background: #f0fdf4; }
.alert-error   { border-color: #fca5a5; background: #fef2f2; }
.alert-info    { border-color: var(--primary-light); background: var(--highlight); }

/* ════════════════════════════════════════════════════════════
   DOC COUNT BADGE
   ════════════════════════════════════════════════════════════ */
.doc-count-badge {
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.85);
  color: var(--neutral-700);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.doc-count-badge i { color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   ITEM PAGE — Related docs section + layout tweaks
   ════════════════════════════════════════════════════════════ */
.related-docs {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--neutral-200);
}
.related-docs__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
}
/* Remove hard border-left from item SEO card */
.item-content-card[style*="border-left"] {
  border-left: none !important;
  border-top: 3px solid var(--primary) !important;
}

/* M-Pesa input polish */
.mpesa-input-v2 {
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: 0.75rem;
  width: 100%;
}
.mpesa-input-v2:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}

/* ════════════════════════════════════════════════════════════
   FILTER PILLS (popular, search)
   ════════════════════════════════════════════════════════════ */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-pill:hover {
  background: var(--highlight);
  color: var(--primary);
  border-color: var(--primary-light);
}
.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.25);
}

/* ════════════════════════════════════════════════════════════
   SEARCH PAGE — Empty state
   ════════════════════════════════════════════════════════════ */
.search-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--neutral-200);
}
.search-empty__icon  { font-size: 3.5rem; color: var(--neutral-300); display: block; margin-bottom: 1rem; }
.search-empty__title { font-size: 1.4rem; font-weight: 700; color: var(--neutral-900); margin-bottom: 0.5rem; font-family: var(--font-display); }
.search-empty__text  { color: var(--neutral-500); font-size: 0.95rem; margin-bottom: 1.75rem; }

/* ════════════════════════════════════════════════════════════
   SKELETON LOADING CARDS
   ════════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
  padding: 1.25rem;
  height: 160px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 0.75rem;
}
.skeleton-line--short { width: 45%; }
.skeleton-line--med   { width: 70%; }
.skeleton-line--full  { width: 100%; }

/* ════════════════════════════════════════════════════════════
   PAGE HEROES (About, Contact, etc.) — More depth
   ════════════════════════════════════════════════════════════ */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #065f46 60%, #0a7c5a 100%);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -60%; right: -8%;
  width: 380px; height: 380px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -5%;
  width: 240px; height: 240px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  pointer-events: none;
}
.page-hero h1, .page-hero p { position: relative; z-index: 1; }

/* ════════════════════════════════════════════════════════════
   404 PAGE — Full-design upgrade
   ════════════════════════════════════════════════════════════ */
.page-404-wrap {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}
.page-404-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  background: linear-gradient(135deg, var(--primary) 30%, var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}
.page-404-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 0.75rem;
}
.page-404-text {
  font-size: 1rem;
  color: var(--neutral-500);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
}
.page-404-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.page-404-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
  max-width: 420px;
  width: 100%;
}
.page-404-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}
.page-404-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}
.page-404-search button {
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.page-404-search button:hover { background: var(--primary-dark); }

/* ════════════════════════════════════════════════════════════
   POPULAR PAGE FILTER TABS (already has its own system,
   just polish the search-empty and overall spacing)
   ════════════════════════════════════════════════════════════ */
.popular-header { margin-bottom: 0.5rem; }
.popular-subtitle {
  text-align: center;
  color: var(--neutral-500);
  font-size: 0.975rem;
  margin-bottom: 2rem;
  margin-top: -0.75rem;
}

/* ════════════════════════════════════════════════════════════
   CONTACT PAGE
   ════════════════════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  align-items: start;
}
.contact-info-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  color: white;
  position: sticky;
  top: 100px;
}
.contact-info-card h2 { color: white; margin-bottom: 0.5rem; font-family: var(--font-display); }
.contact-info-card p  { color: rgba(255,255,255,0.85); margin-bottom: 2rem; font-size: 0.95rem; line-height: 1.6; }
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-info-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.contact-info-label { font-size: 0.78rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.contact-info-value { font-size: 0.95rem; color: white; font-weight: 500; text-decoration: none; }
.contact-info-value:hover { text-decoration: underline; }
.contact-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: #25D366;
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  margin-top: 1rem;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}
.contact-wa-btn:hover {
  background: #1ebe57;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}
.contact-form-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--neutral-100);
}
.contact-form-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--neutral-900);
}
.contact-form-card p { color: var(--neutral-500); font-size: 0.9rem; margin-bottom: 1.75rem; }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-info-card { position: static; }
}

/* ════════════════════════════════════════════════════════════
   ABOUT PAGE — Card & section upgrades
   ════════════════════════════════════════════════════════════ */
.about-story {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--neutral-100);
}
.about-story h2 {
  color: var(--primary);
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.about-story p {
  line-height: 1.85;
  color: var(--neutral-700);
  margin-bottom: 1rem;
  font-size: 0.975rem;
}

.about-values { margin-bottom: 2.5rem; }
.about-values h2 {
  text-align: center;
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.value-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--neutral-100);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-std), box-shadow var(--transition-std);
}
.value-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.value-icon {
  width: 64px; height: 64px;
  background: var(--highlight);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
  color: var(--primary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.value-card:hover .value-icon {
  background: var(--primary);
  color: white;
}
.value-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-family: var(--font-display); }
.value-card p  { color: var(--neutral-600); line-height: 1.65; font-size: 0.9rem; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1rem;
  text-align: center;
  color: white;
}
.stat-number { font-size: 2.25rem; font-weight: 800; font-family: var(--font-display); line-height: 1; margin-bottom: 0.4rem; }
.stat-label  { font-size: 0.82rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.05em; }

@media (max-width: 768px) {
  .about-stats { grid-template-columns: repeat(2,1fr); gap: 1rem; }
  .about-story, .contact-form-card, .contact-info-card { padding: 1.5rem; }
}
@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════════════════════════ */
@media print {
  .sticky-header, .mobile-menu-toggle, .mobile-overlay,
  .site-footer, .back-to-top, .whatsapp-float,
  aside, nav, .breadcrumb, .related-docs { display: none !important; }
  body   { font-size: 12pt; color: #000; background: white; }
  .page-title { font-size: 18pt; }
  .item-grid  { grid-template-columns: 1fr !important; }
}

/* ════════════════════════════════════════════════════════════
   CARD MICRO-ANIMATIONS — Consistent, not aggressive
   ════════════════════════════════════════════════════════════ */
.card:hover         { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.premium-card:hover { transform: translateY(-4px) scale(1.01) !important; }
.catv2-card:hover   { transform: translateY(-5px); }

/* ════════════════════════════════════════════════════════════
   WHATSAPP FLOAT — Position tweak (above back-to-top)
   ════════════════════════════════════════════════════════════ */
.whatsapp-float {
  position: fixed;
  bottom: 1.25rem;
  right: 4.75rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  z-index: 799;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}
.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE OVERFLOW PREVENTION (consolidated, no !important spam)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .container  { padding-left: 1rem; padding-right: 1rem; }
  .page-title { font-size: 1.5rem; line-height: 1.3; word-break: break-word; }
  .section-spacing { margin-top: 1.75rem; margin-bottom: 1.75rem; }
}
@media (max-width: 480px) {
  .container  { padding-left: 0.75rem; padding-right: 0.75rem; }
  .page-title { font-size: 1.25rem; }
  .about-values .grid-cols-3 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   GLOBAL SMOOTH SCROLL & OVERFLOW
   ════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }

/* ════════════════════════════════════════════════════════════
   POPULAR PAGE — Bridge filter-tab-btn to filter-pill styles
   ════════════════════════════════════════════════════════════ */
.filter-tab-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.filter-tab-btn:hover {
  background: var(--highlight);
  color: var(--primary);
  border-color: var(--primary-light);
}
.filter-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.25);
}
.filter-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}
.filter-search-wrapper {
  position: relative;
  min-width: 200px;
}
.filter-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400);
  font-size: 0.875rem;
}
.filter-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid var(--neutral-200);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.filter-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.1);
}

/* Popular card subtitle for consistency */
.popular-subtitle {
  text-align: center;
  color: var(--neutral-500);
  font-size: 0.975rem;
  margin-bottom: 1.75rem;
  margin-top: -0.5rem;
}

/* Popular card — consistent spacing */
.popular-card {
  border: 1px solid var(--neutral-200);
  transition: transform var(--transition-std), box-shadow var(--transition-std), border-color var(--transition-std);
}
.popular-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}
.popular-card.hidden { display: none; }

/* ════════════════════════════════════════════════════════════
   ABOUT PAGE — Grid responsive for values section
   ════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .about-values .grid-cols-3 {
    grid-template-columns: 1fr 1fr !important;
  }
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .about-values .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════════════════════════
   ITEM PAGE — Purchase card border-top accent
   ════════════════════════════════════════════════════════════ */
.purchase-card-v2,
.item-sidebar-card {
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

/* ════════════════════════════════════════════════════════════
   NO-RESULTS / EMPTY STATES
   ════════════════════════════════════════════════════════════ */
.no-results-container {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--neutral-200);
  margin-top: 1rem;
}
.no-results-icon { font-size: 3rem; color: var(--neutral-300); display: block; margin-bottom: 1rem; }
.no-results-text { color: var(--neutral-500); font-size: 0.975rem; }

/* ════════════════════════════════════════════════════════════
   GLOBAL FORM IMPROVEMENTS
   ════════════════════════════════════════════════════════════ */
select.form-control,
select[class*="form"],
select {
  font-family: var(--font-body);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

/* ════════════════════════════════════════════════════════════
   CATEGORY v2 CARDS — homepage grid polish
   ════════════════════════════════════════════════════════════ */
.catv2-card {
  transition: transform var(--transition-std), box-shadow var(--transition-std), border-color var(--transition-std);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
}
.catv2-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}
.catv2-title {
  font-family: var(--font-display) !important;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   PREMIUM CARDS (homepage featured resources)
   ════════════════════════════════════════════════════════════ */
.premium-card {
  border-radius: var(--radius-lg);
  transition: transform var(--transition-std), box-shadow var(--transition-std);
}
.premium-card:hover {
  transform: translateY(-5px) scale(1.01) !important;
  box-shadow: var(--shadow-hover) !important;
}

/* ════════════════════════════════════════════════════════════
   PAGE TITLE — consistent sizing across all pages
   ════════════════════════════════════════════════════════════ */
.page-title {
  font-weight: 800;
  line-height: 1.2;
  color: var(--neutral-900);
}

/* ════════════════════════════════════════════════════════════
   SEARCH PAGE — result card hover & spacing
   ════════════════════════════════════════════════════════════ */
.search-result-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition-std), border-color var(--transition-std), transform var(--transition-std);
}
.search-result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

/* ════════════════════════════════════════════════════════════
   RECENT CARD BUY BUTTONS
   ════════════════════════════════════════════════════════════ */
.recent-card-price-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 700;
  transition: all var(--transition-fast) !important;
  box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.15);
  text-decoration: none;
}
.recent-card-price-btn--free {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 2px 6px rgba(3, 105, 161, 0.15);
}
.recent-card:hover .recent-card-price-btn {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.25);
}
.recent-card:hover .recent-card-price-btn--free {
  box-shadow: 0 4px 10px rgba(3, 105, 161, 0.25);
}
.sr-card:hover .recent-card-price-btn {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.25);
}
.sr-card:hover .recent-card-price-btn--free {
  box-shadow: 0 4px 10px rgba(3, 105, 161, 0.25);
}

/* ════════════════════════════════════════════════════════════
   SHOPPING CART & CHECKOUT STYLES
   ════════════════════════════════════════════════════════════ */
/* Header Cart Button & Badge */
.header-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  color: var(--neutral-700) !important;
  text-decoration: none;
  transition: all var(--transition-fast) !important;
  margin-right: 0.5rem;
}
.header-cart-btn:hover {
  background: var(--neutral-100);
  color: var(--primary) !important;
  transform: scale(1.05);
}
.cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger, #ef4444);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: none; /* Controlled by JS class assignment */
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}
.header-cart-btn.has-items .cart-count-badge {
  display: inline-flex;
}

/* Add to Cart Button on Cards */
.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--primary) !important;
  border: 1.5px solid var(--primary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast) !important;
  text-decoration: none;
  white-space: nowrap;
}
.add-to-cart-btn:hover {
  background: var(--primary);
  color: white !important;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}
.add-to-cart-btn.added {
  background: var(--neutral-100) !important;
  color: var(--neutral-400) !important;
  border-color: var(--neutral-200) !important;
  cursor: default;
  box-shadow: none !important;
  transform: none !important;
}

/* Card Price Display */
.recent-card-price-new {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--neutral-900);
}
.recent-card-price-new--free {
  color: var(--green-600);
}

/* Consolidated Card Footer */
.recent-card-footer-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  width: 100%;
}

/* Cart Checkout Page Styles */
.cart-page-container {
  max-width: 1140px;
  margin: 3rem auto 5rem;
  padding: 0 1.5rem;
}
.cart-page-container .page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--neutral-900);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cart-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}
@media (max-width: 992px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
.cart-items-section {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}
#cartItemsList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cart-item-row {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--neutral-200);
  background: #fafbfd;
  border-radius: 14px;
  align-items: center;
  transition: all var(--transition-std);
}
.cart-item-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
  border-color: var(--primary-light, #10b981);
  background: white;
}
.cart-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.cart-item-row:hover .cart-item-icon {
  transform: scale(1.08);
}
.cart-item-icon .bi-file-earmark-pdf {
  color: #ef4444;
}
.cart-item-icon .bi-file-earmark-word {
  color: #3b82f6;
}
.cart-item-details {
  flex: 1;
  min-width: 0;
}
.cart-item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-item-meta .category-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  border-radius: 6px;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
}
.cart-item-meta .file-format-badge {
  font-weight: 700;
  border-radius: 6px;
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  margin-left: 0.25rem;
}
.cart-item-meta .file-format-badge--pdf {
  background: #fee2e2;
  color: #b91c1c;
}
.cart-item-meta .file-format-badge--doc {
  background: #dbeafe;
  color: #1d4ed8;
}
.cart-item-price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--neutral-900);
  text-align: right;
  white-space: nowrap;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--neutral-400);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.cart-item-remove:hover {
  color: #ef4444;
  background: #fee2e2;
  transform: scale(1.1);
}
.cart-summary-section {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 100px;
}
.cart-summary-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--neutral-900);
  border-bottom: 1.5px solid var(--neutral-100);
  padding-bottom: 0.75rem;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--neutral-600);
  font-weight: 500;
}
.cart-summary-row--total {
  border-top: 1.5px dashed var(--neutral-200);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--neutral-900);
}
.cart-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-card);
}
.cart-empty-icon {
  font-size: 4rem;
  color: var(--neutral-300);
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.cart-add-more-link:hover {
  color: var(--primary-dark, #065f46) !important;
}

.cart-actions-footer .btn-secondary {
  border: 1.5px solid var(--neutral-300);
  background: transparent;
  color: var(--neutral-700);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.cart-actions-footer .btn-secondary:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
  color: var(--neutral-900);
  transform: translateX(-4px);
}

/* Redesigned recent-card styling to match the screenshot */
.recent-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid var(--neutral-200);
  border-top: 3px solid var(--primary);
  border-radius: 12px;
  text-decoration: none;
  transition: all var(--transition-std);
  align-items: stretch !important;
  gap: 0.75rem;
}

.recent-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
  background: #ffffff;
}

.recent-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
  line-height: 1.4;
  margin: 0 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7em;
}

.recent-card-category-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.recent-card-category-text {
  color: var(--primary);
}

.recent-card-price-text {
  color: #2563eb;
  font-weight: 700;
}

.recent-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--neutral-600);
}

.recent-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.recent-card-meta-item i {
  color: var(--primary);
  font-size: 1rem;
}

.recent-card-buttons-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 0.5rem;
}

/* Buy Now Button (outline blue) */
.recent-card-btn-buy-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  background: transparent;
  color: #2563eb !important;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition-fast) !important;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.recent-card:hover .recent-card-btn-buy-now {
  background: #2563eb;
  color: #ffffff !important;
}

/* Download Free Button */
.recent-card-btn-download-free {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--primary) !important;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition-fast) !important;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.recent-card:hover .recent-card-btn-download-free {
  background: var(--primary);
  color: #ffffff !important;
}

/* Solid Green Add to Cart Button on Cards */
.recent-card .add-to-cart-btn {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 7px 16px !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  transition: all var(--transition-fast) !important;
  box-shadow: none !important;
}

.recent-card .add-to-cart-btn:hover {
  background: var(--primary-dark) !important;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2) !important;
}

.recent-card .add-to-cart-btn.added {
  background: var(--neutral-100) !important;
  color: var(--neutral-400) !important;
  border: 1px solid var(--neutral-200) !important;
  cursor: default !important;
  box-shadow: none !important;
}

/* ════════════════════════════════════════════════════════════
   HEADER SEARCH BAR & COMPACT NAV
   ════════════════════════════════════════════════════════════ */
/* Protect logo from shrinking or being squeezed */
.logo {
  flex-shrink: 0 !important;
}

/* Reduce global header gap for compact layout */
.header-container {
  gap: 1rem !important;
}

/* Desktop only menu nav rules */
@media (min-width: 769px) {
  .main-nav {
    flex: 0 1 auto !important; /* Let nav occupy only necessary space */
  }
}

.header-search-form {
  position: relative;
  flex: 0 1 260px; /* slightly more compact width */
  max-width: 260px;
  margin-left: auto; /* absorbs remaining middle space */
}

.header-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-search-wrapper input {
  width: 100%;
  padding: 0.45rem 2.25rem 0.45rem 0.85rem;
  font-size: 0.85rem;
  border: 1.5px solid var(--neutral-200);
  border-radius: 20px;
  background-color: var(--neutral-50);
  color: var(--neutral-900);
  transition: all var(--transition-fast);
  height: 36px;
}

.header-search-wrapper input::placeholder {
  color: var(--neutral-400);
}

.header-search-wrapper input:focus {
  outline: none;
  background-color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.header-search-wrapper button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--neutral-400);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.header-search-wrapper button:hover {
  color: var(--primary);
}

.header-search-desktop {
  display: block;
}

/* Hide mobile search toggle and overlay by default on desktop */
.mobile-search-toggle-btn,
.mobile-search-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .header-search-form {
    flex: 0 1 240px;
    max-width: 240px;
  }
}

@media (max-width: 768px) {
  .header-search-desktop {
    display: none;
  }

  .mobile-search-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--neutral-700);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto; /* Push actions to the right */
    margin-right: 0.25rem;
    z-index: 1000;
  }

  .mobile-search-toggle-btn:hover,
  .mobile-search-toggle-btn:focus-visible {
    color: var(--primary);
  }

  /* Reset header-cart-btn margin-left: auto so it sits right next to search button */
  .header-cart-btn {
    margin-left: 0 !important;
  }

  .mobile-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1010;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .mobile-search-overlay.active {
    transform: translateY(0);
  }

  .mobile-search-overlay-form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 0.75rem;
  }

  .mobile-search-overlay-input {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    font-family: var(--font-body);
    color: var(--neutral-900);
    outline: none;
    border-bottom: 2px solid var(--neutral-200);
    transition: border-color var(--transition-std);
    padding: 0.25rem 0;
  }

  .mobile-search-overlay-input:focus {
    border-color: var(--primary);
  }

  .mobile-search-close-btn,
  .mobile-search-overlay-submit {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--neutral-500);
    transition: color var(--transition-fast), transform var(--transition-fast);
  }

  .mobile-search-close-btn:hover,
  .mobile-search-close-btn:focus-visible {
    color: var(--danger, #ef4444);
    transform: scale(1.05);
  }

  .mobile-search-overlay-submit:hover,
  .mobile-search-overlay-submit:focus-visible {
    color: var(--primary);
    transform: scale(1.05);
  }
}

/* ── Global Toast Notifications System ── */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    background: #ffffff;
    border-left: 4px solid var(--primary, #047857);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 280px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.active {
    transform: translateY(0);
    opacity: 1;
}
.toast.toast-error {
    border-left-color: #dc2626;
}
.toast.toast-warn {
    border-left-color: #d97706;
}
.toast i {
    font-size: 1.15rem;
}
.toast.toast-success i {
    color: #047857;
}
.toast.toast-error i {
    color: #dc2626;
}
.toast.toast-warn i {
    color: #d97706;
}

/* ════════════════════════════════════════════════════════════
   HEADER TOP RIBBON
   ════════════════════════════════════════════════════════════ */
.sticky-header {
  padding: 0 !important;
}

.header-container {
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

.header-top-ribbon {
  background-color: #eef1f4; /* Very light grey-blue matching the screenshot */
  border-bottom: 1px solid #dcdfe4;
  font-size: 0.825rem;
  color: #0c2340; /* Dark slate navy text */
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
}

.header-top-ribbon-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.ribbon-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-family: var(--font-body), system-ui, sans-serif;
}

.ribbon-item i {
  color: #0d9488; /* Vibrant teal green matching the screenshot */
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
}

.ribbon-item a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

.ribbon-item a:hover {
  color: #0d9488;
}

/* Mobile Responsive Ribbon */
@media (max-width: 768px) {
  .header-top-ribbon-container {
    padding: 0 1rem;
  }
  
  /* Hide email on mobile */
  .ribbon-email {
    display: none !important;
  }
  
  /* Display two aspects on mobile: phone on the left, till on the right */
  .header-top-ribbon-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
}

