* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #047857;
  --primary-dark: #065f46;
  --primary-light: #10b981;
  --highlight: #e7f9f4;
  --neutral-50: #fafafa;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-400: #9ca3af;
  --neutral-600: #4b5563;
  --neutral-700: #374151;
  --neutral-900: #111827;
  --danger: #dc2626;
  --success: #16a34a;
  --border-radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--neutral-900);
  background-color: var(--neutral-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Icon Utilities */
.bi {
  display: inline-block;
  vertical-align: -0.125em;
  /* Standard alignment for icons next to text */
  fill: currentColor;
}

[class^="bi-"]::before,
[class*=" bi-"]::before {
  display: inline-block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== ENHANCED RESPONSIVE HEADER ===== */
.sticky-header {
  position: sticky;
  top: 0;
  background-color: white;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  padding: 1rem 0;
}

.header-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 2rem);
  position: relative;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo a {
  display: block;
  line-height: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  z-index: 1001;
}

/* Hamburger Menu Button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--primary);
  transition: all 0.3s ease;
  border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Navigation */
.main-nav {
  display: flex;
  flex: 1 1 auto;
  gap: clamp(0.2rem, 0.6vw, 1rem);
  align-items: center;
  min-width: 0;
}

.main-nav > a,
.main-nav .nav-dropdown-toggle {
  color: var(--neutral-600);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.main-nav > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.6rem;
  right: 0.6rem;
  width: auto;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.main-nav > a:hover,
.main-nav .nav-dropdown-toggle:hover {
  color: var(--primary);
}

.main-nav > a:hover::after {
  transform: scaleX(1);
}

/* Nav Chevron */
.nav-chevron {
  font-size: 0.55rem;
  transition: transform 0.3s ease;
  opacity: 0.5;
}

/* ===== MEGA DROPDOWN SYSTEM ===== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-toggle::after {
  display: none; /* override old underline */
}

/* Hover zone bridge — prevents dropdown from closing when moving mouse down */
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  display: none;
}

.nav-dropdown:hover::before {
  display: block;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown:hover .nav-dropdown-toggle {
  color: var(--primary);
}

/* The mega panel */
.mega-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 9999;
  min-width: 280px;
}

.nav-dropdown:hover .mega-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-dropdown-inner {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 0;
  overflow: hidden;
}

.mega-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--neutral-100);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.mega-dropdown-header i {
  font-size: 1rem;
}

.mega-dropdown-grid {
  padding: 0.5rem 0;
}

.mega-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  color: var(--neutral-700);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.mega-dropdown-item::after {
  display: none; /* no underline */
}

.mega-dropdown-item:hover {
  background: linear-gradient(90deg, var(--highlight) 0%, transparent 100%);
  color: var(--primary);
  padding-left: 1.5rem;
}

.mega-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mega-dropdown-item:hover .mega-dot {
  opacity: 1;
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(var(--primary-rgb, 30, 58, 138), 0.4);
}

.mega-label {
  flex: 1;
}

.mega-dropdown-viewall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--neutral-100);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--neutral-50);
}

.mega-dropdown-viewall::after {
  display: none;
}

.mega-dropdown-viewall:hover {
  background: var(--primary);
  color: white;
}

.mega-dropdown-viewall i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.mega-dropdown-viewall:hover i {
  transform: translateX(3px);
}


/* User Menu */
.user-menu {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* User Dropdown System */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.user-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  color: var(--neutral-700);
}

.user-dropdown-toggle:hover {
  border-color: var(--primary);
  background: var(--neutral-50);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: #f1f5f9;
  flex-shrink: 0;
  border: 1px solid var(--neutral-200);
}

.header-user-avatar .default-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-name-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.user-dropdown.active .toggle-icon {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--neutral-100);
  padding: 0.5rem;
  display: none;
  z-index: 1000;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown.active .user-dropdown-menu {
  display: block;
}

.dropdown-header {
  padding: 0.75rem 1rem;
}

.user-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.85rem;
  color: var(--neutral-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: var(--neutral-100);
  margin: 0.5rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--neutral-700);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--neutral-50);
  color: var(--primary);
}

.dropdown-item i {
  font-size: 1.1rem;
  opacity: 0.7;
}

.logout-item:hover {
  background: #fee2e2;
  color: #dc2626;
}

.guest-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Header Nav Buttons (scoped to .guest-actions) ── */
.guest-actions .btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.2);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.guest-actions .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.35);
}

.guest-actions .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(4, 120, 87, 0.2);
}

