/* Aesthetic Peptides — site chrome: announcement bar, sticky header + nav,
   cart drawer, footer. Ported from the source /app.css.

   Deviations from source, all mandated by the brief / STANDARDS:
   · the Catalog nav item gains a category sub-menu (li.group > a + ul.sub-menu)
     built from get_terms('product_cat') — the source nav is flat.
   · a My Account link/icon sits beside the cart and in the mobile drawer
     (LOCKED #1; the source has no account system at all). */

/* ---------- Announcement + header ---------- */

.announce {
  background: linear-gradient(90deg, var(--accent-soft), rgba(167, 139, 250, 0.08));
  border-bottom: 1px solid var(--line);
  color: #dbe8ff;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 10px 16px;
}
/* Store-wide sale strip: solid accent so it cannot be mistaken for the promo
   bar. Built, shipped hidden — the source runs salePercent: 0. */
.announce-sale {
  background: var(--accent);
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 8, 16, 0.74);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 28px; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-tile {
  width: 40px; height: 40px; border-radius: 9px; background: #06070e;
  border: 1px solid var(--line-2);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
  box-shadow: inset 0 0 22px rgba(91, 143, 224, 0.18);
}
.brand-logo { width: 100%; height: 100%; object-fit: cover; }
.brand-word { display: flex; flex-direction: column; line-height: 1.06; font-family: var(--display); font-size: 13px; letter-spacing: 0.2em; font-weight: 700; color: var(--text); }

/* Nav. The source renders bare <a> children of .nav; we use a list so the
   Catalog item can carry a real sub-menu. Every .nav a rule below is the
   source's, unchanged. */
.nav { display: flex; align-items: center; gap: 24px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }
.nav > ul { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav > ul > li { position: relative; }
.nav a { color: #95a3bd; transition: color 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover, .nav a.active { color: #fff; }
.nav li.group > a::after {
  content: ""; width: 5px; height: 5px; margin-left: 2px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.18s;
}
.nav li.group:hover > a::after, .nav li.group.open > a::after { transform: translateY(0) rotate(225deg); }
.nav ul.sub-menu {
  position: absolute; top: 100%; left: -14px; min-width: 212px; z-index: 50;
  list-style: none; margin: 0; padding: 8px;
  background: var(--panel-solid); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}
.nav li.group:hover > ul.sub-menu,
.nav li.group:focus-within > ul.sub-menu,
.nav li.group.open > ul.sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav ul.sub-menu::before { content: ""; position: absolute; inset: -12px 0 100% 0; }
.nav ul.sub-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 12px; border-radius: var(--radius-s); color: var(--body); font-weight: 600;
}
.nav ul.sub-menu a:hover { background: var(--accent-soft); color: #fff; }
.nav ul.sub-menu .n { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--dim); }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent);
  color: var(--accent-ink) !important;
  padding: 9px 16px; border-radius: 8px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(20, 48, 120, 0.45);
}
.pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill:hover { filter: brightness(1.08); }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 12px; height: 40px; width: 230px;
}
.search:focus-within { background: rgba(255, 255, 255, 0.065); border-color: var(--line-2); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input { background: none; border: 0; outline: 0; width: 100%; font-size: 14px; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.search button[type="submit"] { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: #ccd7ee;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.badge-count {
  position: absolute; top: 1px; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.menu-btn { display: none; }
/* LOCKED #1 — the account entry point lives beside the cart. */
.account-btn { text-decoration: none; }
.nav-account { display: none; }

/* ---------- Cart drawer ---------- */

.scrim { position: fixed; inset: 0; background: rgba(3, 4, 9, 0.7); z-index: 60; backdrop-filter: blur(4px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(450px, 100%);
  background: #080b13; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
  box-shadow: -40px 0 100px rgba(0, 0, 0, 0.7);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: var(--display); font-size: 19px; letter-spacing: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 6px 22px; }
.drawer-foot { padding: 18px 22px 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.drawer.is-busy { opacity: 0.6; pointer-events: none; }

.line { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line-img { width: 62px; height: 62px; border-radius: 8px; overflow: hidden; background: #060a14; border: 1px solid var(--line); }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line h4 { margin: 0; font-size: 14px; color: var(--text); }
.line .sub { color: var(--muted); font-size: 12.5px; }
.line-ctl { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.line-total { font-weight: 700; text-align: right; color: var(--text); font-family: var(--mono); }
.remove { background: none; border: 0; color: var(--dim); font-size: 12px; padding: 0; text-decoration: underline; }
.remove:hover { color: var(--bad); }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.row.total { font-size: 17px; font-weight: 800; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); }
.note { font-size: 12.5px; color: var(--muted); }
.summary-rows { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 18px; }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.012); margin-top: 44px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 32px; padding: 58px 0 38px; }
.foot h2 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.foot ul a { color: var(--body); }
.foot ul a:hover { color: var(--accent-2); }
.foot-brand p { max-width: 300px; font-size: 14px; color: var(--muted); margin: 16px 0 18px; }
.foot-bottom { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 20px 0 30px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.coins { display: flex; gap: 6px; flex-wrap: wrap; }
.coins span { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--body); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .nav, .nav > ul { gap: 18px; }
  .search { width: 170px; }
}
@media (max-width: 1000px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #080b13; border-bottom: 1px solid var(--line); padding: 8px 20px 18px;
    max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  /* Mobile drawer derives from the same li.group > a + ul.sub-menu DOM. */
  .nav li.group > ul.sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: none; min-width: 0; margin: 0 0 6px; padding: 2px 0 2px 14px;
    background: none; border: 0; border-left: 1px solid var(--line-2);
    border-radius: 0; box-shadow: none;
  }
  .nav li.group.open > ul.sub-menu { display: block; }
  .nav ul.sub-menu::before { content: none; }
  .nav ul.sub-menu a { padding: 10px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav ul.sub-menu li:last-child a { border-bottom: 0; }
  .nav .pill { margin-top: 12px; justify-content: center; border-bottom: 0; }
  .nav-account { display: flex; }
  .top .search { display: none; }
  .search-local { display: flex; width: 100%; }
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; }
}
