/* DAVR desktop shell refinement, 2026-11-09.
 * Keep original header actions mounted for stateful React/PWA handlers.
 * These are only visually hidden when the fully usable sidebar is visible.
 */
@media (min-width: 1024px) {
  html.davr-desktop-browser-layout #root header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    min-height: 80px;
    padding-inline: clamp(18px, 2vw, 34px) !important;
  }
  html.davr-desktop-browser-layout #root header > .brand {
    flex: 0 0 auto;
    margin-right: auto !important;
  }
  html.davr-desktop-browser-layout #root header .header-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    margin-left: auto !important;
  }
  /* Keep elements in the DOM: sidebar delegates to their existing click handlers. */
  html.davr-desktop-browser-layout #root header > :is(
    .davr-category-toggle,
    .davr-desktop-search-toggle,
    .davr-desktop-filter-toggle
  ),
  html.davr-desktop-browser-layout #root header .header-actions > :is(
    .desktop-icon,
    .davr-header-shops,
    #davr-notification-button
  ) {
    display: none !important;
  }
  html.davr-desktop-browser-layout #root header .header-actions > button.primary {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 20px;
    border-radius: 14px;
    white-space: nowrap;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker {
    flex: 0 1 auto;
    min-width: 0;
  }
  html.davr-desktop-browser-layout #root header .country {
    display: none !important;
  }
  html.davr-desktop-browser-layout #root main {
    width: auto !important;
    max-width: none !important;
    margin: 0 24px 0 256px !important;
    padding-top: 30px !important;
  }
  html.davr-desktop-browser-layout .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  html.davr-desktop-browser-layout .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  /* Even sidebar rows with consistent icon / label / unread-count columns. */
  html.davr-desktop-browser-layout .davr-desktop-sidebar {
    position: fixed;
    z-index: 29;
    top: calc(var(--davr-desktop-header-height, 80px) + 16px);
    bottom: 18px;
    left: 18px;
    display: flex;
    flex-direction: column;
    width: 216px;
    padding: 16px 12px;
    border: 1px solid #e1ede8;
    border-radius: 24px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 18px 46px rgba(19, 59, 46, .075);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav {
    display: grid;
    gap: 7px;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button {
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    width: 100%;
    min-height: 49px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: #48645c;
    font: inherit;
    font-size: 13.5px;
    font-weight: 730;
    text-align: left;
    cursor: pointer;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button > svg {
    width: 22px;
    height: 22px;
    justify-self: center;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav .davr-desktop-nav-label {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-count:not([hidden]) {
    display: grid;
    place-items: center;
    min-width: 20px;
    min-height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d84949;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button:hover {
    background: #eff9f4;
    color: #096f5b;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button[aria-current="page"] {
    border-color: #c6e8db;
    background: linear-gradient(110deg, #e6f7ef, #f0fbf8);
    color: #05745f;
    box-shadow: inset 3px 0 #0a9476;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button[aria-expanded="true"]:not([aria-current="page"]) {
    border-color: #c6e8db;
    background: #eff9f4;
    color: #05745f;
  }
  html.davr-desktop-browser-layout .davr-desktop-sidebar-nav button:focus-visible {
    outline: 3px solid #9bd8c6;
    outline-offset: 2px;
  }
  /* Notification dropdown follows the left rail, not the invisible bell. */
  html.davr-desktop-browser-layout .davr-notification-panel {
    left: 248px !important;
    right: auto !important;
    top: calc(var(--davr-desktop-header-height, 80px) + 18px) !important;
    max-height: calc(100dvh - var(--davr-desktop-header-height, 80px) - 30px);
    overflow-y: auto;
  }
  html.davr-desktop-browser-layout #root footer,
  html.davr-desktop-browser-layout .shell > footer {
    max-width: none;
    width: auto;
    margin: 0 24px 0 256px;
  }
  /* Card location directly under product photograph, above the price. */
  html.davr-desktop-browser-layout .listing-grid > .card .card-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
  }
  html.davr-desktop-browser-layout .listing-grid > .card .card-copy > .location {
    order: -1;
    margin: 10px 5px 5px !important;
    color: #648278;
    font-size: 12px;
    line-height: 1.4;
  }
}
@media (min-width: 1280px) {
  html.davr-desktop-browser-layout .listing-grid,
  html.davr-desktop-browser-layout .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}
@media (min-width: 1640px) {
  html.davr-desktop-browser-layout .listing-grid,
  html.davr-desktop-browser-layout .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 2050px) {
  html.davr-desktop-browser-layout .listing-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) and (max-width: 1140px) {
  html.davr-desktop-browser-layout #root header .header-actions > button.primary {
    padding-inline: 12px;
    font-size: 13px;
  }
  html.davr-desktop-browser-layout .davr-notification-panel {
    width: min(360px, calc(100vw - 270px));
  }
}
@media (max-width: 1023px) {
  /* Under tablet width, preserve the familiar top navigation and avoid a
     sidebar that would leave no room for product cards. */
  html.davr-desktop-browser-layout .davr-desktop-sidebar {
    display: none !important;
  }
}
/* Address inside React listing detail: mirror only, never move React children. */
.detail-modal.davr-has-photo-address .detail-info .detail-address {
  display: none !important;
}
.detail-modal .davr-photo-address {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 51px;
  padding: 13px 15px;
  border: 1px solid #dceae3;
  border-radius: 17px;
  background: #eef6f2;
  color: #4c655b;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color .16s ease, border-color .16s ease;
}
.detail-modal .davr-photo-address:hover {
  border-color: #aed4c2;
  background: #e3f3eb;
}
.detail-modal .davr-photo-address:focus-visible {
  outline: 3px solid #78c7ac;
  outline-offset: 2px;
}
.detail-modal .davr-photo-address-icon {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  color: #0b866a;
}
.detail-modal .davr-photo-address-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  /* Keep mobile browser layout and category navigation; only move the
     detail's address beneath its gallery. */
  .detail-modal .davr-photo-address {
    padding: 12px;
    border-radius: 14px;
    font-size: 12.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .detail-modal .davr-photo-address {
    transition: none !important;
  }
}