.guest-actions .btn-secondary {
  background: transparent;
  color: var(--primary);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  border: 1.5px solid rgba(4, 120, 87, 0.25);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.guest-actions .btn-secondary:hover {
  background: rgba(4, 120, 87, 0.06);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.guest-actions .btn-secondary:active {
  transform: translateY(0);
  background: rgba(4, 120, 87, 0.1);
}

/* ===== MOBILE RESPONSIVE HEADER ===== */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .header-container {
    padding: 0 1rem;
  }

  .header-cart-btn {
    margin-left: auto;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    gap: 0;
  }

  .main-nav.active {
    right: 0;
  }

  .main-nav > a,
  .main-nav .nav-dropdown-toggle {
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.85rem;
    text-transform: uppercase;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  /* On mobile, disable hover — use tap instead */
  .nav-dropdown:hover .mega-dropdown {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
  }

  .nav-dropdown:hover::before {
    display: none;
  }

  .mega-dropdown {
    position: static;
    transform: none !important;
    min-width: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: max-height 0.35s ease;
    left: 0;
  }

  .nav-dropdown.active .mega-dropdown {
    max-height: 600px;
  }

  .nav-dropdown.active .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
  }

  .mega-dropdown-inner {
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: var(--neutral-50);
    border-left: 3px solid var(--primary);
    margin-left: 0;
    overflow: visible;
  }

  .mega-dropdown-header {
    padding: 0.6rem 0.75rem;
    font-size: 0.7rem;
  }

  .mega-dropdown-item {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    white-space: normal;
    word-wrap: break-word;
  }

  /* Disable the padding shift on touch devices to prevent jumping */
  .mega-dropdown-item:hover {
    padding-left: 0.75rem; 
  }

  .mega-dropdown-viewall {
    font-size: 0.72rem;
    padding: 0.65rem 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    justify-content: flex-start;
    text-align: left;
  }


  .user-menu {
    position: fixed;
    bottom: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    background: white;
    padding: 1.5rem;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    border-top: 2px solid var(--primary);
  }

  .user-menu.active {
    right: 0;
  }

  .user-menu a,
  .user-menu button {
    width: 100%;
    text-align: center;
  }

  .guest-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .guest-actions .btn,
  .guest-actions .btn-primary,
  .guest-actions .btn-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    border-radius: 8px;
    text-align: center;
  }

  /* Mobile User Dropdown Overrides */
  .user-dropdown {
    width: 100%;
  }

  .user-dropdown-toggle {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
  }

  .user-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--neutral-100);
    margin-top: 0.5rem;
    padding: 0;
    display: none;
    background: var(--neutral-50);
  }

  .user-dropdown.active .user-dropdown-menu {
    display: block;
  }

  .dropdown-item {
    justify-content: center;
    border-radius: 0;
    border-bottom: 1px solid var(--neutral-100);
  }

  .dropdown-header {
    text-align: center;
  }

  /* Mobile overlay */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-overlay.active {
    display: block;
    opacity: 1;
  }
}

/* ===== BUTTONS ===== */
.btn-primary,
.btn-secondary,
.btn-logout,
.btn-admin {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  font-family: inherit;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.btn-secondary {
  background-color: var(--neutral-100);
  color: var(--neutral-900);
}

.btn-secondary:hover {
  background-color: var(--neutral-200);
  transform: translateY(-2px);
}

.btn-admin {
  background-color: var(--primary-light);
  color: white;
}

.btn-logout {
  background-color: var(--danger);
  color: white;
}

.btn-logout:hover {
  background-color: #b91c1c;
}

/* ===== MAIN CONTENT ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

.section-spacing {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 3rem;
  color: var(--neutral-900);
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.page-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--danger);
}

/* ===== PAGE SECTION DIVIDER ===== */
.page-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 3rem;
}

.page-divider__line-left {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--danger));
}

.page-divider__line-right {
  flex: 1;
  height: 2px;
  background: linear-gradient(to left, transparent, var(--danger));
}

.page-divider__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.page-divider__title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-transform: none;
}
.page-divider__dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-divider__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.page-divider__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.page-divider__dot:nth-child(1) { animation-delay: 0s; }
.page-divider__dot:nth-child(2) { animation-delay: 0.2s; }
.page-divider__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* Mobile */
@media (max-width: 768px) {
  .page-divider {
    gap: 10px;
    margin-bottom: 1.5rem;
  }
  .page-divider__title {
    font-size: 1.25rem;
  }
  .page-divider__dot {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {
  .page-divider__title {
    font-size: 1.1rem;
  }
}

.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--neutral-600);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ===== ENHANCED RESPONSIVE GRID ===== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .grid {
    gap: 1rem;
  }

  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ===== RECENTLY ADDED CARDS (HOMEPAGE) ===== */
.recent-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  align-items: flex-start;
}

.recent-card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-light);
  transform: translateY(-4px) scale(1.01);
  background: white;
}

.recent-card-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Soft generic background if --icon-color is not provided */
  background: var(--neutral-50); 
}

/* If inline variable is used */
.recent-card-icon-box[style*="--icon-color"] {
  background: color-mix(in srgb, var(--icon-color) 10%, transparent);
}

.recent-card-icon-box img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.recent-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.recent-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recent-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.recent-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.recent-badge-category {
  background: #e6f6f2;
  color: var(--primary-dark);
}

.recent-badge-tag {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.recent-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.recent-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.recent-card-meta {
  display: flex;
  gap: 1rem;
  color: var(--neutral-600);
  font-size: 0.8rem;
  font-weight: 500;
}

.recent-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 640px) {
  .recent-card {
    flex-direction: column;
    gap: 1rem;
  }
  .recent-card-icon-box {
    width: 48px;
    height: 48px;
  }
}

/* ===== ENHANCED CARDS FOR BROWSE.PHP ===== */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--neutral-900);
  line-height: 1.4;
}

.card-description {
  color: var(--neutral-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.5;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.card img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

/* ===== PREMIUM HOMEPAGE ENHANCEMENTS ===== */
.premium-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #e7f9f4 100%);
    position: relative;
    overflow: hidden;
    padding: 3rem 2rem;
    border-radius: 12px;
}

.premium-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23047857' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.premium-card {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.premium-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    background: white !important;
}

