/* ==========================================================================
   ACADEMIA STORE DESIGN SYSTEM (Stripe / Linear Editorial Style)
   Font: IBM Plex Sans Arabic | Palette: Minimal Charcoal, Slate, Forest Green
   ========================================================================== */

:root {
  /* Editorial Color Tokens */
  --bg-page: #FBFBFA;
  --bg-surface: #FFFFFF;
  --bg-surface-raised: #F4F5F3;
  --bg-surface-hover: #ECEEEB;
  --bg-dark-accent: #121316;

  /* Typography & Foreground */
  --text-main: #121316;
  --text-secondary: #575B5F;
  --text-muted: #858A8E;
  --text-inverted: #FFFFFF;

  /* 1px Linear Micro-Borders */
  --border-subtle: #E6E7E4;
  --border-medium: #D0D3D0;
  --border-focus: #1E3A2F;

  /* Editorial Accents */
  --accent-primary: #1E3A2F;       /* Deep Academic Forest Green */
  --accent-primary-hover: #294D3F;
  --accent-light: #EBF2EE;
  --accent-tag-fg: #1E3A2F;

  --accent-warm: #C85A27;          /* Terracotta for Badges/Discounts */
  --accent-warm-light: #FBF0EB;

  --accent-success: #1E6B43;
  --accent-success-bg: #E8F5EE;

  /* Shadows (Subtle, Linear-style 1px depth) */
  --shadow-sm: 0 1px 2px rgba(18, 19, 22, 0.04), 0 0 0 1px var(--border-subtle);
  --shadow-md: 0 4px 12px rgba(18, 19, 22, 0.06), 0 0 0 1px var(--border-subtle);
  --shadow-lg: 0 12px 32px rgba(18, 19, 22, 0.09), 0 0 0 1px var(--border-subtle);
  --shadow-drawer: 0 20px 48px rgba(0, 0, 0, 0.14);

  /* Geometry & Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 140ms var(--ease-snappy);
  --transition-normal: 240ms var(--ease-spring);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  background-color: var(--bg-page);
}

/* Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Accessibility & Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   TOP ANNOUNCEMENT BAR
   ========================================================================== */
.announcement-bar {
  background-color: var(--bg-dark-accent);
  color: var(--text-inverted);
  padding: 0.55rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: center;
}

.announcement-badge {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.announcement-text {
  color: rgba(255, 255, 255, 0.9);
}

.promo-code {
  color: #F8D377;
  font-family: monospace;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.btn-text-sm {
  background: none;
  border: none;
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(251, 251, 250, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Brand */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast);
}

.brand-logo:hover .brand-mark {
  transform: scale(1.03);
}

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

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Desktop Nav Links */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 860px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-raised);
}

.nav-link.active {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  font-weight: 600;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-subtle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.lang-code {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.btn-secondary-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-secondary-sm:hover {
  background-color: var(--bg-surface-raised);
  border-color: var(--border-medium);
}

.btn-secondary-sm:active {
  transform: scale(0.98);
}

/* Cart Trigger Badge Button */
.cart-trigger-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cart-trigger-btn:hover {
  background-color: var(--accent-primary-hover);
}

.cart-trigger-btn:active {
  transform: scale(0.96);
}

.cart-count {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 18px;
  height: 18px;
  background-color: var(--accent-warm);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-page);
}

/* ==========================================================================
   HERO SECTION (Editorial Minimal)
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-inner {
  max-width: 860px;
}

.hero-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent-light);
  color: var(--accent-primary);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #2BA064;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(43, 160, 100, 0.2);
}

.hero-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 740px;
}

.hero-metrics {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metric-divider {
  width: 1px;
  height: 28px;
  background-color: var(--border-subtle);
}

/* ==========================================================================
   CATALOG & TOOLBAR
   ========================================================================== */
.catalog-section {
  padding: 2rem 0 4rem;
}

.catalog-toolbar {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Live Search Box */
.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 1rem;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding-inline-start: 2.75rem;
  padding-inline-end: 2.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 47, 0.1);
}

.clear-search-btn {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.75rem;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--bg-surface-raised);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  white-space: nowrap;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-main);
}

.pill-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFFFFF;
  font-weight: 600;
}

