/* 
 * AppStore Discount - Modern Light Theme 
 * Design System: Clean, Airy, Colorful Accents
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Light Mode */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;

  --primary: #007aff;
  /* Apple Blue */
  --primary-dark: #0062cc;
  --secondary: #ff2d55;
  /* Apple Pink */

  --text-main: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-light: #e2e8f0;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Specific UI Elements */
  --nav-bg: rgba(255, 255, 255, 0.85);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Spacing & Radius */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body.index-pagination-fixed {
  padding-bottom: 112px;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  padding-top: 20px;
}

/* Header */
header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Anchor scroll offset for sticky header */
#trending-deals {
  scroll-margin-top: 90px;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

header .nav-content {
  width: min(100%, 1440px);
  max-width: 1440px;
  padding: 0 20px;
  box-sizing: border-box;
}

.logo {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.logo:hover {
  color: var(--text-main);
}

.logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}

.logo-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #111827;
}

.logo-title-accent {
  color: #2f7df6;
}

.logo-tagline {
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: clamp(0.08em, 0.55vw, 0.16em);
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2vw, 32px);
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  height: 100%;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.75vw, 14px);
  flex-wrap: nowrap;
  min-width: 0;
}

.main-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 clamp(8px, 0.75vw, 12px);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.main-nav-link:hover,
.main-nav-link:focus-visible,
.main-nav-link.is-active {
  color: var(--primary);
  background: #eef6ff;
  outline: none;
}

.main-nav-menu {
  position: relative;
}

.main-nav-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  display: none;
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  z-index: 250;
}

.main-nav-menu:hover .main-nav-menu-list,
.main-nav-menu:focus-within .main-nav-menu-list {
  display: grid;
  gap: 2px;
}

.main-nav-menu-list a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
}

.main-nav-menu-list a:hover,
.main-nav-menu-list a:focus-visible {
  color: var(--primary);
  background: #f1f7ff;
  outline: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: 0;
}

.mobile-nav-toggle {
  display: none;
}

@media (min-width: 901px) {
  .nav-content {
    flex-wrap: nowrap;
  }

  .logo {
    flex: 0 0 auto;
  }

  .nav-actions {
    flex-wrap: nowrap;
  }

  .main-nav {
    flex: 0 1 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .nav-right {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
}

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-secondary);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr)) minmax(280px, 1.5fr);
  gap: 28px;
  padding-top: 34px;
  padding-bottom: 34px;
}

.footer-column h2 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.footer-column a {
  display: block;
  width: fit-content;
  margin: 7px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 650;
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-email {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  word-break: break-word;
}

.footer-email:hover {
  text-decoration: underline;
}

.footer-legal {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.footer-legal p + p {
  margin-top: 8px;
}

@media (min-width: 901px) and (max-width: 1280px) {
  header .nav-content {
    gap: clamp(12px, 1.4vw, 24px);
  }

  .logo {
    gap: 10px;
  }

  .logo-tagline {
    letter-spacing: 0.18em;
  }

  .main-nav {
    gap: clamp(4px, 0.5vw, 8px);
  }

  .main-nav-link {
    padding: 0 8px;
    font-size: 0.86rem;
  }
}

.info-page-main {
  max-width: 920px;
  padding-top: 36px;
  padding-bottom: 12px;
}

.breadcrumbs {
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.info-page-intro h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
  color: var(--text-main);
}

.info-page-intro p,
.info-page-section p,
.info-page-section li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.info-page-intro .dates {
  color: var(--text-muted);
  font-weight: 700;
}

.info-page-section {
  margin-top: 34px;
}

.info-page-section h2 {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 1.35rem;
}

.info-page-section p + p {
  margin-top: 12px;
}

.info-page-section ul {
  margin: 12px 0 0 20px;
}

.info-page-section a {
  color: var(--primary);
  font-weight: 750;
}

.region-switcher {
  position: relative;
}

.region-switcher-trigger {
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 1px solid #d8dee8;
  border-radius: 20px;
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.region-switcher-trigger:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 122, 255, 0.28);
}

.region-switcher.is-open .region-switcher-trigger {
  border-color: #c8d9ed;
  box-shadow: var(--shadow-md);
}

.region-flag {
  width: 34px;
  height: 24px;
  overflow: hidden;
  border: 1px solid #d9dde5;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  line-height: 1;
  flex-shrink: 0;
}

.region-flag img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.region-code {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.region-name {
  display: none;
}

.region-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
  margin-left: 2px;
  flex-shrink: 0;
}

.region-switcher.is-open .region-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.region-switcher-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 8px 0;
  border: 1px solid #d8dee8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  z-index: 220;
}

