/* ===================================================================
   MudraLanka - 3-Tier Mega Menu & Catalog CSS
   Faithfully matching Kraftix Digital 3-Tier Hierarchy:
   Category (Top) -> Sub-Group (Left) -> Items (Right)
   Plus In-Place Front-End Admin Styling
   =================================================================== */

/* ===================================================================
   Unified Master Categories Dropdown Styles
   Categories like Sticker, Banner, Packaging, etc. in a single dropdown
   =================================================================== */

.master-categories-nav-item {
  position: relative !important;
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
}

.nav-cat-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  background: #fff7ed;
  color: #ea580c;
  border: 1.5px solid #fed7aa;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  font-family: inherit;
  user-select: none;
}

.nav-cat-dropdown-btn:hover {
  background: #ffedd5;
  border-color: #ea580c;
  color: #c2410c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.16);
}

.master-categories-nav-item.open .nav-cat-dropdown-btn,
.nav-cat-dropdown-btn[aria-expanded="true"] {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25);
}

.nav-cat-btn-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.nav-cat-btn-text {
  font-weight: 700;
}

.nav-cat-btn-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #ffedd5;
  color: #ea580c;
  padding: 0.05rem 0.45rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.master-categories-nav-item.open .nav-cat-btn-badge,
.nav-cat-dropdown-btn[aria-expanded="true"] .nav-cat-btn-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nav-cat-btn-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
}

.master-categories-nav-item.open .nav-cat-btn-arrow,
.nav-cat-dropdown-btn[aria-expanded="true"] .nav-cat-btn-arrow {
  transform: rotate(180deg);
}

/* Master Categories Nav Item */
.master-categories-nav-item {
  position: static !important;
}

/* Master Categories Dropdown Panel */
.master-categories-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 1.25rem;
  right: 1.25rem;
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 10px 20px -5px rgba(15, 23, 42, 0.08);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  overflow: hidden;
}

.master-categories-dropdown.visible,
.master-categories-nav-item.open .master-categories-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.master-cat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 380px;
  max-height: 520px;
  background: #ffffff;
  overflow: hidden;
}

/* Left Column: All Categories List */
.master-cat-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
  overflow-x: hidden !important;
  max-height: 520px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.master-cat-sidebar::-webkit-scrollbar {
  width: 4px;
}
.master-cat-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.master-cat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.6rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.4rem;
}

.master-cat-count-pill {
  font-size: 0.68rem;
  background: #e2e8f0;
  color: #475569;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-weight: 700;
}

.master-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.master-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  user-select: none;
  color: #334155;
}

.master-cat-row:hover {
  background: #ffffff;
  color: #ea580c;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.master-cat-row.active {
  background: #ffffff;
  border-left-color: #ea580c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: #ea580c;
  font-weight: 700;
}

.master-cat-row-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.master-cat-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
}

.master-cat-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.master-cat-row.active .master-cat-name {
  font-weight: 700;
}

.master-cat-row-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.master-cat-grps-badge {
  font-size: 0.7rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.12rem 0.4rem;
  border-radius: 9999px;
  font-weight: 600;
}

.master-cat-row.active .master-cat-grps-badge {
  background: #ffedd5;
  color: #ea580c;
}

.master-cat-chevron {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 700;
  transition: transform 0.15s;
}

.master-cat-row:hover .master-cat-chevron,
.master-cat-row.active .master-cat-chevron {
  color: #ea580c;
  transform: translateX(2px);
}

.master-cat-edit-pencil {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.1rem 0.2rem;
  border-radius: 4px;
}

.master-cat-edit-pencil:hover {
  background: #fee2e2;
}

/* Right Column: Sub-Groups Flyout */
.master-cat-content {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden !important;
  max-height: 520px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  width: 100%;
  box-sizing: border-box;
}

.master-cat-content::-webkit-scrollbar {
  width: 5px;
}
.master-cat-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.master-cat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  width: 100%;
  box-sizing: border-box;
}

.master-cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-big-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.cat-big-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.cat-sub-desc {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.35;
}

