/* assets/style.css â€” Collshp-like UI (CLEAN) */
* { box-sizing: border-box; }

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f9fafb;
  color: #111827;
}

/* helper */
.hidden{ display: none !important; }

/* WIDER CONTAINER (NO LAYOUT CHANGE) */
.app-container-wide{
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* =========================
   HERO
========================= */
.hero{ position: relative; height: 220px; }
.hero-img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay{ position: absolute; inset: 0; background: rgba(0,0,0,.45); }

/* hero search (single source of truth â€” no duplicate rules) */
.hero-search{
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.hero-search input{
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #111827;
}
.hero-search input::placeholder{ color: #9ca3af; }
.hero-search:focus-within{
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.18), 0 6px 18px rgba(0,0,0,.08);
}

.hero-text{
  position: absolute;
  bottom: 48px;
  left: 16px;
  right: 16px;
  color: #fff;
}
.hero-text h1{
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px 0;
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.hero-text p{
  font-size: 12px;
  opacity: .9;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* =========================
   PROFILE
========================= */
.profile{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  margin-top: -42px;
  position: relative;
}
.profile img{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  background: #fff;
}
.profile .name{ font-weight: 600; }
.profile .username{ font-size: 12px; color: #777; }

/* =========================
   CATEGORY
========================= */
.category{ padding: 16px; }
.category .grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.category-btn,
.more-grid .more-item{
  border: 1px solid #e5e7eb;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.category-btn:hover,
.more-grid .more-item:hover{
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

/* active state (category + more) */
.category-btn.active,
.more-item.active{
  background: #111827 !important;
  color: #fff !important;
  border-color: #111827 !important;
  transform: translateY(-1px);
}

/* MORE */
.more-toggle,
.more-btn{
  width: 100%;
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
  background: transparent;
  border: none;
  padding: 8px 0;
  cursor: pointer;
}

/* more container â€” two modes supported */
.more-menu{
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

/* MODE 1: list */
.more-menu .more-item{
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  transition: background .2s ease;
}
.more-menu .more-item:hover{ background: #f9fafb; }

/* MODE 2: grid */
.more-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.more-grid .more-item{
  text-align: center;
}

/* =========================
   INFO
========================= */
.info{
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

/* =========================
   PRODUCTS
========================= */
.products{ padding: 16px; padding-top: 12px; }
.products .grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* legacy card (keep for compatibility) */
.card{
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover{
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.card img{
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.card .body{ padding: 10px; }
.card .id{ font-size: 11px; color: #9ca3af; margin-bottom: 3px; }
.card .title{
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

/* NEW product card style (p-card) */
.p-card{ background:#fff; border:1px solid rgba(0,0,0,.06); border-radius:16px; overflow:hidden; }
.p-thumb{ display:block; position:relative; aspect-ratio:1/1; background:#f3f4f6; }
.p-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.p-badges{ position:absolute; left:10px; top:10px; display:flex; gap:6px; flex-wrap:wrap; z-index:2; }
.p-badge{ padding:6px 10px; border-radius:999px; font-size:12px; font-weight:800; background:rgba(0,0,0,.78); color:#fff; }
.p-body{ padding:10px 12px; min-height: calc(2.5em + 10px); }
.p-title{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  line-height: 1.25em;
  max-height: 2.5em;
  color: #111827;
  text-decoration: none;
}

/* EMPTY */
.empty{
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  text-align: center;
  background: #fff;
}
.empty p{ font-size: 12px; color: #6b7280; margin: 6px 0 0; }

/* LOAD MORE */
.load-more{
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
.load-more:hover{ background: #f9fafb; }

/* =========================
   ARTICLES
========================= */
.articles{ padding: 16px; padding-top: 4px; }
.articles-title{
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111827;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.articles-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-card{
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  background: #fff;
  cursor: pointer;
  transition: background .2s ease;
  text-decoration: none;
}
.article-card:hover{ background: #f9fafb; }

/* =========================
   FOOTER
========================= */
.footer{
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  margin-top: 16px;
}
.footer-link{
  color: #6b7280;
  text-decoration: none;
}
.footer-link:hover{ text-decoration: underline; }
.footer-sep{ margin: 0 6px; }

/* =========================
   SINGLE POST
========================= */
.post-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.post-header-left{
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-home{
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  padding: 6px 0;
}
.post-home:hover{ text-decoration: underline; }
.back-btn{
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
}
.post-type{
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: .04em;
}

.post-content{ padding: 18px 16px; background: #fff; }
.post-content h1{
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px 0;
}
.post-meta{
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 16px;
}
.post-body{
  font-size: 14px;
  line-height: 1.7;
  color: #111827;
}
.post-body p{ margin: 0 0 14px 0; }
.post-body h3{
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 8px;
}
.post-body ul{ padding-left: 18px; margin: 0 0 14px 0; }
.post-body li{ list-style: disc; margin-bottom: 6px; }

.post-body img{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: 12px;
}

/* Optional: subtle fade-in for lazy loaded images */
.post-body img[loading="lazy"]{
  opacity: 0;
  transition: opacity .3s ease;
}
.post-body img[loading="lazy"]:not([src=""]){
  opacity: 1;
}

/* =========================
   OPT-IN
========================= */
.optin{ padding: 16px; padding-top: 8px; }
.optin-box{
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 16px;
  background: #fff;
  text-align: center;
}
.optin-title{
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #111827;
}
.optin-desc{
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 14px;
}
.optin-form{
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.optin-form input{
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  outline: none;
}
.optin-form input:focus{ border-color: #f472b6; }
.optin-form button{
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #111827;
  color: #fff;
  cursor: pointer;
}
.optin-form button:hover{ opacity: .9; }

.optin-note{ font-size: 11px; color: #9ca3af; }

.optin-wa-btn{
  display: block;
  width: 100%;
  margin: 8px 0 10px;
  padding: 14px;
  border-radius: 14px;
  background: #ffffff;
  color: #2c2a2a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 1.5px solid #e5e7eb;
  transition: all .2s ease;
}
.optin-wa-btn:hover{
  border-color: #111;
  background: #f9fafb;
  opacity: .95;
}

/* ==================================
BACK TO TOP – floating, agak ke bawah 
=====================================*/
.back-to-top{
  position: fixed;
  left: 50%;
  top: 75%;                 /* ⬅️ kunci: agak ke bawah (50% = tengah) */
  transform: translateX(-50%);
  z-index: 9999;

  width: 56px;
  height: 56px;
  border-radius: 999px;

  background: rgba(17,24,39,.35); /* transparan */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border: 1px solid rgba(255,255,255,.35);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: opacity .3s ease, transform .3s ease, background .2s ease;
}

/* hidden state */
.back-to-top.hidden{
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

/* hover */
.back-to-top:hover{
  background: rgba(17,24,39,.55);
  transform: translateX(-50%) translateY(-2px);
}

/* icon size */
.back-to-top svg{
  width: 22px;
  height: 22px;
  opacity: .9;
}

/* mobile fine-tune */
@media (max-width: 480px){
  .back-to-top{
    top: 70%;               /* sedikit lebih ke bawah di HP */
    width: 52px;
    height: 52px;
  }
}
