/* Ready menu layouts of the design screen (T-216). "drawer" is the theme's own panel behind the
   menu button; the others show the categories on wide screens and keep the drawer on phones. */
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .cat-toggle-label { display: none; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .cat-menu .cat-toggle ~ .sector-nav {
    display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 4px 6px;
    padding: 6px 0; border-top: 1px solid var(--line, #eceef1); background: transparent;
  }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-group { flex: 0 0 auto; position: relative; min-width: 0; padding: 0; margin: 0; border: 0; background: transparent; text-align: center; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-primary {
    flex-direction: row; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px;
    font: 600 14px/1.2 var(--font, inherit); text-transform: none; letter-spacing: 0; background: transparent;
  }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-primary:hover { background: var(--te-color-surface-2, #f3f4f6); }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) :is(.nav-number, .nav-arrow) { display: none; }

  /* Menu bar: plain text links in one row. */
  body.sector-shell[data-theme] .site-head[data-menu="bar"] .nav-primary img { display: none; }

  /* Icon strip: the category picture in a circle above its name. */
  body.sector-shell[data-theme] .site-head[data-menu="icons"] .sector-nav .nav-primary { flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; font-size: 13px; }
  body.sector-shell[data-theme] .site-head[data-menu="icons"] .nav-primary img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent, #d4d4d8); }

  /* Sub-links (the shop's own and the sub categories) open in a panel on hover or keyboard focus,
     in the bar and icon layouts too (T-259). */
  body.sector-shell[data-theme] .site-head[data-menu="mega"] .nav-primary img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-children {
    display: none; position: absolute; top: 100%; left: 50%; z-index: 60; min-width: 240px; padding: 12px; transform: translateX(-50%);
    border: 1px solid var(--line, #e5e7eb); border-radius: 14px; background: var(--card, #fff); box-shadow: 0 18px 40px rgb(15 23 42 / 14%); text-align: left;
  }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-group:is(:hover, :focus-within) .nav-children { display: grid; gap: 2px; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-children a { min-height: 36px; padding: 8px 10px; border: 0; border-radius: 8px; font-size: 14px; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-children a:hover { background: var(--te-color-surface-2, #f3f4f6); }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-group:has(.nav-children) > .nav-primary::after { content: "▾"; font-size: 11px; opacity: .6; }
}
@media (min-width: 901px) {
  /* A category without a picture shows its first letter in the circle. */
  body.sector-shell[data-theme] .site-head[data-menu="icons"] .nav-primary:not(:has(img))::before {
    content: attr(data-initial); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent, #3f4a2b); color: var(--accent-ink, #fff); font-size: 20px; font-weight: 700;
  }
}

/* T-251: on wide screens the bar, icon and mega menus get their own full-width row at the foot of
   the header, so a large logo, the search field or icon size can never pull them over each other. */
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head.commerce-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) > .cat-menu { display: block; grid-column: 1 / -1; grid-row: 5; position: static; width: 100%; min-width: 0; }
  body.sector-shell[data-theme] .site-head.commerce-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) > .cat-menu > .sector-nav { position: static; inset: auto; transform: none; width: 100%; margin: 0; }
}

/* T-259: short badge on a menu link (Yeni, %20) and the shop's own sub-links. */
.nav-badge { display: inline-block; margin-inline-start: .35rem; padding: .05rem .4rem; border-radius: 999px; font-size: .68rem; font-weight: 700; line-height: 1.4; letter-spacing: .01em; vertical-align: middle; white-space: nowrap; background: var(--accent, #16a34a); color: var(--accent-ink, #fff); }
.nav-badge[data-tone="sale"] { background: #dc2626; color: #fff; }
.nav-badge[data-tone="new"] { background: #15803d; color: #fff; }
.nav-badge[data-tone="dark"] { background: #111827; color: #fff; }
.mobile-category-menu .menu-child { padding-inline-start: 1.6rem; font-size: .92em; opacity: .85; }

/* B-319: group drop-down. Each sub category is a column heading with its own sub categories under it; on wide
   screens it opens as one wide panel, in the phone drawer the columns stack. */
body.sector-shell .nav-group-panel .nav-column { display: grid; align-content: start; gap: 2px; }
body.sector-shell .sector-nav .nav-group-panel .nav-column-head { font-weight: 700; }
@media (min-width: 901px) {
  /* The wide panel hangs from the menu row, centred, so a link near the edge cannot push it off screen. */
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav { position: relative; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-group:has(.nav-group-panel) { position: static; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .nav-group:is(:hover, :focus-within) .nav-group-panel {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 20px; width: min(880px, 92vw); padding: 18px 20px;
  }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-group-panel .nav-column-head { padding-bottom: 6px; border-bottom: 1px solid var(--line, #e5e7eb); border-radius: 0; color: var(--ink, inherit); }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-group-panel .nav-column a:not(.nav-column-head) { min-height: 30px; padding: 5px 8px; font-size: 13px; color: var(--muted, #4b5563); }
}
@media (max-width: 900px) {
  body.sector-shell .nav-group-panel .nav-column + .nav-column { margin-top: 8px; }
  body.sector-shell .sector-nav .nav-group-panel .nav-column a:not(.nav-column-head) { padding-left: 12px; }
}

/* B-325: a neater menu bar on wide screens. Text links and buttons share one height and spacing; text links get an
   accent line that grows on hover and stays under the page being viewed; links that do not fit go under "Daha fazla". */
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .cat-menu .cat-toggle ~ .sector-nav { align-items: center; gap: 4px 6px; padding: 8px 0; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="mega"]) .sector-nav .nav-primary:not(.nav-button) { position: relative; min-height: 40px; padding: 8px 14px; color: var(--ink, inherit); background: transparent; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="mega"]) .sector-nav .nav-primary:not(.nav-button)::before {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px;
    background: var(--accent, currentColor); transform: scaleX(0); transform-origin: left center; transition: transform .18s ease;
  }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="mega"]) .sector-nav .nav-primary:not(.nav-button):is(:hover, :focus-visible, [aria-current="page"]) { background: transparent; }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="mega"]) .sector-nav .nav-primary:not(.nav-button):is(:hover, :focus-visible, [aria-current="page"])::before { transform: scaleX(1); }
  body.sector-shell[data-theme] .site-head:is([data-menu="bar"], [data-menu="icons"], [data-menu="mega"]) .sector-nav .nav-primary[aria-current="page"]:not(.nav-button) { color: var(--accent, inherit); }
  body.sector-shell[data-theme] .site-head[data-menu] .sector-nav .nav-primary.nav-button { min-height: 40px; margin-block: 0; padding: 8px 18px; }
  @media (prefers-reduced-motion: reduce) {
    body.sector-shell[data-theme] .site-head .sector-nav .nav-primary::before { transition: none; }
  }
  /* "Daha fazla": the links that would start a second row, in a drop-down at the end of the row. */
  body.sector-shell[data-theme] .site-head[data-menu] .nav-more-toggle { font: inherit; border: 0; cursor: pointer; }
  body.sector-shell[data-theme] .site-head[data-menu] .nav-more-toggle::after { content: "▾"; margin-inline-start: 6px; font-size: 11px; opacity: .6; }
  body.sector-shell[data-theme] .site-head[data-menu] .nav-more .nav-more-list { left: auto; right: 0; transform: none; }
  body.sector-shell[data-theme] .site-head[data-menu] .nav-more-list > .nav-group { display: block; }
  body.sector-shell[data-theme] .site-head[data-menu] .sector-nav .nav-more-list .nav-primary { justify-content: flex-start; width: 100%; min-height: 36px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
  body.sector-shell[data-theme] .site-head[data-menu] .sector-nav .nav-more-list .nav-primary::before,
  body.sector-shell[data-theme] .site-head[data-menu] .sector-nav .nav-more-list .nav-primary::after,
  body.sector-shell[data-theme] .site-head[data-menu] .nav-more-list .nav-children { display: none !important; }
}

/* B-329: "Kategoriler" panel. A button at the start of the menu row opens a wide panel under the header: top categories
   on the left, the hovered one's groups on the right. Phones keep the drawer, which lists the same categories. */
.cat-panel-toggle { display: inline-flex; align-items: center; gap: 8px; font: inherit; cursor: pointer; }
.cat-panel-bars { position: relative; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.cat-panel-bars::before, .cat-panel-bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.cat-panel-bars::before { top: -5px; }
.cat-panel-bars::after { top: 5px; }
@media (max-width: 900px) { body.sector-shell .cat-panel { display: none !important; } }
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel { position: static; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-toggle { font-weight: 700; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-toggle[aria-expanded="true"] { color: var(--accent, inherit); }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-body {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 70; display: grid; grid-template-columns: 250px minmax(0, 1fr);
    max-height: min(560px, 72vh); border: 1px solid var(--line, #e5e7eb); border-radius: 0 0 16px 16px;
    background: var(--card, #fff); box-shadow: 0 24px 48px rgb(15 23 42 / 16%); overflow: hidden; text-align: left;
  }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-body[hidden] { display: none; }
  /* T-330: the category list and the groups scroll inside the panel instead of being cut off at its foot. */
  body.sector-shell[data-theme] .site-head[data-cat-panel] :is(.cat-panel-tops, .cat-panel-groups) { max-height: min(560px, 72vh); box-sizing: border-box; overscroll-behavior: contain; scrollbar-width: thin; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-tops { margin: 0; padding: 10px; list-style: none; overflow-y: auto; border-right: 1px solid var(--line, #eef0f3); background: var(--te-color-surface-2, #f8fafc); }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-tops a {
    display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 10px; border: 0; border-radius: 10px;
    color: var(--ink, inherit); font-size: 14px; font-weight: 600; text-decoration: none; background: transparent;
  }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-tops a::before { content: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-tops a.is-on { background: var(--card, #fff); color: var(--accent, inherit); box-shadow: 0 1px 3px rgb(15 23 42 / 8%); }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-tops img { width: 28px; height: 28px; object-fit: contain; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-initial { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--accent, #64748b) 14%, transparent); color: var(--accent, inherit); font-size: 13px; font-weight: 800; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-name { flex: 1; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-arrow { opacity: .5; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-groups { padding: 16px 22px 22px; overflow-y: auto; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-groups[hidden] { display: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-all { display: inline-block; min-height: 0; margin: 0 0 14px; padding: 0; border: 0; color: var(--accent, inherit); font-size: 13px; font-weight: 700; text-decoration: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px 28px; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-group { display: grid; align-content: start; gap: 2px; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group a { min-height: 30px; padding: 4px 0; border: 0; border-radius: 0; color: var(--muted, #4b5563); font-size: 14px; font-weight: 500; text-decoration: none; background: transparent; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group a::before { content: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group a:hover { color: var(--accent, inherit); }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group .cat-panel-head { margin-bottom: 4px; color: var(--ink, inherit); font-weight: 700; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group .cat-panel-more { color: var(--accent, inherit); font-size: 13px; font-weight: 600; }
}

/* Two optional upper-menu layouts; both keep the mobile navigation and existing link tree. */
body.sector-shell .site-head .nav-featured {
  align-self: start; display: grid; gap: .35rem; justify-items: center; text-align: center;
  background: var(--te-color-surface-2, #f4f0eb); padding: .75rem; border-radius: .75rem;
}
body.sector-shell .site-head .nav-featured img {
  display: block; width: 100%; height: auto; max-height: 8rem; aspect-ratio: 3 / 2; object-fit: contain;
}
body.sector-shell .site-head[data-menu-variant="minimal"] .nav-primary img { display: none; }
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head[data-menu-variant="minimal"] .sector-nav .nav-primary {
    font-size: .82rem; padding-inline: .65rem; font-weight: 600;
  }
  body.sector-shell[data-theme] .site-head[data-menu-variant="featured"] .nav-group-panel { gap: .75rem; }
}
/* T-309: wide mega menu — sub category groups with their image and the category's campaign banner beside them. */
@media (min-width: 901px) {
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-groups.has-banner:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto 1fr; gap: 0 24px; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-groups.has-banner .cat-panel-all { grid-column: 1 / -1; justify-self: start; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-group a.cat-panel-head { display: flex; align-items: center; gap: 10px; color: var(--ink, inherit); font-weight: 700; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-thumb { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--te-color-surface-2, #f1f5f9); }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-banner { position: relative; display: block; align-self: start; min-height: 0; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--te-color-surface-2, #f1f5f9); text-decoration: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .sector-nav .cat-panel-banner::before { content: none; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-banner img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
  body.sector-shell[data-theme] .site-head[data-cat-panel] .cat-panel-banner span { position: absolute; inset: auto 0 0; padding: 28px 14px 12px; background: linear-gradient(transparent, rgb(0 0 0 / 70%)); color: #fff; font-size: 15px; font-weight: 800; line-height: 1.25; }
}