.glass-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.icon-container-premium {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
}

.premium-card:hover .icon-container-premium {
    transform: scale(1.05);
    background: white;
    box-shadow: 0 12px 20px rgba(4, 120, 87, 0.12);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border: none !important;
    color: white !important;
    padding: 0.85rem 1rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3) !important;
    transition: all 0.3s ease !important;
    text-align: center;
    text-decoration: none;
    margin-top: auto;
}

.btn-premium:hover {
    box-shadow: 0 8px 25px rgba(4, 120, 87, 0.45) !important;
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Mobile card adjustments */
@media (max-width: 480px) {
  .card {
    padding: 1rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-description {
    font-size: 0.8rem;
  }

  .card-price {
    font-size: 1.1rem;
  }
}

/* ===== FORMS ===== */
form:not(.header-search-form):not(.mobile-search-form) {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--neutral-900);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--neutral-200);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--highlight);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 480px) {
  form {
    padding: 1.5rem 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button,
  .form-actions a {
    width: 100%;
  }
}

/* ===== ENHANCED RESPONSIVE FOOTER ===== */
.site-footer {
  background-color: var(--neutral-900);
  color: var(--neutral-100);
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: white;
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: var(--neutral-100);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.footer-section a:hover {
  color: var(--primary-light);
  padding-left: 5px;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.newsletter-form input {
  flex: 1;
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  color: white;
}

.newsletter-form button {
  white-space: nowrap;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral-700);
  color: var(--neutral-400);
  font-size: 0.875rem;
}

/* Mobile Footer Responsive */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-section h4 {
    font-size: 1rem;
  }

  .footer-section a {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding: 2rem 1rem 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-section {
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form button {
    width: 100%;
  }
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th {
  background-color: var(--highlight);
  color: var(--primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--neutral-200);
}

tr:hover {
  background-color: var(--neutral-50);
}

/* Mobile table */
@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    margin-bottom: 1rem;
    border: 1px solid var(--neutral-200);
    border-radius: var(--border-radius);
  }

  td {
    border: none;
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    text-align: left;
  }
}

/* ===== ALERTS ===== */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  animation: slideInDown 0.4s ease-out;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-info {
  background-color: var(--highlight);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem;
    border-radius: 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none;
  }
}

/* Add these mobile-specific fixes to your style.css file */

/* ===== MOBILE OVERFLOW FIXES ===== */

/* Prevent horizontal scroll on all devices */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Make all containers respect viewport width */
.container,
section,
.footer-content {
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== HERO SECTION MOBILE FIXES ===== */
@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 1rem !important;
    overflow: hidden;
  }

  .hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    padding: 0 0.5rem;
  }

  .hero p {
    font-size: 1rem !important;
    padding: 0 0.5rem;
  }

  /* Fix the floating decoration element */
  .hero>div[style*="position: absolute"] {
    width: 200px !important;
    height: 200px !important;
    right: -20% !important;
  }

  /* Fix hero buttons container */
  .hero div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0 0.5rem;
  }

  .hero .btn-primary,
  .hero .btn-secondary {
    width: 100% !important;
    max-width: 100%;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 0.75rem !important;
    margin-left: -2rem;
    margin-right: -2rem;
    border-radius: 0 !important;
  }

  .hero h1 {
    font-size: 1.5rem !important;
  }

  .hero p {
    font-size: 0.9rem !important;
  }
}

