/* =====================================================================
   GP StoreUp — Storefront design layer (2026-10)
   Loaded LAST in both themes (frontend + rtl-frontend). Uses logical
   properties (inline-start/end) so one file serves LTR and RTL.
   Does NOT touch navbar colours (those come from admin → css/custom.css).
   ===================================================================== */

:root {
  --su-brand: #6fae45;
  --su-brand-strong: #5a9636;
  --su-brand-soft: rgba(111, 174, 69, 0.1);
  --su-ink: #14171f;
  --su-ink-2: #3d4352;
  --su-muted: #6b7280;
  --su-line: #e7e9ee;
  --su-line-soft: #f0f2f5;
  --su-tile: #f7f8fa;
  --su-body-bg: #f4f6f8;
  --su-radius: 16px;
  --su-radius-sm: 12px;
  --su-radius-xs: 8px;
  --su-shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --su-shadow-2: 0 6px 18px rgba(16, 24, 40, 0.08);
  --su-shadow-3: 0 12px 32px rgba(16, 24, 40, 0.12);
  --su-focus: 0 0 0 3px rgba(111, 174, 69, 0.45);
  --su-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body {
  background-color: var(--su-body-bg);
  color: var(--su-ink);
}

/* ---------- Accessibility: skip link + visible keyboard focus ---------- */
.su-skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 2000;
  padding: 0.6rem 1rem;
  border-radius: var(--su-radius-xs);
  background: var(--su-ink);
  color: #fff !important;
  font-weight: 600;
  transition: top 0.15s var(--su-ease);
}
.su-skip-link:focus { top: 0.75rem; }

#main-content:focus { outline: none; }

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--su-brand-strong) !important;
  outline-offset: 2px !important;
  box-shadow: var(--su-focus) !important;
  border-radius: var(--su-radius-xs);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--su-brand) !important;
  box-shadow: var(--su-focus) !important;
}

/* ---------- Type scale (replaces oversized 2.25rem h1) ---------- */
h1, .h1 { font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.8rem); font-weight: 700; }
h2, .h2 { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); font-weight: 700; }
h3, .h3 { font-size: 1.1rem; font-weight: 700; }
h4, .h4 { font-size: 1rem; font-weight: 600; }

.section-title,
.ui-section-head .section-title,
.ui-section-head h2,
.ui-section-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--su-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.ui-section-head .section-title::before {
  content: "";
  inline-size: 4px;
  block-size: 1.1em;
  border-radius: 4px;
  background: var(--su-brand);
  flex-shrink: 0;
}

.ui-page-title,
.h1-title.ui-page-title {
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- Header ---------- */
.site-header {
  box-shadow: 0 1px 0 var(--su-line), 0 4px 16px rgba(16, 24, 40, 0.04);
}
.site-navbar {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  min-height: 64px;
}
.site-logo-link img.logo { height: 38px; width: auto; }
.site-navbar .nav-link,
.navbar-nav .nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.8rem !important;
  border-radius: 999px;
  min-height: 40px;
  transition: background-color 0.15s var(--su-ease);
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus-visible,
.site-navbar .nav-link.show {
  background-color: rgba(20, 23, 31, 0.05);
}
.site-navbar .dropdown-menu {
  border: 1px solid var(--su-line);
  border-radius: var(--su-radius-sm);
  box-shadow: var(--su-shadow-3) !important;
  padding: 0.4rem;
  min-width: 14rem;
}
.site-navbar .dropdown-item {
  border-radius: var(--su-radius-xs);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-navbar .dropdown-item .w-25px { margin: 0 !important; }

/* ---------- Search (single clean pill; overrides stacked older rules) ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--su-tile);
  border: 1px solid var(--su-line);
  border-radius: 999px;
  box-shadow: none;
  transition: border-color 0.15s var(--su-ease), box-shadow 0.15s var(--su-ease), background-color 0.15s;
}
.search-box:focus-within {
  background: #fff;
  border-color: var(--su-brand);
  box-shadow: var(--su-focus);
}
.search-box .search-form,
.search-box .search-form:focus {
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  padding: 0.5rem 0.9rem;
  min-height: 40px;
  font-size: 0.95rem;
  color: var(--su-ink);
}
.search-box .search-form::placeholder { color: #8a909c; }
.search-box .search-btn {
  border-radius: 999px !important;
  min-width: 44px;
  min-height: 40px;
  padding: 0 1rem !important;
  background-color: var(--su-brand) !important;
  transition: background-color 0.15s var(--su-ease);
}
.search-box .search-btn:hover { background-color: var(--su-brand-strong) !important; }
.search-box .search-btn svg { fill: #fff; margin: 0; }
.header-search-wrap { max-width: 380px; }
.recommended-terms a {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  margin-block: 0.15rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--su-line);
  font-size: 0.8rem;
}

/* ---------- Section cards ---------- */
.ui-section-card {
  background: #fff;
  border: 1px solid var(--su-line) !important;
  border-radius: var(--su-radius) !important;
  box-shadow: var(--su-shadow-1) !important;
  padding: 1.25rem !important;
  margin-bottom: 1.25rem !important;
}
.ui-sidebar-card { padding: 1rem 1.1rem !important; }
.ui-section-head {
  margin-bottom: 1rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--su-line-soft) !important;
}
.ui-section-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--su-brand-strong);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transition: background-color 0.15s var(--su-ease);
}
.ui-section-more:hover { background: var(--su-brand-soft); color: var(--su-brand-strong); }

