/* ============================================
   PIMBA AÍ — Layout
   ============================================ */

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

/* ---- Top Bar ---- */
.top-bar {
  background: var(--color-secondary);
  color: var(--text-inverse);
  text-align: center;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  display: none;
}
.top-bar.show { display: block; }

/* ---- Header ---- */
.header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}
.header__logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
}
.header__logo-text {
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.header__logo-text .logo-pimba { color: var(--brand-orange); }
.header__logo-text .logo-ai { color: var(--brand-purple); }

/* ---- Search Bar ---- */
.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-bar__input {
  width: 100%;
  padding: var(--space-3) var(--space-10) var(--space-3) 44px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  background: var(--gray-50);
  transition: all var(--transition-base);
  color: var(--text-primary);
  outline: none;
}
.search-bar__input:focus {
  border-color: var(--color-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.search-bar__input::placeholder { color: var(--gray-400); }
.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.search-bar__clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-200);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  color: var(--gray-600);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.search-bar__clear.show { display: flex; }

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
  max-height: 300px;
  overflow-y: auto;
}
.search-suggestions.show { display: block; }
.search-suggestion {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: background var(--transition-fast);
}
.search-suggestion:hover { background: var(--gray-50); }
.search-suggestion__img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.search-suggestion__text { flex: 1; min-width: 0; }
.search-suggestion__name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggestion__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.search-suggestions__count {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--gray-100);
  text-align: center;
}

/* Header actions */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header__search-toggle {
  display: none;
  background: none;
  color: var(--gray-700);
  padding: var(--space-2);
  border-radius: var(--radius-full);
}
.header__search-toggle svg { width: 22px; height: 22px; }

.header__channel-btn {
  display: none;
  align-items: center;
  gap: var(--space-2);
  background: #25D366;
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}
.header__channel-btn.show { display: flex; }
.header__channel-btn:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  color: var(--text-inverse);
}
.header__channel-btn.telegram { background: #229ED9; }
.header__channel-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---- Category Navigation ---- */
.cat-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--gray-100);
}
.cat-nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav__inner::-webkit-scrollbar { display: none; }

.cat-nav__btn {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  letter-spacing: var(--tracking-tight);
}
.cat-nav__btn:hover { color: var(--text-primary); }
.cat-nav__btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Subcategory bar */
.subcat-bar {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) 0;
  display: none;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.subcat-bar.show { display: flex; }

.subcat-bar__btn {
  padding: 7px var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--bg-card);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-base);
}
.subcat-bar__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.subcat-bar__btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

/* ---- Hero Section ---- */
.hero {
  background: var(--gradient-hero);
  padding: var(--space-12) var(--space-5) var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.hero__tagline {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-3);
}
.hero__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--text-inverse);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}
.hero__subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-8);
  line-height: var(--leading-normal);
}
.hero__search {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.hero__search input {
  width: 100%;
  padding: var(--space-4) var(--space-5) var(--space-4) 50px;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  outline: none;
  color: var(--text-primary);
}
.hero__search input::placeholder { color: var(--gray-400); }
.hero__search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--gray-400);
  pointer-events: none;
}

/* ---- Banner ---- */
.banner {
  max-width: var(--container-max);
  margin: var(--space-5) auto;
  padding: 0 var(--space-5);
  display: none;
}
.banner.show { display: block; }
.banner__wrap {
  display: block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  text-decoration: none;
}
.banner__img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--brand-orange-rgb), 0.88) 0%, rgba(var(--brand-orange-rgb), 0.3) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-10) var(--space-12);
}
.banner__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-2);
}
.banner__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-inverse);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}
.banner__subtitle {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.85);
}

/* ---- Sections ---- */
.section {
  padding: var(--space-6) 0;
}
.section--featured {
  background: var(--color-primary-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}
.section--featured .section__title { color: var(--color-primary); }

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}
.section__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}
.section__more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.section__more:hover { text-decoration: underline; }