/* ===== HOW IT WORKS SECTION MOBILE FIXES ===== */
@media (max-width: 768px) {

  /* Make 4-column grid into 2 columns on tablets */
  section div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Make 3-column "Why Choose" grid into single column */
  section div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

@media (max-width: 480px) {

  /* Stack all steps vertically on mobile */
  section div[style*="grid-template-columns: repeat(4, 1fr)"],
  section div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Adjust step icons */
  section div[style*="width: 80px; height: 80px"] {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
  }
}

/* ===== NEWSLETTER SECTION MOBILE FIXES ===== */
@media (max-width: 768px) {

  /* Make newsletter form stack vertically */
  form[action="/api/subscribe-newsletter.php"] {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  form[action="/api/subscribe-newsletter.php"] input,
  form[action="/api/subscribe-newsletter.php"] button {
    width: 100% !important;
  }

  /* Fix newsletter container padding */
  section.container>div[style*="background: linear-gradient"] {
    padding: 2rem 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  section.container>div[style*="background: linear-gradient"] h2 {
    font-size: 1.5rem !important;
  }

  section.container>div[style*="background: linear-gradient"] p {
    font-size: 1rem !important;
    padding: 0 0.5rem;
  }
}

/* ===== POPULAR DOWNLOADS SECTION MOBILE FIXES ===== */
@media (max-width: 768px) {

  /* Fix background section */
  section[style*="background: #f0fdf4"] {
    padding: 2rem 1rem !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
  }
}

/* ===== RECENT UPLOADS CARD FIXES ===== */
@media (max-width: 768px) {

  /* Fix recent docs cards that have flex layout */
  .card[style*="display: flex"] {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .card[style*="display: flex"]>div[style*="width: 120px"] {
    width: 100% !important;
    height: 120px !important;
    margin: 0 auto;
  }
}

/* ===== GENERAL MOBILE SPACING FIXES ===== */
@media (max-width: 480px) {

  /* Reduce container padding on very small screens */
  .container {
    padding: 1rem 0.75rem !important;
  }

  /* Fix section margins */
  section.container {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Fix any remaining grid issues */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  /* Ensure all text respects viewport */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* ===== CARD ICON/IMAGE FIXES ===== */
@media (max-width: 480px) {
  .card img[style*="width: 80px"] {
    width: 60px !important;
    height: 60px !important;
  }
}

/* ===== ENSURE NO ELEMENT CAUSES OVERFLOW ===== */
* {
  max-width: 100%;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Prevent any absolute positioned elements from causing overflow */
@media (max-width: 768px) {
  *[style*="position: absolute"] {
    max-width: calc(100vw - 2rem);
  }
}

/* ===== ITEM.PHP MOBILE RESPONSIVE FIXES ===== */

/* Desktop: 2-column layout (content + sidebar) */
.item-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* Mobile: Stack vertically, sidebar first for better UX */
@media (max-width: 992px) {
  .item-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Move sidebar (purchase card) to top on mobile */
  .item-layout aside {
    order: -1;
  }

  .item-layout section {
    order: 1;
  }
}

/* ===== ITEM PAGE STICKY SIDEBAR FIX ===== */
@media (max-width: 992px) {

  /* Remove sticky positioning on mobile */
  aside>div[style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }
}

/* ===== ITEM DETAILS TABLE RESPONSIVE ===== */
@media (max-width: 768px) {

  /* Make document details table more readable */
  .item-details-table table {
    font-size: 0.9rem;
  }

  .item-details-table td {
    padding: 0.75rem 0.5rem !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .item-details-table td:first-child {
    width: 40%;
    font-weight: 600;
  }

  .item-details-table td:last-child {
    width: 60%;
  }
}

@media (max-width: 480px) {

  /* Stack table rows more tightly on very small screens */
  .item-details-table table {
    font-size: 0.85rem;
  }

  .item-details-table td {
    padding: 0.6rem 0.25rem !important;
    display: block;
    width: 100% !important;
    border-bottom: 1px solid var(--neutral-200);
  }

  .item-details-table tr {
    display: block;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--neutral-300);
  }

  .item-details-table td:first-child {
    padding-bottom: 0.25rem !important;
    color: var(--neutral-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .item-details-table td:last-child {
    padding-top: 0.25rem !important;
    font-weight: 600;
    color: var(--neutral-900);
  }
}

/* ===== PURCHASE CARD MOBILE FIXES ===== */
@media (max-width: 768px) {

  /* Make purchase card full width with better spacing */
  aside>div {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1.5rem;
  }

  /* Adjust price display */
  .card-price {
    font-size: 1.75rem !important;
    margin-bottom: 1rem !important;
  }

  /* Make buttons more touch-friendly */
  aside button,
  aside a.btn-primary {
    padding: 1rem !important;
    font-size: 1rem !important;
    min-height: 48px;
    /* Better touch target */
  }

  /* Guest email input */
  #guest-email {
    padding: 0.875rem !important;
    font-size: 1rem !important;
    min-height: 48px;
  }
}

/* ===== BREADCRUMB MOBILE FIX ===== */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .breadcrumb::-webkit-scrollbar {
    height: 4px;
  }

  .breadcrumb::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 2px;
  }
}

/* ===== PAGE TITLE MOBILE ===== */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem !important;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.25rem !important;
  }
}

/* ===== DOCUMENT DETAILS SECTION MOBILE ===== */
@media (max-width: 768px) {

  /* Reduce padding in white boxes */
  section>div[style*="background: white"] {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  /* Description text */
  section p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  section>div[style*="background: white"] {
    padding: 1.25rem 0.75rem !important;
    border-radius: 6px !important;
  }

  section h3 {
    font-size: 1rem;
  }
}

/* ===== GUEST PURCHASE FORM MOBILE ===== */
@media (max-width: 768px) {
  #guest-purchase-form p {
    font-size: 0.85rem !important;
    margin-bottom: 0.75rem !important;
    padding: 0 0.25rem;
  }

  #guest-purchase-form small {
    font-size: 0.75rem !important;
  }
}

/* ===== SECURE PAYMENT BADGE ===== */
@media (max-width: 768px) {
  aside small {
    font-size: 0.8rem !important;
    padding: 0 0.5rem;
  }
}

/* ===== CONTAINER MOBILE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  main.container {
    padding: 1.5rem 1rem !important;
  }
}

@media (max-width: 480px) {
  main.container {
    padding: 1rem 0.75rem !important;
  }
}

/* ===== ENHANCED TOUCH TARGETS FOR MOBILE ===== */
@media (max-width: 768px) {

  /* All clickable elements should be at least 44x44px for accessibility */
  button,
  a.btn-primary,
  a.btn-secondary,
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Links in text should have more padding */
  a {
    padding: 0.25rem 0;
    display: inline-block;
  }
}

/* ===== PREVENT HORIZONTAL OVERFLOW ===== */
@media (max-width: 768px) {

  /* Ensure nothing causes horizontal scroll */
  main.container>div,
  section,
  aside,
  table {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Long text should break properly */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  td,
  th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* ===== LOADING STATES (BONUS) ===== */
@media (max-width: 768px) {

  /* When Paystack popup opens, prevent body scroll */
  body.paystack-open {
    overflow: hidden;
  }

  /* Add visual feedback for button clicks */
  button:active,
  a.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* ===== PRINT STYLES (BONUS) ===== */
@media print {
  aside {
    display: none !important;
  }

  main.container>div {
    grid-template-columns: 1fr !important;
  }
}

/* ===== CRITICAL FIX FOR TABLE LAYOUT ON MOBILE ===== */

/* Force table to be 100% width and remove any extra spacing */
@media (max-width: 768px) {

  /* Remove table structure completely on mobile */
  .item-details-table table,
  .item-details-table tbody,
  .item-details-table tr,
  .item-details-table td {
    display: block !important;
    width: 100% !important;
  }

  /* Reset all table elements */
  .item-details-table table {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Style each row as a card-like item */
  .item-details-table tr {
    margin-bottom: 1rem !important;
    padding: 0.75rem !important;
    background: var(--neutral-50) !important;
    border-radius: 6px !important;
    border: 1px solid var(--neutral-200) !important;
  }

  /* First cell (label) */
  .item-details-table td:first-child {
    display: block !important;
    width: 100% !important;
    padding: 0 0 0.25rem 0 !important;
    border: none !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--neutral-600) !important;
    font-weight: 600 !important;
  }

  /* Second cell (value) */
  .item-details-table td:last-child {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.95rem !important;
    color: var(--neutral-900) !important;
    font-weight: 500 !important;
  }

  /* Remove strong tags from labels on mobile */
  .item-details-table td:first-child strong {
    font-weight: inherit;
  }
}

/* ===== ENSURE NO OVERFLOW ON CONTAINER ===== */
@media (max-width: 768px) {

  /* Force all containers to respect viewport */
  .item-details-table,
  .item-details-table>div,
  section>div {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Reduce padding to prevent overflow */
  section>div[style*="background: white"] {
    padding: 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Fix page title word break */
  .page-title {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
  }
}

/* ===== ALTERNATIVE: DEFINITION LIST STYLE (RECOMMENDED) ===== */
@media (max-width: 768px) {

  /* Style for better mobile presentation */
  .item-details-table tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    padding: 0.875rem 1rem !important;
    margin-bottom: 0.75rem !important;
    background: linear-gradient(135deg, var(--neutral-50) 0%, white 100%) !important;
    border-left: 3px solid var(--primary-light) !important;
  }

  /* Badge style for values with background */
  .item-details-table td:last-child span[style*="background"] {
    display: inline-block !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
}

/* ===== FIX SPECIFIC MOBILE VIEWPORT ISSUES ===== */
@media (max-width: 480px) {

  /* Ensure container respects mobile viewport */
  main.container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Reduce all card padding */
  .item-details-table>div,
  section>div[style*="background: white"] {
    padding: 0.875rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Make table rows more compact */
  .item-details-table tr {
    padding: 0.75rem 0.875rem !important;
    margin-bottom: 0.625rem !important;
  }

  /* Smaller text on very small screens */
  .item-details-table td:first-child {
    font-size: 0.7rem !important;
  }

  .item-details-table td:last-child {
    font-size: 0.875rem !important;
  }
}

/* ===== GLOBAL MOBILE OVERFLOW PREVENTION ===== */
@media (max-width: 768px) {

  /* Nuclear option: prevent any horizontal scroll */
  html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative !important;
  }

  * {
    max-width: 100% !important;
  }

  /* Except for these elements that need specific widths */
  button,
  input,
  select,
  textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ===== BREADCRUMB FIX FOR LONG TEXT ===== */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.75rem !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .breadcrumb::-webkit-scrollbar {
    height: 3px !important;
  }

  .breadcrumb::-webkit-scrollbar-thumb {
    background: var(--neutral-300) !important;
    border-radius: 3px !important;
  }
}

/* ========================================
   COMPLETE MOBILE RESPONSIVE FIX
   Add this entire section to the END of your style.css
   ======================================== */

/* ===== GLOBAL MOBILE OVERFLOW PREVENTION ===== */
@media (max-width: 768px) {

  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  * {
    box-sizing: border-box !important;
  }
}

/* ===== HERO SECTION MOBILE FIX ===== */
@media (max-width: 768px) {
  .hero {
    padding: 0 !important;
    margin-bottom: 2rem;
  }

  .hero .container {
    padding: 2.5rem 1rem !important;
  }

  .hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
  }

  .hero p {
    font-size: 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  /* Floating decoration */
  .hero>div[style*="position: absolute"] {
    width: 200px !important;
    height: 200px !important;
    right: -15% !important;
    opacity: 0.3 !important;
  }

  /* Button container */
  .hero .container>div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Buttons */
  .hero a.btn-primary,
  .hero a.btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem !important;
    display: block !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .hero .container {
    padding: 2rem 0.75rem !important;
  }

  .hero h1 {
    font-size: 1.5rem !important;
  }

  .hero p {
    font-size: 0.9rem !important;
  }
}

/* ===== BROWSE BY CATEGORY SECTION ===== */
@media (max-width: 768px) {
  section.container>.grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  section.container>.grid>a.card {
    padding: 1.25rem 1rem !important;
  }

  section.container>.grid>a.card img {
    width: 60px !important;
    height: 60px !important;
  }

  section.container>.grid>a.card h3 {
    font-size: 0.95rem !important;
  }

  section.container>.grid>a.card p {
    font-size: 0.8rem !important;
  }
}

@media (max-width: 480px) {
  section.container>.grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== POPULAR DOWNLOADS & SECTIONS WITH BACKGROUNDS ===== */
@media (max-width: 768px) {

  section[style*="background: #f0fdf4"],
  section[style*="background: linear-gradient"] {
    padding: 2rem 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 8px !important;
  }

  section[style*="background: #f0fdf4"] .grid,
  section .grid-cols-3,
  section .grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* ===== HOW IT WORKS SECTION ===== */
@media (max-width: 768px) {

  /* Stack steps vertically */
  .how-it-works-grid,
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Stack benefits vertically */
  .why-choose-grid,
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Step icons */
  div[style*="width: 80px; height: 80px"] {
    width: 70px !important;
    height: 70px !important;
    font-size: 1.75rem !important;
  }
}

@media (max-width: 480px) {

  .how-it-works-grid,
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* ===== NEWSLETTER SECTION ===== */
@media (max-width: 768px) {
  section.container>div[style*="background: linear-gradient(135deg, var(--primary)"] {
    padding: 2.5rem 1rem !important;
  }

  form[action="/api/subscribe-newsletter.php"] {
    flex-direction: column !important;
    padding: 0 0.5rem !important;
    gap: 0.75rem !important;
  }

  form[action="/api/subscribe-newsletter.php"] input,
  form[action="/api/subscribe-newsletter.php"] button {
    width: 100% !important;
    padding: 0.875rem !important;
    font-size: 1rem !important;
  }
}

/* ===== RECENT UPLOADS / CARDS WITH FLEX ===== */
@media (max-width: 768px) {
  .card[style*="display: flex"] {
    flex-direction: column !important;
    padding: 1.25rem !important;
  }

  .card[style*="display: flex"]>div[style*="width: 120px"] {
    width: 100% !important;
    height: 100px !important;
    margin-bottom: 1rem;
  }
}

/* ===== ITEM.PHP PAGE FIXES ===== */
@media (max-width: 992px) {

  /* Stack item layout */
  .item-layout,
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Remove sticky positioning on mobile */
  aside>div[style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }
}

/* Mobile optimized detail items */
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, var(--neutral-50) 0%, white 100%);
  border-radius: 6px;
  border-left: 3px solid var(--primary-light);
  margin-bottom: 0.75rem;
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-600);
  font-weight: 600;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--neutral-900);
  font-weight: 500;
  word-break: break-word;
}

/* ===== GLOBAL CONTAINER PADDING ===== */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .page-title {
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    word-break: break-word !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .page-title {
    font-size: 1.25rem !important;
  }
}

/* ===== PREVENT ALL SECTIONS FROM OVERFLOWING ===== */
@media (max-width: 768px) {

  main>section,
  section.container,
  section.container>div {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .grid,
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .card {
    max-width: 100% !important;
  }
}

/* ===== BREADCRUMB MOBILE ===== */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.75rem !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    padding-bottom: 0.5rem;
  }

  .breadcrumb::-webkit-scrollbar {
    height: 3px !important;
  }

  .breadcrumb::-webkit-scrollbar-thumb {
    background: var(--neutral-300) !important;
    border-radius: 3px !important;
  }
}

/* ===== BUTTONS MOBILE TOUCH TARGETS ===== */
@media (max-width: 768px) {

  button,
  a.btn-primary,
  a.btn-secondary,
  input[type="submit"] {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* ===== PURCHASE CARD MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {

  .purchase-card,
  aside>div {
    padding: 1.5rem 1rem !important;
  }

  .card-price {
    font-size: 1.75rem !important;
  }

  #guest-email,
  .guest-email-input,
  #guest-email-desktop {
    padding: 0.875rem !important;
    font-size: 1rem !important;
    min-height: 48px !important;
  }
}

/* ===== SHOW/HIDE MOBILE UTILITIES ===== */
.show-mobile {
  display: none;
}

@media (max-width: 992px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

/* ===== ENSURE PROPER TEXT WRAPPING ===== */
@media (max-width: 768px) {

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  td,
  th,
  span,
  div {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
}

/* ===== ANIMATION KEYFRAMES ===== */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* ===== ENHANCED BROWSE PAGE CARD STYLES ===== */

/* Browse page container */
.browse-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* Breadcrumb styling */
.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--neutral-600);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Enhanced navigation cards (levels, grades, terms) */
.browse-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  border: 2px solid var(--neutral-100);
  position: relative;
  overflow: hidden;
}

.browse-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.browse-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.15);
  border-color: var(--primary-light);
}

.browse-card:hover::before {
  transform: scaleY(1);
}

.browse-card-content {
  flex: 1;
}

.browse-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 0.25rem;
}

.browse-card-subtitle {
  font-size: 0.875rem;
  color: var(--neutral-500);
}

.browse-card-arrow {
  width: 40px;
  height: 40px;
  background: var(--highlight);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.browse-card:hover .browse-card-arrow {
  background: var(--primary);
  color: white;
  transform: translateX(5px);
}

/* Document cards */
.document-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid var(--neutral-100);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.document-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.15);
  border-color: var(--primary-light);
}

.document-card:hover::before {
  transform: scaleX(1);
}

.document-card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
}

.document-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.document-card-description {
  color: var(--neutral-600);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.document-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral-100);
}

.document-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.document-card-downloads {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--neutral-500);
  font-size: 0.875rem;
}