/* ---------- App cards (lists) ---------- */
.ui-app-card {
  display: block;
  height: 100%;
  padding: 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--su-radius-sm);
  transition: background-color 0.15s var(--su-ease), border-color 0.15s, box-shadow 0.2s, transform 0.2s var(--su-ease);
}
.ui-app-card:hover {
  background: #fff !important;
  border-color: var(--su-line) !important;
  box-shadow: var(--su-shadow-2) !important;
  transform: translateY(-2px);
}
.ui-app-icon {
  border-radius: 22% !important;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.06), 0 2px 6px rgba(16, 24, 40, 0.08) !important;
  background: var(--su-tile);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.app-list .title,
.ui-app-card-list .title {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  color: var(--su-ink) !important;
  margin-bottom: 0.15rem !important;
  -webkit-line-clamp: 2;
}
.app-list .developer,
.top-apps .developer {
  font-size: 0.8rem;
  color: var(--su-muted) !important;
  line-height: 1.5;
}
.app-list .date,
.ui-app-card-list .date {
  font-size: 0.75rem !important;
  color: #8a909c !important;
  margin-top: 0.1rem;
}
.app-list svg { height: 12px; width: 12px; }

/* Featured: icon grid */
.ui-featured-item {
  text-align: center;
  padding: 0.6rem 0.4rem;
  border-radius: var(--su-radius-sm);
  transition: background-color 0.15s var(--su-ease), transform 0.2s var(--su-ease);
}
.ui-featured-item:hover { background: var(--su-brand-soft) !important; transform: translateY(-2px); }
.ui-featured-item .title {
  display: -webkit-box !important;
  margin-top: 0.5rem !important;
  font-size: 0.85rem !important;
  text-align: center !important;
}

/* Sidebar app rows */
.ui-sidebar-app {
  padding: 0.35rem 0.4rem;
  border-radius: var(--su-radius-xs);
}
.ui-sidebar-app:hover { background: var(--su-brand-soft) !important; }
.top-apps .app-title {
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 600;
}
.app-space { border-bottom: 1px solid var(--su-line-soft) !important; margin-bottom: 0.35rem !important; }
.ui-chip-link {
  width: 100%;
  padding: 0.35rem 0.5rem !important;
  border-radius: var(--su-radius-xs);
  font-size: 0.85rem;
  color: var(--su-ink-2);
}
.ui-chip-link:hover { background: var(--su-brand-soft); color: var(--su-ink); }

