/* EatsOne Front Order V7.2 — category sidebar visual repair.
   Scoped to order.php; intentionally overrides historical category !important rules.
   No category IDs, URLs, event listeners, data attributes or PHP business logic changed. */

/* Give category labels enough horizontal space, without stealing the cart width. */
@media (min-width:981px) {
  body.order-front-v7 .order-hybrid-grid {
    grid-template-columns: 252px minmax(0,1fr) 250px !important;
    gap: 20px !important;
    align-items: start;
  }
  body.order-front-v7 .order-left-sidebar {
    width: 100%; min-width: 0;
    overflow-x: hidden !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-panel {
    width: 100% !important;
    padding: 21px 16px 22px !important;
    border: 1px solid #e6d5c3 !important;
    border-radius: 19px !important;
    background: #fffdf9 !important;
    box-shadow: 0 7px 22px rgba(68,47,33,.035) !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-modal-head {
    margin: 0 0 14px !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-modal-head h2 {
    margin: 0 !important;
    color: #3c3029 !important;
    font: 650 20px/1.45 "Noto Serif TC","Songti TC","PMingLiU",serif !important;
    letter-spacing: .045em !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100%; min-width: 0;
    padding: 0 !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link) {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    margin: 9px 0 0 !important;
    padding: 8px 11px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #463a32 !important;
    font: 650 14px/1.4 "Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    overflow: hidden;
    transition: background .18s ease,color .18s ease;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link):first-child {
    margin-top: 0 !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link) > .order-category-thumb {
    display: block !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 9px !important;
    object-fit: cover;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link) > span {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link).active,
  body.order-front-v7 .order-left-sidebar .order-category-list > a:not(.sub-category-link):hover {
    background: #eee1d1 !important;
    border-color: #eee1d1 !important;
    color: #5d4333 !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list .sub-category-link {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 35px !important;
    margin: 1px 2px 1px 47px !important;
    padding: 6px 8px 6px 11px !important;
    border: 0 !important;
    border-left: 2px solid #e8dacf !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #85786c !important;
    font: 450 12.5px/1.5 "Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color .18s,color .18s,background .18s;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list .sub-category-link::before,
  body.order-front-v7 .order-left-sidebar .order-category-list .sub-category-link::after {
    content: none !important; display: none !important;
  }
  body.order-front-v7 .order-left-sidebar .order-category-list .sub-category-link.active,
  body.order-front-v7 .order-left-sidebar .order-category-list .sub-category-link:hover {
    color: #634a39 !important;
    border-left-color: #ac886c !important;
    padding-left: 11px !important;
    background: #faf3ea !important;
    font-weight: 650 !important;
  }
}
@media (min-width:981px) and (max-width:1180px) {
  body.order-front-v7 .order-hybrid-grid {
    grid-template-columns: 240px minmax(0,1fr) 220px !important;
    gap: 15px !important;
  }
}
/* Preserve the original mobile drawer, but make its category rows easier to scan. */
@media (max-width:980px) {
  body.order-front-v7 .order-category-panel .order-category-list > a:not(.sub-category-link) {
    gap: 12px !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    line-height: 1.45 !important;
    font-size: 15px !important;
  }
  body.order-front-v7 .order-category-panel .order-category-list > a:not(.sub-category-link) .order-category-thumb {
    flex: 0 0 38px !important;
    width: 38px !important; height: 38px !important;
    margin: 0 !important;
    border-radius: 9px !important;
  }
  body.order-front-v7 .order-category-panel .order-category-list > a:not(.sub-category-link) > span {
    min-width: 0; flex: 1 1 auto;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }
  body.order-front-v7 .order-category-panel .order-category-list .sub-category-link {
    font-size: 14px !important;
  }
}