.document-card-button {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.document-card-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.document-card-button::after {
  content: "→";
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.document-card-button:hover::after {
  transform: translateX(5px);
}

/* Empty state */
.browse-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  border: 2px dashed var(--neutral-200);
}

.browse-empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.browse-empty-state-title {
  font-size: 1.5rem;
  color: var(--neutral-900);
  margin-bottom: 0.5rem;
}

.browse-empty-state-text {
  color: var(--neutral-600);
  margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .browse-card {
    padding: 1.5rem;
  }

  .browse-card-title {
    font-size: 1.1rem;
  }

  .browse-card-arrow {
    width: 35px;
    height: 35px;
    font-size: 1.1rem;
  }

  .document-card {
    padding: 1.25rem;
  }

  .document-card-title {
    font-size: 1rem;
  }

  .document-card-price {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .browse-container {
    padding: 1rem;
  }

  .browse-card {
    padding: 1.25rem;
  }

  .browse-card-title {
    font-size: 1rem;
  }

  .document-card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .document-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ========================================
   CATEGORY CARDS v2 — Premium Hue-Themed
   ======================================== */

/* ── Grid ── */
.catv2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 0 0.5rem;
}

/* ── Card ── */
.catv2-card {
  --accent: hsl(var(--card-hue, 200) 70% 48%);
  --accent-bg: hsl(var(--card-hue, 200) 80% 96%);
  --accent-icon-bg: hsl(var(--card-hue, 200) 65% 92%);
  --accent-dark: hsl(var(--card-hue, 200) 70% 35%);

  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 1px solid hsl(var(--card-hue, 200) 20% 92%);
  border-radius: 14px;
  padding: 1.6rem 1.5rem 1.25rem;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(.4, 0, .2, 1),
    box-shadow 0.35s cubic-bezier(.4, 0, .2, 1),
    border-color 0.3s ease;

  /* Staggered entrance */
  opacity: 0;
  transform: translateY(24px);
  animation: catv2FadeIn 0.5s ease forwards;
  animation-delay: calc(var(--anim-order, 0) * 60ms);
}

@keyframes catv2FadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catv2-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 12px 28px hsl(var(--card-hue, 200) 60% 70% / 0.18),
    0 2px 6px hsl(var(--card-hue, 200) 40% 60% / 0.08);
  border-color: hsl(var(--card-hue, 200) 55% 80%);
}

/* ── Top Accent Strip ── */
.catv2-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(
    90deg,
    var(--accent),
    hsl(calc(var(--card-hue, 200) + 30) 70% 55%)
  );
  border-radius: 14px 14px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
}