/* Topic / news cards */
.ui-topic-card {
  border-radius: var(--su-radius-sm) !important;
  overflow: hidden;
  transition: box-shadow 0.2s var(--su-ease), transform 0.2s var(--su-ease);
}
.ui-topic-card:hover { transform: translateY(-2px); box-shadow: var(--su-shadow-2) !important; }
.ui-topic-card .topic-box,
.topics .topic-box {
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Hero slider */
.ui-hero-slider { border-radius: var(--su-radius) !important; box-shadow: var(--su-shadow-2) !important; }

/* ---------- App detail ---------- */
.app-details h1 {
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem) !important;
  font-weight: 700 !important;
  line-height: 1.35;
}
.app-image {
  width: 112px;
  height: 112px;
  border-radius: 22% !important;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.06), var(--su-shadow-2) !important;
  object-fit: cover;
}
.app-details .version {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--su-brand-soft);
  color: var(--su-brand-strong) !important;
  font-size: 0.8rem;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: isolate;
}
.ui-detail-meta .row > div {
  background: var(--su-tile);
  border: 1px solid var(--su-line-soft);
  border-radius: var(--su-radius-sm);
  padding: 0.7rem 0.85rem !important;
  margin-bottom: 0 !important;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--su-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.ui-detail-meta .row {
  --bs-gutter-x: 0.6rem;
  --bs-gutter-y: 0.6rem;
  row-gap: 0.6rem;
  margin-inline: 0;
  margin-bottom: 1.25rem;
}
.ui-detail-meta .row > div { flex-basis: auto; }
@media (min-width: 768px) {
  .ui-detail-meta .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
  .ui-detail-meta .row > div { width: auto !important; max-width: none !important; }
}
@media (max-width: 767.98px) {
  .ui-detail-meta .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .ui-detail-meta .row > div { width: auto !important; max-width: none !important; }
}
.ui-detail-meta .row > div > b {
  display: block;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: var(--su-muted) !important;
  margin-bottom: 0.15rem !important;
}
.ui-detail-meta .row > div > br { display: none; }
.ui-detail-meta .row > div a { color: var(--su-brand-strong); }

/* Primary actions */
.download-btn,
.buy-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 54px;
  width: 100%;
  border: 0 !important;
  border-radius: 14px !important;
  padding: 0.85rem 1.5rem !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: 0;
  color: #fff !important;
  background: linear-gradient(180deg, #7dbb52 0%, #5f9c3a 100%) !important;
  box-shadow: 0 6px 16px rgba(95, 156, 58, 0.3) !important;
  transition: transform 0.15s var(--su-ease), box-shadow 0.2s var(--su-ease), filter 0.15s !important;
}
.buy-btn {
  background: linear-gradient(180deg, #ffd23f 0%, #f5b400 100%) !important;
  color: #2b2100 !important;
  box-shadow: 0 6px 16px rgba(245, 180, 0, 0.3) !important;
}
.buy-btn svg { fill: #2b2100 !important; }
a:hover > .download-btn,
a:hover > .buy-btn,
.download-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(95, 156, 58, 0.38) !important;
}
a:active > .download-btn,
a:active > .buy-btn { transform: translateY(0); }
a:focus-visible > .download-btn,
a:focus-visible > .buy-btn,
a:focus-visible > .download-btn-sm { box-shadow: var(--su-focus), 0 6px 16px rgba(95, 156, 58, 0.3) !important; }
.download-btn svg, .buy-btn svg { height: 18px; width: 18px; margin: 0; }
.download-btn-sm {
  border: 0 !important;
  border-radius: 999px !important;
  padding: 0.5rem 1.1rem !important;
  font-weight: 600;
  background: var(--su-brand) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s;
}
a:hover > .download-btn-sm { background: var(--su-brand-strong) !important; }

/* Share row */
.smi.ui-share-grid .col.fav,
.smi.ui-share-grid .col.favorites { width: 42px !important; height: 42px !important; }

/* Tags */
.ui-tags-list a, .tags li a {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem !important;
  background: var(--su-tile) !important;
  transition: background-color 0.15s, border-color 0.15s;
}
.ui-tags-list a:hover, .tags li a:hover { background: var(--su-brand-soft) !important; border-color: var(--su-brand) !important; }
.tags { border-top: 0 !important; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.82rem; color: #9aa0ab; align-items: center; }
.breadcrumbs a { color: var(--su-muted); }
.breadcrumbs a:last-child { color: var(--su-ink-2); font-weight: 500; }

/* Pagination */
.pagination { gap: 0.35rem; flex-wrap: wrap; }
.pagination .page-link {
  border-radius: 999px !important;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem !important;
  background: #fff;
  border: 1px solid var(--su-line) !important;
}
.page-item.active .page-link { background: var(--su-brand) !important; border-color: var(--su-brand) !important; color: #fff !important; }

/* Forms (contact / submit / comments) */
.ui-form-card .form-control,
.ui-form-card .form-select,
.comment-box .form-control {
  border-radius: var(--su-radius-sm) !important;
  border-color: var(--su-line) !important;
  background: var(--su-tile);
}

/* ---------- Redirect / download page ---------- */
.su-redirect-card { text-align: center; padding: 1.75rem 1.25rem !important; }
.su-redirect-card .app-image { width: 96px; height: 96px; margin-inline: auto; display: block; }
.su-redirect-card h1 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem) !important; margin: 0.9rem 0 0.25rem; }
.su-redirect-card .version { margin-inline-start: 0.35rem; }
.su-redirect-status { margin-top: 1rem; font-size: 1rem; color: var(--su-ink-2); font-weight: 500; }
.su-redirect-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  height: 2.2em;
  margin-inline-start: 0.35rem;
  border-radius: 999px;
  background: var(--su-brand-soft);
  color: var(--su-brand-strong);
  font-weight: 700;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.su-progress {
  max-width: 420px;
  height: 8px;
  margin: 1.1rem auto 0;
  border-radius: 999px;
  background: var(--su-line-soft);
  overflow: hidden;
}
.su-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dbb52, #5f9c3a);
}
.su-progress.is-running > span { animation: su-progress-fill var(--su-delay, 10s) linear forwards; }
@keyframes su-progress-fill { from { width: 0; } to { width: 100%; } }
.su-redirect-fallback { margin-top: 1.25rem; max-width: 420px; margin-inline: auto; }
.su-redirect-fallback[hidden] { display: none !important; }
.su-redirect-note { font-size: 0.8rem; color: var(--su-muted); margin-top: 0.75rem; }

/* ---------- Footer ---------- */
.page-footer { margin-top: 2.5rem; padding-top: 2.5rem; }
.footer-links-column .section-head { font-size: 1rem !important; }
.footer-links-column ul li { margin-bottom: 0.5rem !important; }
.footer-links-column ul li a { font-size: 0.92rem; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--su-tile);
  border: 1px solid var(--su-line);
  transition: background-color 0.15s, border-color 0.15s;
}
.footer-social a:hover { background: var(--su-brand-soft); border-color: var(--su-brand); }
.footer-social a svg { margin: 0; }
.footer-copyright { font-size: 0.85rem; }