/* ---- Products Grid ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.products-grid--3 { grid-template-columns: repeat(3, 1fr); }
.products-grid--horizontal {
  display: flex;
  overflow-x: auto;
  gap: var(--space-4);
  padding-bottom: var(--space-2);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.products-grid--horizontal::-webkit-scrollbar { display: none; }
.products-grid--horizontal .product-card {
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ---- Categories Grid ---- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  text-align: center;
}
.category-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.category-card__icon {
  font-size: var(--text-3xl);
  line-height: 1;
}
.category-card__name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.category-card__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- Stores Grid ---- */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
.store-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}
.store-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.store-card__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
  background: var(--gray-50);
}
.store-card__name {
  font-size: var(--text-base);
  font-weight: 600;
}
.store-card__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---- Main Content ---- */
.main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-20);
}

/* ---- Filter Bar (Mobile Drawer) ---- */
.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
}
.filter-drawer.open { display: flex; }
.filter-drawer__overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
}
.filter-drawer__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-5);
  animation: slideUp 0.3s ease;
}
.filter-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.filter-drawer__title {
  font-size: var(--text-xl);
  font-weight: 700;
}
.filter-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-drawer__close svg { width: 18px; height: 18px; }

.filter-group { margin-bottom: var(--space-5); }
.filter-group__title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}
.filter-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-footer);
  color: rgba(255,255,255,0.5);
  padding: var(--space-12) var(--space-5) var(--space-8);
}
.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}
.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer__brand-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: var(--space-3);
}
.footer__brand-name .logo-pimba { color: var(--brand-orange); }
.footer__brand-name .logo-ai { color: #B794F4; }
.footer__brand-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-4);
}
.footer__col-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-inverse);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
  transition: color var(--transition-fast);
}
.footer__links a:hover { color: var(--brand-orange); }

.footer__socials {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.footer__social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: all var(--transition-base);
}
.footer__social-link:hover {
  background: var(--color-primary);
  color: var(--text-inverse);
  transform: translateY(-2px);
}
.footer__social-link svg { width: 18px; height: 18px; }

.footer__bottom {
  text-align: center;
}
.footer__disclosure {
  max-width: 640px;
  margin: 0 auto var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  opacity: 0.75;
}
.footer__credit {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.3);
}
.footer__credit a { color: rgba(255,255,255,0.4); text-decoration: underline; }
.footer__credit a:hover { color: var(--brand-orange); }

/* ---- Floating Channel Button ---- */
.channel-float {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: var(--text-inverse);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  transition: all var(--transition-slow);
  text-decoration: none;
}
.channel-float.show { display: flex; }
.channel-float:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: var(--text-inverse);
}
.channel-float.telegram { background: #229ED9; }
.channel-float svg { width: 26px; height: 26px; }

/* ---- Product Page Layout ---- */
.product-page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.product-page__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  padding: var(--space-6) 0;
}
.product-page__gallery {
  position: sticky;
  top: calc(var(--header-height) + var(--space-5));
  align-self: start;
}
.product-page__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.product-page__category {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-primary);
  font-weight: 600;
}
.product-page__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
.product-page__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.product-page__price .price-current { font-size: var(--text-3xl); }
.product-page__price .price-old { font-size: var(--text-lg); }
.product-page__desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  white-space: pre-line;
}
.product-page__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.product-page__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.product-page__price-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-2);
}
.product-page__related {
  padding: var(--space-10) 0;
}

/* ---- Institutional Pages ---- */
.page-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-10) var(--space-5);
}
.page-content h1 {
  margin-bottom: var(--space-6);
}
.page-content h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}
.page-content p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}
.page-content ul, .page-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}
.page-content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-normal);
  list-style: disc;
  color: var(--text-secondary);
}
.page-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ---- 404 Page ---- */
.page-404 {
  text-align: center;
  padding: var(--space-20) var(--space-5);
}
.page-404__icon {
  font-size: 5rem;
  margin-bottom: var(--space-4);
}
.page-404 h1 { margin-bottom: var(--space-3); }
.page-404 p {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Expired Offer ---- */
.offer-expired {
  text-align: center;
  padding: var(--space-8);
  background: var(--color-warning-light);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.offer-expired__icon { font-size: 2rem; margin-bottom: var(--space-3); }
.offer-expired h3 { margin-bottom: var(--space-2); }
.offer-expired p { color: var(--text-muted); font-size: var(--text-sm); }