.catv2-card:hover .catv2-accent {
  transform: scaleX(1);
}

/* ── Icon ── */
.catv2-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--accent-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.35s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
}

.catv2-icon i {
  font-size: 1.35rem;
  color: var(--accent);
  transition: color 0.3s ease, transform 0.3s ease;
}

.catv2-card:hover .catv2-icon {
  background: var(--accent);
  box-shadow: 0 6px 16px hsl(var(--card-hue, 200) 60% 50% / 0.3);
  transform: scale(1.08);
}

.catv2-card:hover .catv2-icon i {
  color: #fff;
  transform: scale(1.1);
}

/* ── Body ── */
.catv2-body {
  flex: 1;
  min-height: 0;
}

.catv2-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.4rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.catv2-card:hover .catv2-title {
  color: var(--accent-dark);
}

.catv2-desc {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Footer ── */
.catv2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid hsl(var(--card-hue, 200) 15% 94%);
  margin-top: auto;
}

.catv2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.catv2-badge i {
  font-size: 0.7rem;
}

.catv2-badge--empty {
  background: #f3f4f6;
  color: #9ca3af;
}

.catv2-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.3s ease;
}

.catv2-arrow i {
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.catv2-card:hover .catv2-arrow {
  gap: 0.55rem;
}

.catv2-card:hover .catv2-arrow i {
  transform: translateX(3px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .catv2-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 0;
  }

  .catv2-card {
    padding: 1.35rem 1.25rem 1.1rem;
  }

  .catv2-icon {
    width: 46px;
    height: 46px;
  }

  .catv2-icon i {
    font-size: 1.2rem;
  }

  .catv2-title {
    font-size: 0.98rem;
  }
}

@media (max-width: 480px) {
  .catv2-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .catv2-card {
    padding: 1.15rem 1rem 0.95rem;
  }

  .catv2-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 0.75rem;
  }

  .catv2-icon i {
    font-size: 1.05rem;
  }

  .catv2-title {
    font-size: 0.88rem;
  }

  .catv2-desc {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin-bottom: 0.65rem;
  }

  .catv2-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding-top: 0.65rem;
  }

  .catv2-badge {
    font-size: 0.65rem;
  }

  .catv2-arrow {
    font-size: 0.75rem;
  }
}