/* Cookie bar */
.cookiealert { border-radius: var(--su-radius) var(--su-radius) 0 0; font-size: 0.9rem; }
.accept-cookies { background: var(--su-brand) !important; color: #fff !important; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .ui-section-card { padding: 1rem !important; margin-bottom: 1rem !important; border-radius: 14px !important; }
  .site-navbar { min-height: 56px; }
  .site-navbar .nav-link { border-radius: var(--su-radius-xs); }
  .offcanvas-collapse { box-shadow: var(--su-shadow-3); }
}

@media (max-width: 575.98px) {
  body { font-size: 15px; }
  /* App lists become a clean single-column list (store-style rows) */
  .app-list:not(.featured) > .col-6:not(.col-12),
  .app-list:not(.featured) > [class*="col-6"]:not(.col-12) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .app-list:not(.featured) .ui-app-card .col-4 { flex: 0 0 64px; max-width: 64px; }
  .app-list:not(.featured) .ui-app-card .col-8 { flex: 1 1 0; max-width: none; }
  .app-list:not(.featured) .ui-app-card { padding: 0.5rem 0.25rem; border-radius: var(--su-radius-xs); }
  .app-list:not(.featured) > div + div .ui-app-card { border-top: 1px solid var(--su-line-soft); border-radius: 0; }
  .app-list .title { -webkit-line-clamp: 1 !important; }
  .container { padding-inline: 0.75rem; }
  .app-image { width: 88px; height: 88px; }
  .download-btn, .buy-btn { min-height: 52px; font-size: 1rem !important; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ui-app-card:hover, .ui-featured-item:hover, .ui-topic-card:hover { transform: none; }
}

/* Share buttons: icons were white-on-light (invisible) — make them legible */
.smi.ui-share-grid .col.fav svg { fill: var(--su-ink-2) !important; height: 16px; width: 16px; margin: 0; }
.smi.ui-share-grid .col.fav:hover svg { fill: #fff !important; }
.smi.ui-share-grid .col.fav:hover { box-shadow: var(--su-shadow-2); }
bdi { unicode-bidi: isolate; }