.region-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.region-option:hover,
.region-option:focus-visible {
  background: #f7fbff;
  outline: none;
}

.region-option.is-active {
  background: #f8fbff;
}

.region-option .region-flag {
  width: 32px;
  height: 22px;
}

.region-option-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.region-option-code {
  font-size: 0.98rem;
  font-weight: 500;
  color: #354154;
}

.region-option::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: #e8eef6;
}

.region-option:last-child::after {
  display: none;
}

.lang-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.lang-select {
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-main);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 160px;
}

.home-seo-intro {
  padding: 64px 0 0;
  text-align: center;
}

.home-seo-intro h1 {
  color: var(--text-main);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.category-deals-page main.container {
  padding-top: 34px;
}

.category-hero {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 0 0 28px;
  box-shadow: var(--shadow-sm);
}

.category-hero .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.category-hero .breadcrumb a,
.category-link,
.category-doc-section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.category-hero h1 {
  color: var(--text-main);
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 18px;
}

.category-hero .intro {
  max-width: 960px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 12px;
}

.category-hero .page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.category-hero .page-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
}

.category-featured-desc {
  color: var(--text-secondary);
  max-width: 980px;
  line-height: 1.7;
  margin: -10px 0 24px;
}

.category-doc-section {
  margin-top: 30px;
}

.category-doc-section h2 {
  color: var(--text-main);
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0 0 14px;
}

.category-doc-section > p {
  color: var(--text-secondary);
  max-width: 980px;
  line-height: 1.75;
  margin: 0 0 18px;
}

.category-doc-card,
.compact-app-card,
.price-drop-item,
.intent-card,
.editor-pick {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fff;
}

.category-doc-card {
  padding: 18px;
}

.category-doc-card > img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 12px;
}

.category-doc-card h3,
.compact-app-card h3,
.price-drop-item h3,
.intent-card h3,
.editor-pick h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.category-doc-card p,
.compact-app-card p,
.price-drop-item p,
.intent-card p,
.editor-pick p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
}

.price-row,
.meta-row,
.price-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 10px 0;
}

.current-price,
.deal-type,
.discount {
  font-weight: 800;
  color: var(--text-main);
}

.deal-type,
.discount {
  color: var(--primary);
}

.view-deal-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.app-list,
.price-drop-feed,
.editor-pick-list,
.intent-grid,
.category-link-grid {
  display: grid;
  gap: 14px;
}

.category-doc-section .app-list,
.category-doc-section .editor-pick-list {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.compact-app-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.compact-app-card > img {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  object-fit: cover;
}

.detected-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.intent-grid,
.category-link-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.intent-card,
.price-drop-item,
.editor-pick {
  padding: 18px;
}

.intent-card {
  display: flex;
  flex-direction: column;
}

.intent-card span {
  color: var(--primary);
  font-weight: 800;
  margin-top: auto;
}

/* Hero Section / Banner */
.hero-section {
  padding: 36px 0 40px;
  margin-bottom: 40px;
}

.banner-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 60px;
  position: relative;
  overflow: hidden;
}

.banner-bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e0f2fe 0%, #ffe4e6 100%);
  opacity: 0.3;
  z-index: 0;
}

.banner-content {
  position: relative;
  z-index: 1;
  flex: 1;
}