/* Toolbar Subcontrols */
.toolbar-subcontrols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   PRODUCT CARDS GRID (Editorial 1px Structure)
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  background-color: var(--bg-surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-badge.badge-medical {
  background-color: #EEF5F8;
  color: #164E63;
  border-color: #D1E5ED;
}

.card-badge.badge-tech {
  background-color: #F0FDF4;
  color: #166534;
  border-color: #DCFCE7;
}

.card-badge.badge-business {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

.card-badge.badge-templates {
  background-color: #F3E8FF;
  color: #6B21A8;
  border-color: #E9D5FF;
}

.card-badge.badge-research {
  background-color: #FFF1F2;
  color: #9F1239;
  border-color: #FFE4E6;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.star-icon {
  color: #D97706;
  font-size: 0.9rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Specs Chips */
.card-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-page);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Card Bottom & Pricing */
.card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.price-group {
  display: flex;
  flex-direction: column;
}

.price-current {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.price-original {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-top: 0.2rem;
}

.card-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-preview {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-preview:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-main);
}

.btn-add-cart {
  background-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: #FFFFFF;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-add-cart:hover {
  background-color: var(--accent-primary-hover);
}

.btn-add-cart:active {
  transform: scale(0.96);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   GUARANTEE EDITORIAL BANNER
   ========================================================================== */
.guarantee-section {
  padding-bottom: 3.5rem;
}

.guarantee-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.guarantee-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

.guarantee-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.guarantee-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.guarantee-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.guarantee-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.brand-mark-sm {
  width: 26px;
  height: 26px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 380px;
}

.footer-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge-tag-success {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  background-color: var(--accent-success-bg);
  border: 1px solid var(--accent-success);
  color: var(--accent-success);
  font-weight: 600;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-main);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.subtle-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-indicator {
  width: 6px;
  height: 6px;
  background-color: #22C55E;
  border-radius: 50%;
}

/* ==========================================================================
   BUTTONS SYSTEM
   ========================================================================== */
.btn-primary {
  background-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: #FFFFFF;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-raised);
  border-color: var(--border-medium);
}

.btn-secondary-xs {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}

.btn-secondary-xs:hover {
  background-color: var(--bg-surface-raised);
  color: var(--text-main);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(18, 19, 22, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 180ms ease;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 220ms var(--ease-spring);
}

.modal-md {
  max-width: 580px;
}

.modal-lg {
  max-width: 880px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body-scroll {
  padding: 1.5rem;
  overflow-y: auto;
}

/* ==========================================================================
   PRODUCT PREVIEW MODAL INTERNALS
   ========================================================================== */
.preview-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .preview-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.preview-viewport-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-sheet-frame {
  background-color: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.sheet-top-bar {
  background-color: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sheet-dot {
  width: 8px;
  height: 8px;
  background-color: #CBD5E1;
  border-radius: 50%;
}

.sheet-content-viewer {
  padding: 1.5rem;
  min-height: 280px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-main);
  background: repeating-linear-gradient(
    0deg,
    #FFFFFF,
    #FFFFFF 28px,
    #F9FAF9 29px,
    #F9FAF9 30px
  );
}

.sheet-sample-header {
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sheet-sample-h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.sheet-sample-h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  color: var(--text-main);
}

.sheet-key-takeaways {
  background-color: var(--accent-light);
  border-right: 3px solid var(--accent-primary);
  padding: 0.6rem 0.8rem;
  margin: 0.75rem 0;
  border-radius: var(--radius-xs);
}

.preview-sheet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview Meta Sidebar */
.preview-meta-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.meta-price-box {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.meta-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.meta-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.meta-old-price {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.meta-discount-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--accent-warm-light);
  color: var(--accent-warm);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
}

.meta-price-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 0.35rem;
}

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

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

.toc-container {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background-color: var(--bg-page);
}

.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.toc-list {
  list-style-type: decimal;
  padding-inline-start: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reviews-preview {
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.review-quote {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* ==========================================================================
   CART SLIDE-OVER DRAWER
   ========================================================================== */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background-color: rgba(18, 19, 22, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 160ms ease;
}

[dir="rtl"] .cart-drawer-overlay {
  justify-content: flex-start;
}

.cart-drawer {
  width: 100%;
  max-width: 440px;
  height: 100%;
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  animation: drawerSlide 240ms var(--ease-spring);
}

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

.cart-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cart-drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-items-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--bg-surface-raised);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.cart-empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.cart-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.cart-empty-state h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.cart-empty-state p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.cart-item-format {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cart-item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-remove-cart {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-remove-cart:hover {
  color: #DC2626;
}

/* Cart Footer Block */
.cart-drawer-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coupon-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.coupon-input-group {
  display: flex;
  gap: 0.4rem;
}

.coupon-input-group input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
}

.coupon-input-group input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.coupon-feedback {
  font-size: 0.75rem;
  font-weight: 600;
}

.coupon-feedback.success {
  color: var(--accent-success);
}

.coupon-feedback.error {
  color: #DC2626;
}

.summary-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.summary-row.total-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.text-success {
  color: var(--accent-success);
  font-weight: 600;
}

.checkout-secure-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   RECEIPT & INVOICE MODAL
   ========================================================================== */
.receipt-invoice-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.receipt-top-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.receipt-meta-label {
  color: var(--text-muted);
  display: block;
}

.downloads-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.download-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.download-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.download-btn-link {
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.download-btn-link:hover {
  background-color: var(--accent-primary-hover);
}

.receipt-summary-box {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.receipt-actions-row {
  display: flex;
  gap: 0.75rem;
}

.receipt-actions-row button {
  flex: 1;
}

/* ==========================================================================
   SELLER FORM & DROPZONE
   ========================================================================== */
.seller-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem;
  text-align: center;
  background-color: var(--bg-page);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.dropzone-text {
  font-size: 0.85rem;
}

.dropzone-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hidden-file-input {
  display: none;
}

.seller-earnings-estimator {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.82rem;
}

.estimator-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   SEO & SCHEMA INSPECTOR MODAL
   ========================================================================== */
.seo-inspector-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.seo-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.code-box-wrapper {
  background-color: #121316;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-box-header {
  background-color: #1E2024;
  padding: 0.4rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #A0A5AA;
  font-size: 0.72rem;
  font-family: monospace;
}

.btn-copy-code {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  cursor: pointer;
}

.code-box {
  padding: 1rem;
  color: #7DD3FC;
  font-size: 0.75rem;
  font-family: monospace;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.seo-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.check-icon {
  color: var(--accent-success);
  font-weight: 700;
}

.check-item p {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-start: 1.5rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-dark-accent);
  color: #FFFFFF;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  animation: toastSlide 200ms var(--ease-spring);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.toast-success {
  border-inline-start: 4px solid #22C55E;
}

.toast.toast-warn {
  border-inline-start: 4px solid var(--accent-warm);
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

[dir="rtl"] @keyframes drawerSlide {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #printableReceipt, #printableReceipt * {
    visibility: visible;
  }
  #printableReceipt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
}