/* ===== ENHANCED BROWSE CARDS WITH DYNAMIC COLORS ===== */
.browse-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--neutral-200);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    color: var(--neutral-900);
}

.browse-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: transparent !important;
}

.browse-card-content {
    flex: 1;
    z-index: 1;
}

.browse-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.browse-card-subtitle {
    font-size: 0.875rem;
    color: var(--neutral-600);
    font-weight: 500;
    line-height: 1.4;
}

.browse-card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.browse-card:hover .browse-card-arrow {
    transform: translateX(5px);
    background: white;
}

/* Color Variants */
.browse-card--emerald { 
    background: #ecfdf5; 
    border-color: #d1fae5; 
    --card-brand: #065f46; 
}
.browse-card--emerald .browse-card-subtitle { color: var(--card-brand); opacity: 0.8; }
.browse-card--emerald .browse-card-arrow { color: #059669; }

.browse-card--blue { 
    background: #eff6ff; 
    border-color: #dbeafe; 
    --card-brand: #1e40af; 
}
.browse-card--blue .browse-card-subtitle { color: var(--card-brand); opacity: 0.8; }
.browse-card--blue .browse-card-arrow { color: #2563eb; }

.browse-card--amber { 
    background: #fff9eb; 
    border-color: #fef3c7; 
    --card-brand: #92400e; 
}
.browse-card--amber .browse-card-subtitle { color: var(--card-brand); opacity: 0.8; }
.browse-card--amber .browse-card-arrow { color: #d97706; }

.browse-card--rose { 
    background: #fff1f2; 
    border-color: #ffe4e6; 
    --card-brand: #9f1239; 
}
.browse-card--rose .browse-card-subtitle { color: var(--card-brand); opacity: 0.8; }
.browse-card--rose .browse-card-arrow { color: #e11d48; }

.browse-card--indigo { 
    background: #eef2ff; 
    border-color: #e0e7ff; 
    --card-brand: #3730a3; 
}
.browse-card--indigo .browse-card-subtitle { color: var(--card-brand); opacity: 0.8; }
.browse-card--indigo .browse-card-arrow { color: #4f46e5; }

/* Document Count Badge */
.doc-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ===== HIGH-FIDELITY SOLID SHORTCUT BUTTONS (IMAGE MATCH) ===== */
.shortcut-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    z-index: 2;
    position: relative;
}

.shortcut-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: var(--card-brand, var(--neutral-900));
    color: white !important;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none !important;
    text-transform: capitalize;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
    border: none;
}

.shortcut-pill:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    filter: brightness(1.15);
}

.shortcut-pill--more {
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    border: 1px dashed #d1d5db !important;
    box-shadow: none;
    cursor: default;
    opacity: 0.8;
}

.shortcut-pill--more:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

.browse-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.browse-card-container {
    display: block;
    position: relative;
    text-decoration: none;
    height: 100%;
}

/* ==========================================
   AUTH LOADING BOX & CSS SPINNER
   ========================================== */
.auth-loading-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.96); /* Elegant white glassmorphism overlay */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; /* Controlled via JS */
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-loading-box.active {
  opacity: 1;
}

.auth-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #10b981; /* Emerald theme accent */
}

