/* DM PATCH: header/offcanvas categories styles (moved out of header.tpl) */
html.dm-lock{overflow:hidden}
:root{
  --dm-blue:#0f5f95;
  --dm-turq:#2bbec5;
  --dm-dark:#0b1b2a;
  --dm-bg:#f6f8fb;
  --dm-r:10px;
  --dm-hair:1px solid rgba(0,0,0,.10);
}


/* === DM PATCH: etalon-like top header layout === */
.dm-top{background:#fff;border-bottom:var(--dm-hair)}
.dm-top .dm-toprow{display:flex;align-items:center;gap:16px;padding:12px 0}
.dm-brand{display:flex;align-items:center;gap:12px;min-width:220px}
.dm-brand .dm-logo{margin:0}
.dm-brand .dm-logo img{max-height:44px;width:auto;display:block}
.dm-brandmeta{display:flex;flex-direction:column;gap:2px;min-width:0}
.dm-brandname{font-size:12px;opacity:.75;letter-spacing:.2px;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-brandsub{font-size:12px;opacity:.75;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-brandsub *{margin:0;padding:0;display:inline}
.dm-search{flex:1;min-width:240px}
.dm-search form{display:flex;align-items:center;gap:10px;margin:0}
.dm-search input[type="text"], .dm-search input[type="search"]{flex:1;border:var(--dm-hair);border-radius:999px;padding:12px 14px;outline:0;min-height:44px}
.dm-search button{border:0;border-radius:999px;padding:12px 16px;min-height:44px;font-weight:1000;letter-spacing:.4px;
  background:linear-gradient(180deg,var(--dm-blue),#0c4b77);color:#fff;box-shadow:0 8px 18px rgba(15,95,149,.22);cursor:pointer}
.dm-search button:hover{filter:brightness(1.03)}
.dm-quick{display:flex;align-items:center;gap:10px}
.dm-pill{width:auto;height:auto;border-radius:0;background:transparent;border:0;display:flex;align-items:center;justify-content:center;padding:0}
.dm-pill a, .dm-pill button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:0;background:transparent;margin:0;padding:0;color:var(--dm-dark);text-decoration:none}
.dm-pill a:hover, .dm-pill button:hover{color:var(--dm-turq);text-decoration:none}
.dm-pill .material-icons, .dm-pill i{font-size:22px;line-height:1}
.dm-sr-hooks{position:absolute;left:-99999px;top:-99999px;width:1px;height:1px;overflow:hidden}
@media (max-width: 991px){
  .dm-top{border-bottom:none}
}
.dm-nav{background:#fff;border-top:var(--dm-hair);border-bottom:var(--dm-hair)}
.dm-nav .dm-navrow{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 0}
.dm-catbtn{display:inline-flex;align-items:center;gap:10px;border:0;background:linear-gradient(180deg,var(--dm-blue),#0c4b77);color:#fff;
  font-weight:1000;letter-spacing:.4px;border-radius:999px;padding:10px 14px;cursor:pointer;user-select:none;box-shadow:0 8px 18px rgba(15,95,149,.22)}
.dm-catbtn:hover{filter:brightness(1.03)}
.dm-catbtn .dm-arrow{opacity:.85}
.dm-links{flex:1;display:flex;justify-content:flex-end;min-width:0}
/* hide block titles from ps_linklist (displayNav2) */
.dm-links p.h3,
.dm-links .h3,
.dm-links .h4,
.dm-links .title,
.dm-links .block_title,
.dm-links .block-title{display:none!important}

.dm-links ul,
.dm-links .links ul{
  display:flex;
  flex-wrap:wrap;
  gap:34px;
  align-items:center;
  justify-content:flex-end;
  list-style:none;
  margin:0;
  padding:0;
}
.dm-links li{margin:0;padding:0;}
.dm-links a{color:var(--dm-dark);text-decoration:none;font-weight:900;padding:0;border:0;background:transparent;border-radius:0;display:inline-flex;align-items:center;box-shadow:none;transform:none}
.dm-links a:hover{color:var(--dm-turq);text-decoration:none}
/* Overlay + panel */
.dm-overlay{position:fixed;inset:0;background:rgba(11,27,42,.55);opacity:0;pointer-events:none;transition:.18s ease;z-index:9998}
.dm-panel{position:fixed;top:0;left:0;height:100vh;width:min(380px,92vw);background:#fff;transform:translateX(-105%);transition:.22s ease;
  z-index:9999;box-shadow:18px 0 40px rgba(0,0,0,.22);display:flex;flex-direction:column}
.dm-panelhead{display:flex;align-items:center;justify-content:space-between;padding:14px 14px;border-bottom:var(--dm-hair);background:var(--dm-bg)}
.dm-paneltitle{font-weight:1100;letter-spacing:.4px;color:var(--dm-dark)}
.dm-x{border:0;background:#fff;border:1px solid rgba(0,0,0,.10);width:36px;height:36px;border-radius:10px;cursor:pointer;font-size:22px;line-height:1}
.dm-panelbody{padding:10px 10px 14px;overflow:auto}
.dm-panelbody ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px}
.dm-panelbody a{display:flex;align-items:center;gap:10px;padding:10px 10px;border-radius:12px;border:1px solid rgba(0,0,0,.10);
  font-weight:950;text-decoration:none;color:var(--dm-dark);background:#fff}
.dm-panelbody a:hover{border-color:rgba(43,190,197,.55);box-shadow:0 10px 22px rgba(43,190,197,.12);transform:translateY(-1px)}
/* Open states */
.dm-overlay.is-open{opacity:1;pointer-events:auto}
.dm-panel.is-open{transform:translateX(0)}
@media (max-width: 992px){
  .dm-links{display:none}
}

/* hide text inside user/cart pills only */
.dm-pill-user span, .dm-pill-user small,
.dm-pill-cart span, .dm-pill-cart small{display:none}

/* === DM PATCH: fix mobile duplicate menu trigger === */
@media (max-width: 767px){
  /* hide classic burger, keep DM "КАТЕГОРИИ" button as the single trigger */
  #menu-icon{display:none !important;}
}

/* === DM PATCH: remove empty circle placeholders in desktop quick area === */
.dm-quick{gap:14px}
.dm-quick .dm-pill{margin:0}


/* === DM PATCH: mobile "МЕНЮ" button for pages (ps_linklist) === */
.dm-menubtn{display:none}
.dm-mmenu{display:none}
.dm-mmenu.is-open{display:block}

@media (max-width: 767px){
  /* hide desktop horizontal pages row; show it via a separate mobile button */
  .dm-links{display:none !important;}

  .dm-nav .dm-navrow{justify-content:flex-start;gap:10px;flex-wrap:wrap}

  .dm-menubtn{
    display:inline-flex;
    align-items:center;
    gap:10px;
    border:0;
    background:linear-gradient(180deg,var(--dm-blue),#0c4b77);
    color:#fff;
    font-weight:1000;
    letter-spacing:.4px;
    border-radius:999px;
    padding:10px 14px;
    cursor:pointer;
    user-select:none;
    box-shadow:0 8px 18px rgba(15,95,149,.22);
  }
  .dm-menubtn:hover{filter:brightness(1.03)}
  .dm-menubtn .dm-arrow{opacity:.85}
.dm-mmenu{
    display:none;
    background:#fff;
    border-top:var(--dm-hair);
    border-bottom:var(--dm-hair);
    margin-top:10px;
    border-radius:var(--dm-r);
    overflow:hidden;
  }
  .dm-mmenu.is-open{display:block}

  /* make linklist vertical and tappable */
  .dm-mmenu .dm-second-menu{
    display:flex;
    flex-direction:column;
    margin:0;
    padding:0;
    list-style:none;
  }
  .dm-mmenu .dm-second-menu li{margin:0;padding:0}
  .dm-mmenu .dm-second-menu a{
    display:block;
    padding:12px 14px;
    border-top:var(--dm-hair);
    color:var(--dm-dark);
    text-decoration:none;
    font-weight:800;
  }
  .dm-mmenu .dm-second-menu li:first-child a{border-top:0}
  .dm-mmenu .dm-second-menu a:hover{background:rgba(43,190,197,.08)}
}


/* --- Brand name + phone in header (desktop) --- */
.dm-top .dm-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dm-top .dm-brand-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.dm-top .dm-brand-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  color: #2b2b2b;
  white-space: nowrap;
}

.dm-top .dm-brand-phone {
  margin-top: 4px;
  font-size: 13px;
  color: #3b3b3b;
}

/* Hide "Call us:" text and show only phone number for ps_contactinfo nav.tpl */
.dm-top .dm-brand-phone #contact-link {
  font-size: 0;
  line-height: 0;
}
.dm-top .dm-brand-phone #contact-link span {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}

/* --- Mobile brand meta under logo --- */
.dm-header-nav .dm-mobile-meta {
  margin-top: 6px;
  text-align: center;
}

.dm-header-nav .dm-mobile-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: #2b2b2b;
}

.dm-header-nav .dm-mobile-phone {
  margin-top: 2px;
}

/* Hide "Call us:" on mobile too */
.dm-header-nav .dm-mobile-phone #contact-link {
  font-size: 0;
  line-height: 0;
}
.dm-header-nav .dm-mobile-phone #contact-link span {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

/* Keep mobile header compact */
@media (max-width: 767.98px) {
  .dm-top .dm-toprow { display: none !important; } /* desktop row hidden anyway; ensure no overlap */
}

/* === DM PATCH 8: mobile brand/phone readability fixes === */
@media (max-width: 767.98px){
  /* make the whole mobile header area stack predictably */
  .dm-header-nav .mobile{
    padding-bottom: 10px !important;
  }
  .dm-header-nav .mobile .top-logo{
    float:none !important;
    display:block !important;
    width:100% !important;
    text-align:center !important;
  }
  .dm-header-nav .mobile #_mobile_logo{
    float:none !important;
    display:inline-block !important;
    margin:0 auto !important;
  }

  /* ensure the mobile top area stacks cleanly and centers text */
  .dm-header-nav .mobile .dm-mobile-meta{
    clear: both !important;
    display: block !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    text-align: center !important;
  }
  .dm-header-nav .mobile .dm-mobile-name{
    display:block !important;
    text-align:center !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    letter-spacing: .08em !important;
    font-weight: 800 !important;
  }
  .dm-header-nav .mobile .dm-mobile-phone{
    display:block !important;
    text-align:center !important;
    margin-top: 3px !important;
  }

  /* ps_contactinfo: hide the leading label text ("Позвоните нам:") */
  .dm-header-nav .mobile .dm-mobile-phone #contact-link{
    font-size: 0 !important;
    line-height: 0 !important;
    color: inherit !important;
    text-decoration: none !important;
  }
  .dm-header-nav .mobile .dm-mobile-phone #contact-link span{
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #3b3b3b !important;
    text-decoration: none !important;
  }
}


/* DM PATCH 9: phone link neutral styling */
.dm-top .dm-brand-phone a.dm-phone,
.dm-header-nav .dm-mobile-phone a.dm-phone{color:inherit;text-decoration:none}


/* DM PATCH 10: rebuild mobile header topbar layout (logo + brand + phone + icons) */
@media (max-width: 767.98px){
  .dm-header-nav .dm-mobile-header{padding-bottom:6px !important;}
  .dm-header-nav .dm-mobile-topbar{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 0;
  }
  .dm-header-nav .dm-mobile-logo{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:flex-start;
  }
  .dm-header-nav .dm-mobile-logo img{
    max-height:34px;
    width:auto;
    display:block;
  }
  .dm-header-nav .dm-mobile-meta{
    flex:1 1 auto;
    margin:0 !important;
    text-align:center !important;
  }
  .dm-header-nav .dm-mobile-name{
    font-size:12px !important;
    line-height:1.2 !important;
  }
  .dm-header-nav .dm-mobile-phone{
    margin-top:2px !important;
  }
  .dm-header-nav .dm-mobile-icons{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .dm-header-nav .dm-mobile-icons #_mobile_user_info,
  .dm-header-nav .dm-mobile-icons #_mobile_cart{
    float:none !important;
  }
  .dm-header-nav .dm-mobile-icons a{
    display:flex;
    align-items:center;
  }
  /* prevent any overlap with the buttons row below */
  .dm-header-nav{border-bottom:var(--dm-hair);}
}

/* DM PATCH 11: mobile meta centering + ensure phone visible with ps_contactinfo override */
@media (max-width: 767.98px){
  .dm-header-nav .dm-mobile-topbar{
    justify-content: space-between;
  }
  .dm-header-nav .dm-mobile-meta{
    flex: 1 1 0% !important;
    min-width: 0 !important;
    text-align: center !important;
    padding: 0 6px !important;
  }
  .dm-header-nav .dm-mobile-name{
    text-align: center !important;
    margin: 0 !important;
  }

  /* If ps_contactinfo outputs #contact-link without nested span, ensure it's not font-size:0 */
  .dm-header-nav .dm-mobile-phone #contact-link{
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
  .dm-header-nav .dm-mobile-phone #contact-link a,
  .dm-header-nav .dm-mobile-phone #contact-link span,
  .dm-header-nav .dm-mobile-phone a.dm-phone{
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #3b3b3b !important;
    text-decoration: none !important;
    display: inline !important;
  }
}

/* DM PATCH 12: unify mobile header topbar, disable Classic injected mobile blocks */
@media (max-width: 767.98px){
  /* ensure phone block is visible even if it uses _desktop_contact_link wrapper */
  .dm-header-nav .dm-mobile-phone #_desktop_contact_link{display:block !important;}
  .dm-header-nav .dm-mobile-phone #contact-link{display:block !important;}
  .dm-header-nav .dm-mobile-phone{font-size:12px;line-height:1.2;color:#3b3b3b;}

  /* icons: remove default paddings/backgrounds/text from module outputs */
  .dm-header-nav .dm-mobile-icons{gap:10px;}
  .dm-header-nav .dm-mobile-icons .dm-mobile-icon{display:flex;align-items:center;}
  .dm-header-nav .dm-mobile-icons .user-info,
  .dm-header-nav .dm-mobile-icons .blockcart{
    background:transparent !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    box-shadow:none !important;
    float:none !important;
  }
  .dm-header-nav .dm-mobile-icons .user-info a,
  .dm-header-nav .dm-mobile-icons .blockcart a{
    padding:0 !important;
    margin:0 !important;
    background:transparent !important;
  }
  /* hide any text labels next to icons */
  .dm-header-nav .dm-mobile-icons .user-info a span,
  .dm-header-nav .dm-mobile-icons .user-info a .hidden-sm-down,
  .dm-header-nav .dm-mobile-icons .blockcart .cart-title,
  .dm-header-nav .dm-mobile-icons .blockcart .hidden-sm-down{
    display:none !important;
  }
  /* keep cart count visible but compact */
  .dm-header-nav .dm-mobile-icons .blockcart .cart-products-count{
    margin-left:4px !important;
    font-weight:700 !important;
    font-size:12px !important;
    color:#3b3b3b !important;
  }

  /* Remove the Classic "right-nav" mobile layout quirks inside our area */
  .dm-header-nav .dm-mobile-topbar{align-items:center;}
}

/* DM PATCH 13: mobile topbar fine-tune (icons same level + title closer to logo) */
@media (max-width: 767.98px){
  .dm-header-nav .dm-mobile-topbar{
    gap:8px !important;
    min-height:46px;
  }
  /* move brand block closer to logo and left-align it */
  .dm-header-nav .dm-mobile-meta{
    flex:1 1 auto !important;
    min-width:0 !important;
    padding:0 6px 0 4px !important;
    text-align:left !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
  }
  .dm-header-nav .dm-mobile-name,
  .dm-header-nav .dm-mobile-phone{
    text-align:left !important;
  }
  /* ensure right icons sit on the same baseline/level */
  .dm-header-nav .dm-mobile-icons{
    align-items:center !important;
  }
  .dm-header-nav .dm-mobile-icons .dm-mobile-icon,
  .dm-header-nav .dm-mobile-icons .dm-mobile-icon > div{
    display:flex !important;
    align-items:center !important;
  }
  .dm-header-nav .dm-mobile-icons a,
  .dm-header-nav .dm-mobile-icons button{
    display:flex !important;
    align-items:center !important;
    line-height:1 !important;
  }
  .dm-header-nav .dm-mobile-icons svg,
  .dm-header-nav .dm-mobile-icons i,
  .dm-header-nav .dm-mobile-icons .material-icons{
    line-height:1 !important;
    vertical-align:middle !important;
  }
}
