/* Category drawer — rolaluxury bottom-sheet: lower ~80% of screen, top visible behind dim */

/* Kill scrollbars everywhere inside the drawer (webkit + firefox + legacy) */
.rl-drawer.cat-drawer *,
.drawer.cat-drawer *,
.cat-drawer-rail,
.cat-drawer-panels,
#cat-drawer-scroll,
#cat-drawer-rail {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.rl-drawer.cat-drawer *::-webkit-scrollbar,
.drawer.cat-drawer *::-webkit-scrollbar,
.cat-drawer-rail::-webkit-scrollbar,
.cat-drawer-panels::-webkit-scrollbar,
#cat-drawer-scroll::-webkit-scrollbar,
#cat-drawer-rail::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* Shell — bottom sheet, not centered modal / not fullscreen */
.rl-drawer.cat-drawer,
.drawer.cat-drawer,
#category-drawer.cat-drawer {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  inset: auto 0 0 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 82vh !important;
  max-height: 85vh !important;
  background: #fff !important;
  z-index: 401 !important;
  overflow: hidden !important;
  padding: 0 !important;
  border-radius: 16px 16px 0 0 !important;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18) !important;
  display: none;
  flex-direction: column !important;
  border: 0 !important;
  border-top: 1px solid #e8e8e8 !important;
}
.rl-drawer.cat-drawer.open,
.drawer.cat-drawer.open,
#category-drawer.cat-drawer.open {
  display: flex !important;
}
#category-drawer.cat-drawer[hidden] {
  display: none !important;
}
#category-drawer.cat-drawer.open[hidden] {
  display: flex !important;
}

@media (max-width: 640px) {
  .rl-drawer.cat-drawer,
  .drawer.cat-drawer,
  #category-drawer.cat-drawer {
    height: 80vh !important;
    max-height: 85vh !important;
    border-radius: 14px 14px 0 0 !important;
  }
}

@media (min-width: 901px) {
  .rl-drawer.cat-drawer,
  .drawer.cat-drawer,
  #category-drawer.cat-drawer {
    /* Wide bottom sheet on desktop — still anchored bottom, not a floating card */
    height: 78vh !important;
    max-height: 820px !important;
    max-width: 960px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0 !important;
  }
}

.cat-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  min-height: 44px;
}
.cat-drawer-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 1;
  text-align: center;
}
.cat-drawer-head-spacer {
  width: 32px;
  flex-shrink: 0;
}
.cat-drawer-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: -1; /* X top-left like rolaluxury */
}
.cat-drawer-close:hover {
  background: #f2f2f2;
  color: #111;
}

.cat-drawer-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cat-drawer-rail {
  width: 108px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f6f6f6;
  border-right: 1px solid #eee;
  padding: 4px 0 12px;
}

.cat-drawer-rail-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 7px;
  font-size: 11px;
  color: #333;
  cursor: pointer;
  line-height: 1.25;
}
.cat-drawer-rail-item:hover {
  background: #efefef;
}
.cat-drawer-rail-item.active {
  background: #fff;
  color: #1a9f4b;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #1a9f4b;
}

.cat-drawer-panels {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.cat-drawer-section {
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
}
.cat-drawer-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.cat-drawer-panel-head {
  font-size: 12px;
  font-weight: 600;
  margin: 2px 0 6px;
  color: #222;
}

/* Compact tiles: 4 cols desktop, 3 cols narrow */
.cat-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 4px;
}

.cat-drawer-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  color: #333;
  text-decoration: none;
  font-size: 10px;
  line-height: 1.2;
}
.cat-drawer-tile-img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: #fff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  box-sizing: border-box;
}
/* Full brand marks — never crop (override any legacy object-fit:cover) */
.cat-drawer-tile-img img,
.cat-drawer-tile img,
.cat-drawer .cat-drawer-tile-img img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
  background: #fff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
.cat-drawer-tile-name {
  font-size: 10px;
  line-height: 1.2;
  max-width: 64px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cat-drawer-empty {
  color: #888;
  font-size: 13px;
  padding: 16px;
}

@media (max-width: 640px) {
  .cat-drawer-rail {
    width: 96px;
  }
  .cat-drawer-rail-item {
    font-size: 10px;
    padding: 7px 5px;
  }
  .cat-drawer-tile-img {
    width: 48px;
    height: 48px;
    padding: 5px;
  }
  .cat-drawer-tile-name {
    max-width: 58px;
    font-size: 9px;
  }
  .cat-drawer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 3px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .cat-drawer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

body.cat-drawer-open {
  overflow: hidden;
}