.auth-loading-text {
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1e293b; /* Slate-800 */
}

/* CSS Spinner (lds-spinner) */
.lds-spinner,
.lds-spinner div,
.lds-spinner div:after {
  box-sizing: border-box;
}
.lds-spinner {
  color: currentColor;
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-spinner div {
  transform-origin: 40px 40px;
  animation: lds-spinner 1.2s linear infinite;
}
.lds-spinner div:after {
  content: " ";
  display: block;
  position: absolute;
  top: 3.2px;
  left: 36.8px;
  width: 6.4px;
  height: 17.6px;
  border-radius: 20%;
  background: currentColor;
}
.lds-spinner div:nth-child(1) {
  transform: rotate(0deg);
  animation-delay: -1.1s;
}
.lds-spinner div:nth-child(2) {
  transform: rotate(30deg);
  animation-delay: -1s;
}
.lds-spinner div:nth-child(3) {
  transform: rotate(60deg);
  animation-delay: -0.9s;
}
.lds-spinner div:nth-child(4) {
  transform: rotate(90deg);
  animation-delay: -0.8s;
}
.lds-spinner div:nth-child(5) {
  transform: rotate(120deg);
  animation-delay: -0.7s;
}
.lds-spinner div:nth-child(6) {
  transform: rotate(150deg);
  animation-delay: -0.6s;
}
.lds-spinner div:nth-child(7) {
  transform: rotate(180deg);
  animation-delay: -0.5s;
}
.lds-spinner div:nth-child(8) {
  transform: rotate(210deg);
  animation-delay: -0.4s;
}
.lds-spinner div:nth-child(9) {
  transform: rotate(240deg);
  animation-delay: -0.3s;
}
.lds-spinner div:nth-child(10) {
  transform: rotate(270deg);
  animation-delay: -0.2s;
}
.lds-spinner div:nth-child(11) {
  transform: rotate(300deg);
  animation-delay: -0.1s;
}
.lds-spinner div:nth-child(12) {
  transform: rotate(330deg);
  animation-delay: 0s;
}
@keyframes lds-spinner {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}