.btn-cat-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ea580c;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  background: #fff7ed;
  border-radius: 9999px;
  border: 1px solid #fed7aa;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-cat-view-all:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  transform: translateX(2px);
}

.master-cat-scrollable-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden !important;
  width: 100%;
}

.master-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.master-group-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  min-height: 120px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  box-sizing: border-box;
}

.master-group-box:hover {
  border-color: #ea580c;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.13);
  background: #fffaf5;
  transform: translateY(-3px);
}

.master-group-box-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.master-group-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffedd5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.master-group-box:hover .master-group-icon-wrap {
  background: #fed7aa;
  transform: scale(1.06);
}

.master-group-text-wrap {
  flex: 1;
  min-width: 0;
}

.master-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.master-group-box:hover .master-group-title {
  color: #ea580c;
}

.master-group-title .arr {
  font-size: 0.9rem;
  color: #94a3b8;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.master-group-box:hover .master-group-title .arr {
  color: #ea580c;
  transform: translateX(4px);
}

.master-group-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.35rem 0 0;
  line-height: 1.45;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.master-group-cta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
}

.master-group-cta-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.master-group-box:hover .master-group-cta-btn {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.master-cat-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

/* Master Categories Footer */
.master-cat-footer {
  padding: 0.65rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.master-cat-footer-info {
  font-size: 0.76rem;
  color: #475569;
}

.master-cat-footer-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-footer-catalog {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ea580c;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.btn-footer-catalog:hover {
  background: #ffedd5;
}

.btn-footer-admin {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-footer-admin:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.megamenu-items-pane::-webkit-scrollbar {
  width: 6px;
}
.megamenu-items-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.megamenu-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.megamenu-group-item:hover,
.megamenu-group-item.active {
  background: #ffffff;
  color: #2563eb;
  border-left-color: #2563eb;
  font-weight: 700;
}

.megamenu-group-item .chevron {
  font-size: 0.8rem;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.megamenu-group-item:hover .chevron,
.megamenu-group-item.active .chevron {
  color: #2563eb;
  transform: translateX(3px);
}

/* Right Pane: Multi-Column Product Items */
.megamenu-items-pane {
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.megamenu-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.megamenu-items-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.megamenu-items-header a {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.megamenu-items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem 1.75rem;
  align-content: start;
}

@media (max-width: 1200px) {
  .megamenu-items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.megamenu-item-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.25rem;
  font-size: 0.875rem;
  color: #475569;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.megamenu-item-link:hover {
  color: #2563eb;
  transform: translateX(2px);
  font-weight: 600;
}

.megamenu-item-link::before {
  content: '•';
  color: #cbd5e1;
  font-size: 1rem;
}

.megamenu-item-link:hover::before {
  color: #2563eb;
}

/* ===================================================================
   Dedicated Catalog Grid Screen (catalog.html)
   Matches screenshot 2 & 3: Breadcrumbs, Left Groups, Right Grid
   =================================================================== */
.catalog-page-wrapper {
  background: #f8fafc;
  min-height: 80vh;
  padding-bottom: 6rem;
}

/* Breadcrumb Navigation */
.breadcrumbs-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 0;
  font-size: 0.85rem;
  color: #64748b;
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumbs-list a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}.breadcrumbs-list a:hover {
  color: #ea580c;
}

.breadcrumbs-list .active-crumb {
  color: #ea580c;
  font-weight: 700;
}

/* Catalog Layout: Left Filter Groups + Right Product Cards */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .catalog-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem;
    margin-top: 1rem;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  .catalog-sidebar {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0.65rem 0.5rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }
  .catalog-sidebar-title {
    padding: 0 0.5rem 0.4rem;
    font-size: 0.72rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .catalog-sidebar-title::after {
    content: 'Swipe for groups →';
    font-size: 0.68rem;
    font-weight: 700;
    color: #ea580c;
    text-transform: none;
    letter-spacing: normal;
  }
  #sidebarGroupsList {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    overscroll-behavior-x: contain !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0.25rem 0.25rem 0.55rem !important;
    scroll-behavior: smooth !important;
    scrollbar-width: thin !important;
    scrollbar-color: #fdba74 #f1f5f9 !important;
    cursor: grab;
  }
  #sidebarGroupsList:active {
    cursor: grabbing;
  }
  #sidebarGroupsList::-webkit-scrollbar {
    height: 4px !important;
    display: block !important;
  }
  #sidebarGroupsList::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 4px !important;
  }
  #sidebarGroupsList::-webkit-scrollbar-thumb {
    background: #fdba74 !important;
    border-radius: 4px !important;
  }
  .catalog-group-link {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    border-radius: 9999px !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0 !important;
    touch-action: pan-x !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .catalog-group-link.active {
    background: #ffedd5 !important;
    color: #ea580c !important;
    border-color: #fdba74 !important;
    font-weight: 700 !important;
  }
  .catalog-group-link span:last-child {
    display: none;
  }
  .catalog-sidebar .in-menu-add-btn {
    display: none;
  }
  .catalog-main-content {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.catalog-sidebar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.catalog-sidebar-title {
  padding: 0 1.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
}

.catalog-group-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.catalog-group-link:hover,
.catalog-group-link.active {
  background: #fff7ed;
  color: #ea580c;
  border-left-color: #ea580c;
  font-weight: 700;
}

/* Catalog Product Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .catalog-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }
  .catalog-product-card {
    min-width: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  }
  .catalog-card-media {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    background: #ffffff !important;
    padding: 3px !important;
  }
  .catalog-card-media img {
    object-fit: contain !important;
    background: #ffffff !important;
  }
  .catalog-card-body {
    padding: 0.65rem 0.55rem !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
  }
  .catalog-card-title {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    margin-bottom: 0.2rem !important;
    display: -webkit-box !important;
    line-clamp: 2 !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 2.05rem !important;
    word-break: break-word !important;
  }
  .catalog-card-starting {
    font-size: 0.72rem !important;
    margin-bottom: 0.5rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .catalog-card-btn {
    margin-top: auto !important;
    padding: 0.45rem 0.35rem !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    text-align: center !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .breadcrumbs-bar {
    padding: 0.5rem 0 !important;
    font-size: 0.78rem !important;
  }
  .breadcrumbs-list {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .breadcrumbs-list::-webkit-scrollbar {
    display: none !important;
  }
}

.catalog-product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.catalog-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(234, 88, 12, 0.12);
  border-color: #fed7aa;
}

.catalog-card-media {
  aspect-ratio: 1 / 1;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  padding: 4px;
}

.catalog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  transition: transform 0.3s ease;
}

.catalog-product-card:hover .catalog-card-media img {
  transform: scale(1.04);
}

.catalog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.catalog-card-starting {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.catalog-card-starting strong {
  color: #0f172a;
}

.catalog-card-btn {
  margin-top: auto;
  width: 100%;
  padding: 0.65rem;
  background: #ffedd5;
  color: #ea580c;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: all 0.15s ease;
}

.catalog-product-card:hover .catalog-card-btn {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

/* ===================================================================
   Unified In-Place Front-End Admin Mode Styles
   =================================================================== */

/* Floating Top Admin Bar - Clean Light SaaS Theme (RK Sketch Wood) */
.frontend-admin-bar {
  display: none;
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-size: 0.85rem;
}

.frontend-admin-bar.active {
  display: block;
}

.frontend-admin-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-mode-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-admin-bar {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-admin-bar:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-admin-bar.primary {
  background: #ea580c;
  border-color: #ea580c;
  color: white;
}

.btn-admin-bar.primary:hover {
  background: #c2410c;
}

/* In-Card Admin Edit Button */
.in-card-admin-btn {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}

body.admin-mode-active .in-card-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.in-card-admin-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #2563eb;
}

/* In-Menu Admin Buttons */
.in-menu-add-btn {
  display: none;
  margin: 0.75rem 1rem;
  padding: 0.45rem;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  text-align: center;
  cursor: pointer;
}

body.admin-mode-active .in-menu-add-btn {
  display: block;
}

.in-menu-add-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

/* Slide-Over Admin Drawer */
.admin-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
}

.admin-drawer-overlay.active {
  display: block;
}

.admin-slide-drawer {
  position: fixed;
  top: 0;
  right: -600px;
  width: 100%;
  max-width: 580px;
  height: 100vh;
  background: #ffffff;
  z-index: 2001;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-slide-drawer.open {
  right: 0;
}

.admin-drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Global Modal Backdrop & Dialog System */
.checkout-modal,
.admin-modal,
.site-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999 !important;
  display: none; /* Crucial: MUST BE HIDDEN BY DEFAULT */
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.checkout-modal.active,
.admin-modal.active,
.site-modal.active {
  display: flex !important;
}

.modal-content {
  background: #ffffff !important;
  border-radius: 16px !important;
  max-width: 500px;
  width: 100%;
  padding: 2rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Category Quick-Edit Badges & Buttons */
.nav-cat-edit-badge {
  display: none;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  font-size: 0.7rem;
  padding: 1px 5px;
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s ease;
  line-height: 1;
}

body.admin-mode-active .nav-cat-edit-badge {
  display: inline-block;
}

.nav-cat-edit-badge:hover {
  background: #fdba74;
  transform: scale(1.15);
}

.btn-sidebar-edit-cat {
  display: none;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  color: #ea580c;
  cursor: pointer;
  float: right;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.15s ease;
}

body.admin-mode-active .btn-sidebar-edit-cat {
  display: inline-block;
}

.btn-sidebar-edit-cat:hover {
  background: #ffedd5;
  border-color: #ea580c;
}

/* Category Manager Modal Styles (Light SaaS Theme) */
.categories-mgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.categories-mgr-table th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0.75rem;
  color: #475569;
  font-weight: 700;
  text-align: left;
}

.categories-mgr-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.categories-mgr-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.categories-mgr-input:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

/* ===================================================================
   Vistaprint-Style Desktop Category Nav Bar & Hover Mega Flyout
   =================================================================== */

/* Universal Responsive Category Bar Under Search */
.navbar-category-bar {
  display: block !important;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  z-index: 995;
  user-select: none;
}

/* Mobile & Small Screens (< 992px): Horizontal Scroll & Auto-Scroll with Multi-Line Category Text */
@media (max-width: 991px) {
  .category-bar-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
  }

  .category-nav-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.85rem;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0.35rem 0.55rem 0.35rem;
    width: 100%;
    overflow-x: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #ea580c #fed7aa;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    cursor: grab;
  }

  .category-nav-list.grabbing {
    cursor: grabbing !important;
    user-select: none !important;
  }

  .category-nav-list::-webkit-scrollbar {
    height: 4px;
    display: block !important;
  }

  .category-nav-list::-webkit-scrollbar-track {
    background: #fed7aa;
    border-radius: 9999px;
    margin: 0 0.35rem;
  }

  .category-nav-list::-webkit-scrollbar-thumb {
    background: #ea580c;
    border-radius: 9999px;
    transition: background 0.2s ease;
  }

  .category-nav-list::-webkit-scrollbar-thumb:hover {
    background: #c2410c;
  }

  .category-nav-item {
    position: static;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .category-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
    padding: 0.35rem 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    white-space: normal !important;
    line-height: 1.22;
    max-width: 110px;
    min-width: 70px;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .cat-nav-arrow {
    font-size: 0.7rem;
    opacity: 0.55;
    display: inline-block;
    line-height: 1;
    margin-left: 1px;
    flex-shrink: 0;
  }

  .cat-nav-scroll-btn {
    display: none !important;
  }

  .category-bar-container::before,
  .category-bar-container::after {
    display: none !important;
  }

  .cat-view-all-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal !important;
    gap: 0.25rem;
    font-weight: 700;
    color: #ea580c;
    padding: 0.22rem 0.55rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 9999px;
    font-size: 0.78rem;
    line-height: 1.15;
    max-width: 75px;
  }
}

/* Desktop Screens (>= 992px): NO horizontal scrolling, show in multiple lines / wrapped rows */
@media (min-width: 992px) {
  .category-bar-container {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
  }

  /* Hide scroll buttons and overflow fades completely on desktop */
  .cat-nav-scroll-btn {
    display: none !important;
  }

  .category-bar-container::before,
  .category-bar-container::after {
    display: none !important;
  }

  .category-nav-list {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem 0.95rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0.45rem 0.5rem !important;
    width: 100% !important;
    overflow: visible !important;
    overflow-x: visible !important;
    scrollbar-width: none !important;
    cursor: default !important;
  }

  .category-nav-list::-webkit-scrollbar {
    display: none !important;
  }

  .category-nav-item {
    position: static;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .category-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    padding: 0.35rem 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    white-space: normal !important;
    line-height: 1.22;
    max-width: 135px;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
  }

  .category-nav-link:hover,
  .category-nav-item.active-hover .category-nav-link,
  .category-nav-item.active .category-nav-link {
    color: #ea580c;
    border-bottom-color: #ea580c;
  }

  .cat-nav-arrow {
    font-size: 0.72rem;
    opacity: 0.55;
    transition: transform 0.15s ease;
    display: inline-block;
    line-height: 1;
    margin-left: 1px;
    flex-shrink: 0;
  }

  .category-nav-item.active-hover .cat-nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
    color: #ea580c;
  }

  .cat-view-all-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap !important;
    gap: 0.3rem;
    font-weight: 700;
    color: #ea580c;
    padding: 0.22rem 0.65rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 9999px;
    font-size: 0.78rem;
    transition: all 0.15s ease;
  }

  .cat-view-all-pill:hover,
  .category-nav-item.active-hover .cat-view-all-pill {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
  }
}

  /* Full-Width Mega-Menu Dropdown Panel */
  .category-mega-flyout {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 3px solid #ea580c;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    z-index: 1001;
  }

  .category-mega-flyout.open {
    display: block !important;
    animation: megaFlyoutFade 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes megaFlyoutFade {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .category-mega-container {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 1.5rem 1.5rem;
    box-sizing: border-box;
  }

  /* Mega Flyout Top Minimal Bar */
  .mega-flyout-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
  }

  .mega-flyout-cat-info {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
  }

  .mega-flyout-cat-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
  }

  .mega-flyout-cat-meta {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
  }

  .mega-flyout-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .mega-flyout-browse-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ea580c;
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .mega-flyout-browse-link:hover {
    color: #c2410c;
    text-decoration: underline;
  }

  /* Mega Subcategories Grid - Authentic Vistaprint Clean Multi-Column Layout */
  .mega-groups-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.75rem 3.5rem;
    max-height: 65vh;
    overflow-y: auto;
    padding: 0.25rem 0 0.75rem 0;
  }

  .mega-group-col {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 165px;
    max-width: 230px;
    box-shadow: none;
  }

  .mega-group-col:hover {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
  }

  .mega-group-col-header {
    display: block;
    margin-bottom: 0.55rem;
    cursor: pointer;
    text-decoration: none;
  }

  .mega-group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: -0.01em;
  }

  .mega-group-title:hover {
    color: #ea580c;
  }

  .mega-new-pill {
    background: #0284c7;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
    line-height: 1.3;
  }

  .mega-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .mega-items-list li a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    color: #334155;
    text-decoration: none;
    padding: 0.15rem 0;
    transition: color 0.15s ease;
    line-height: 1.35;
  }

  .mega-items-list li a:hover {
    color: #ea580c;
    text-decoration: none;
  }

  .mega-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mega-item-explore {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #64748b;
    text-decoration: none;
    padding: 0.15rem 0;
  }

  .mega-item-explore:hover {
    color: #ea580c;
  }

  .mega-flyout-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
  }
}

/* ===================================================================
   AI Design Prompt Button & Modal Styling (For Customer Self-Design)
   =================================================================== */
.btn-design-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  color: #dc2626;
  border: 1.5px solid #f87171;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.16);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  animation: promptPulse 2.8s infinite;
  user-select: none;
}

.btn-design-prompt:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.32);
}

.prompt-sparkle {
  font-size: 0.88rem;
  line-height: 1;
  display: inline-block;
  animation: promptSpin 4s linear infinite;
}

@keyframes promptPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.32);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
}

@keyframes promptSpin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg) scale(1.15); }
}