.banner-label {
  display: inline-block;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.banner-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text-main);
}

.banner-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 500px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.banner-deal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 42px;
  margin-bottom: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.banner-deal-prices {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.banner-deal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.banner-deal-badge.is-free {
  background: #dcfce7;
  color: #15803d;
}

.banner-deal-badge.is-discount {
  background: #f3e8ff;
  color: #7e22ce;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text-main);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-image {
  position: relative;
  z-index: 1;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.banner-app-icon {
  width: 200px;
  height: 200px;
  border-radius: 40px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

/* Sections */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.listing-breadcrumbs {
  display: none !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.listing-breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.listing-breadcrumbs a:hover {
  color: var(--primary);
}

.listing-breadcrumbs .crumb-sep {
  color: var(--text-muted);
}

/* Latest Arrivals */
.latest-grid-wrapper {
  overflow: visible;
}

.scroll-wrapper {
  overflow: visible;
}

.scroll-btn {
  display: none !important;
}

#latest-container,
.latest-grid,
.horizontal-scroll {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 0 20px;
  width: 100%;
  overflow: visible;
}

/* App Cards */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
}

.card-link:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 3px;
}

.card a:not(.card-link),
.card button,
.card select,
.card input,
.card textarea {
  position: relative;
  z-index: 2;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.app-meta {
  flex: 1;
  min-width: 0;
  /* truncate text fix */
}

.app-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.developer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Pricing Badges */
.price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-container-deal {
  align-items: flex-start;
  flex-direction: column;
  flex-wrap: nowrap;
}

.price-detail {
  display: flex;
  align-items: baseline;
  gap: 0;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.price-original {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  min-width: 0;
}

.deal-ended-note {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 10px;
}

.load-more-wrap[hidden],
.post-load-button[hidden],
.new-apps-load-status[hidden] {
  display: none !important;
}

body.current-kind-last-page #index-load-more-wrap,
body.current-kind-last-page #index-load-more,
body.current-kind-last-page #client-page-load-more,
body.current-kind-last-page #kind-load-more {
  display: none !important;
}

.post-load-button {
  width: auto;
  border: 0;
  transition: all .3s;
  padding: 12px 40px;
  font-size: 15px;
  letter-spacing: .5px;
  background-color: var(--primary);
  background-image: linear-gradient(90deg, #006eff, #13adff);
  box-shadow: 0 5px 10px 0 rgb(16 110 253 / 30%);
  color: #fff !important;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.post-load-button:hover {
  transform: translateY(-3px);
}

.post-load-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-free {
  background-color: #dcfce7;
  color: #15803d;
  /* Green */
}

.badge-discount {
  background-color: #f3e8ff;
  color: #7e22ce;
  /* Purple */
}

.badge-price {
  background-color: #e0f2fe;
  color: #0369a1;
}

.description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  flex: 1;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rating {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.star {
  color: #fbbf24;
}

.get-btn {
  background: #f1f5f9;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition-fast);
  border: none;
  /* Removed ugly border */
  cursor: pointer;
}

.get-btn:hover {
  background: var(--primary);
  color: white;
}

/* SEO Information */
.seo-info-section {
  margin-top: 56px;
  padding-bottom: 16px;
}

.seo-info-block {
  padding: 34px 0;
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.seo-info-block:first-child {
  border-top: 0;
}

.seo-info-block .section-title {
  margin-bottom: 18px;
}

.seo-info-block p {
  max-width: 920px;
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.75;
}

.seo-info-block ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 26px;
  max-width: 920px;
  margin: 18px 0 20px;
  padding-left: 22px;
}

.seo-info-block li {
  line-height: 1.55;
}

.seo-faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  max-width: 980px;
}

.seo-faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 18px;
}

.seo-faq-item h3 {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.35;
}

.seo-faq-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Controls / Filter */
.controls-container {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.controls {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

/* Sort Controls */
.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sort-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background-color: white;
  font-family: inherit;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: var(--primary);
}

.category-select {
  position: relative;
  width: 190px;
  max-width: 100%;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.2;
}

.category-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

#category-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-select-trigger:hover,
.category-select-trigger:focus-visible,
.category-select.is-open .category-select-trigger {
  border-color: var(--primary);
  outline: none;
}

.category-select-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.75;
  flex-shrink: 0;
}

.category-select.is-open .category-select-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.category-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 230;
  display: none;
  width: 100%;
  min-width: 190px;
  max-height: min(52vh, 320px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.category-select.is-open .category-select-menu {
  display: block;
}

.category-option {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 7px 12px;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.category-option:hover,
.category-option:focus-visible,
.category-option.is-active {
  background: var(--primary);
  color: #fff;
  outline: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.filter-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Grid Layouts */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding-bottom: 20px;
}

.app-grid.app-grid-with-pagination {
  padding-bottom: 0;
  margin-bottom: 28px;
}

.index-pagination {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: min(100% - 48px, 1200px);
  box-sizing: border-box;
  margin: 0;
  padding: 4px 12px 0;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.index-pagination-links {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.index-page-link {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
  background: rgba(248, 250, 252, 0.68);
}

.index-page-link:hover,
.index-page-link.is-active {
  background: var(--text-main);
  color: white;
}

.index-page-select {
  height: 32px;
  width: auto;
  min-width: 50px;
  padding: 0 24px 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  font: 700 0.95rem/1.15 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
}

.index-page-select option {
  font-size: 0.95rem;
  line-height: 1.15;
}

.index-page-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.new-apps-page .hero-section,
.new-apps-page main.container > .content-section:first-of-type:not(#trending-deals) {
  display: none;
}

.new-apps-page #trending-deals {
  margin-top: 40px !important;
}

.new-apps-load-status {
  grid-column: 1 / -1;
  padding: 22px 0 8px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
}

.new-apps-page .controls .divider[hidden],
.new-apps-page .filter-btn[hidden] {
  display: none !important;
}

/* Latest Section Specifics */
.latest-scroll-container {
  margin-bottom: 60px;
}

.mini-card {
  background: white;
  padding: 14px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  transition: var(--transition-fast);
  min-width: 0;
  min-height: 118px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.mini-media {
  width: 72px !important;
  min-width: 72px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
  border-right: 1px solid rgba(226, 232, 240, 0.85);
}

.mini-icon-wrap {
  width: 52px !important;
  height: 52px !important;
  flex-shrink: 0;
}

.mini-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  object-fit: cover;
}

.mini-card > div[style*="width:56px"] {
  width: 72px !important;
  min-width: 72px !important;
  height: 52px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
  border-right: 1px solid rgba(226, 232, 240, 0.85);
}

.mini-card > div[style*="width:56px"] .mini-icon {
  width: 52px !important;
  height: 52px !important;
}

.mini-info {
  min-width: 0;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}

.mini-info h4 {
  font-size: clamp(0.72rem, 0.68rem + 0.14vw, 0.86rem);
  font-weight: 620;
  margin: 0;
  line-height: 1.2;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-price {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  width: 100%;
}

@media (max-width: 1100px) {
  #latest-container,
  .latest-grid,
  .horizontal-scroll {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #latest-container,
  .latest-grid,
  .horizontal-scroll {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }

  .mini-card {
    padding: 12px;
    gap: 10px;
    min-height: 108px;
  }

  .mini-media {
    width: 60px !important;
    min-width: 60px !important;
    padding-right: 8px;
  }

  .mini-icon,
  .mini-icon-wrap {
    width: 44px !important;
    height: 44px !important;
  }

  .mini-card > div[style*="width:56px"] {
    width: 60px !important;
    min-width: 60px !important;
    height: 44px !important;
  }

  .mini-card > div[style*="width:56px"] .mini-icon {
    width: 44px !important;
    height: 44px !important;
  }

  .mini-info h4 {
    font-size: clamp(0.66rem, 0.62rem + 0.12vw, 0.78rem);
  }
}

@media (max-width: 520px) {
  #latest-container,
  .latest-grid,
  .horizontal-scroll {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mini-card {
    min-height: 96px;
  }
}



/* Generated Fallback Icons */
.icon-fallback {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.icon-fallback.sm {
  font-size: 1rem;
}

.banner-app-icon.fallback-wrapper {
  background: transparent;
  box-shadow: none;
}

/* Gradients for fallbacks */
.gradient-1 {
  background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
}

.gradient-2 {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.gradient-3 {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.gradient-4 {
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.gradient-5 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-6 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Search Bar */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  background: white;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

.controls .divider {
  width: 1px;
  background-color: var(--border-light);
  margin: 0 4px;
}

@media (max-width: 768px) {
  header {
    padding: 12px 0;
    position: static;
  }

  .nav-content,
  .section-header,
  .sort-wrapper {
    flex-wrap: wrap;
  }

  .nav-content {
    align-items: flex-start;
    gap: 10px;
    justify-content: flex-start;
    max-width: 100%;
  }

  .logo {
    width: calc(100% - 54px);
    min-width: 0;
  }

  .logo-copy {
    min-width: 0;
  }

  .mobile-nav-toggle {
    width: 44px;
    height: 40px;
    margin-left: auto;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  .mobile-nav-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-secondary);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
  }

  header.is-mobile-nav-open .mobile-nav-toggle {
    border-color: #cfe3ff;
    background: #eef6ff;
  }

  header.is-mobile-nav-open .mobile-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  header.is-mobile-nav-open .mobile-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  header.is-mobile-nav-open .mobile-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .logo-icon {
    width: 46px;
    height: 46px;
  }

  .logo-title {
    font-size: 1rem;
  }

  .logo-tagline {
    max-width: calc(100vw - 120px);
    letter-spacing: 0.16em;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.35;
  }

  .nav-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .main-nav {
    width: 100%;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .main-nav-link {
    width: auto;
    flex: 1 1 160px;
    min-height: 40px;
    justify-content: center;
    padding: 0 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .main-nav-menu {
    width: 100%;
    flex: 1 1 160px;
  }

  .main-nav-menu-trigger {
    width: 100%;
  }

  .main-nav-menu-list {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .nav-right,
  .sort-wrapper {
    width: 100%;
    justify-content: flex-start;
  }

  .region-switcher {
    width: 100%;
  }

  .nav-right {
    display: none;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  header.is-mobile-nav-open .main-nav,
  header.is-mobile-nav-open .nav-right {
    display: flex;
  }

  .category-select {
    width: 190px;
    max-width: 100%;
  }

  .category-select-menu {
    width: 100%;
  }

  .region-switcher-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .region-name {
    flex: 1;
    text-align: left;
  }

  .region-switcher-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .site-footer {
    margin-top: 40px;
  }

  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .footer-legal {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 18px;
  }

  .main-nav {
    gap: 8px;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .home-seo-intro {
    padding-top: 36px;
  }

  .home-seo-intro h1 {
    font-size: 1.75rem;
  }

  .category-hero {
    padding: 24px;
  }

  .category-hero h1 {
    font-size: 1.75rem;
  }

  .compact-app-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .compact-app-card .price-box,
  .compact-app-card .detected-date {
    grid-column: 2;
  }

  .category-doc-section .app-list,
  .category-doc-section .editor-pick-list {
    grid-template-columns: 1fr;
  }

  .banner-card {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
    gap: 30px;
  }

  .controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .banner-description {
    margin: 0 auto 24px;
  }

  .banner-actions {
    justify-content: center;
  }

  .banner-image {
    width: 100%;
  }

  .banner-app-icon {
    width: 140px;
    height: 140px;
  }

  .banner-title {
    font-size: 1.75rem;
  }

  .filter-btn {
    white-space: nowrap;
  }

  .seo-info-block ul,
  .seo-faq-list {
    grid-template-columns: 1fr;
  }
}
