/* UNIVERSAL MODERN MENU STYLES
   - High-performance grid layout
   - Sticky filter sidebar with overflow protection
   - Premium glassmorphism product cards
*/

:root {
    --menu-accent: var(--brand-1, #3b82f6);
    --menu-accent-hover: var(--brand-2, #2563eb);
    --navbar-height: 84px;
    --sidebar-width: 300px;
    --card-radius: 20px;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 1. LAYOUT & GRID */
.menu-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: calc(var(--navbar-height) + 40px) 24px 60px;
}

.main-content {
    display: flex;
    gap: 32px;
    position: relative;
    /* align-items: flex-start is CRITICAL for sticky sidebar */
    align-items: flex-start;
}

.content-area {
    flex: 1;
    min-width: 0;
}

/* Responsive Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
}

/* 2. FILTER SIDEBAR (Desktop Sticky) */
.filter-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--navbar-height) + 24px);
    height: fit-content;
    max-height: calc(100vh - var(--navbar-height) - 60px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    z-index: 10;
    transition: all 0.3s ease;
    align-self: flex-start; /* Ensures it stays trapped at the top of the container */
}

/* Sidebar Scrollbar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}
.filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.filter-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

[data-theme="dark"] .filter-sidebar {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 12px;
}

.filter-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--menu-accent);
    border-radius: 2px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    color: var(--muted);
}

.filter-input, .filter-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.filter-input:focus, .filter-select:focus {
    border-color: var(--menu-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .filter-input, [data-theme="dark"] .filter-select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.clear-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* 3. PREMIUM PRODUCT CARD */
.menu-item-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--card-shadow);
    cursor: pointer;
}

.menu-item-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--menu-accent);
}

/* Card Image Area */
.card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.menu-item-card:hover .card-image-wrap img {
    transform: scale(1.08);
}

/* Image Thumbnails (Hover Switch) */
.card-thumbs {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    z-index: 5;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.menu-item-card:hover .card-thumbs {
    opacity: 1;
    transform: translateY(0);
}

.thumb-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.thumb-img:hover {
    border-color: var(--menu-accent);
    transform: scale(1.1);
}

/* Best Seller Badge */
.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--menu-accent);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Card Content */
.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.card-rating .stars {
    color: #ffb400;
    letter-spacing: 1px;
}

/* Favorites Button on Card */
.btn-favorite-top {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #64748b;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-favorite-top:hover {
    transform: scale(1.1);
    color: #ef4444;
}

.btn-favorite-top.active {
    color: #ef4444;
}

/* 4. CATEGORY TABS */
.category-buttons-wrapper {
    margin-bottom: 32px;
    overflow-x: auto;
    scrollbar-width: none;
}
.category-buttons-wrapper::-webkit-scrollbar { display: none; }

.category-buttons {
    display: flex;
    gap: 12px;
    padding: 4px;
}

.category-btn {
    padding: 10px 24px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-btn:hover {
    border-color: var(--menu-accent);
    color: var(--menu-accent);
    background: rgba(59, 130, 246, 0.05);
}

.category-btn.active {
    background: var(--menu-accent);
    color: #fff;
    border-color: var(--menu-accent);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

/* 5. SIDEBAR UPDATES (News) */
.sidebar-updates-section label {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.sidebar-updates-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-update-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    align-items: center;
}

.sidebar-update-item:hover {
    background: #fff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.update-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--menu-accent);
    flex-shrink: 0;
}

.update-content {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-all-updates {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--menu-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-updates:hover { text-decoration: underline; }

/* 6. MOBILE & TABLET ADAPTATION */
@media (max-width: 1024px) {
    .menu-container {
        padding: calc(var(--navbar-height) + 24px) 16px 40px;
    }
    .main-content {
        flex-direction: column;
        gap: 24px;
    }
    .filter-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        z-index: 2000;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .filter-sidebar.show {
        left: 0;
    }
}

@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .card-content { padding: 16px; }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

/* 7. ANIMATIONS */
@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-item-card {
    animation: fadeInSlideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* Delay for stagger effect */
.menu-item-card:nth-child(1) { animation-delay: 0.05s; }
.menu-item-card:nth-child(2) { animation-delay: 0.1s; }
.menu-item-card:nth-child(3) { animation-delay: 0.15s; }
.menu-item-card:nth-child(4) { animation-delay: 0.2s; }

/* Image Area */
.menu-item-card .item-image,
.menu-item-card .card-image {
    position: relative;
    width: 100%;
    /* Fixed aspect ratio container: use 3:4 (width:height = 3:4) to match 1080x1440 uploads */
    padding-top: 133.333%; /* 3:4 Aspect Ratio */
    height: 0 !important; /* Override strict height */
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    display: block;
    align-items: center;
    justify-content: center;
    border-radius: 24px 24px 0 0;
    z-index: 2;

    /* Enhanced inner shadow for depth */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

/* Multi-media cards (swagger) use a larger fixed image area to showcase film-strip */
.menu-item-card.multi-media .item-image,
.menu-item-card.multi-media .card-image {
    padding-top: 0 !important;
    height: 420px !important;
    min-height: 320px;
}

/* Ensure images inside multi-media cards cover the area nicely */
.menu-item-card.multi-media .gallery-track img,
.menu-item-card.multi-media .item-image img,
.menu-item-card.multi-media .card-image img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Force images inside multi-media cards to be in-flow (not absolutely positioned)
   This overrides the default absolute centering used for single-image cards. */
.menu-item-card.multi-media .item-image img,
.menu-item-card.multi-media .card-image img {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Single-image cards should center and preserve aspect without upscaling */
.menu-item-card:not(.multi-media) .item-image img,
.menu-item-card:not(.multi-media) .card-image img {
    object-fit: contain !important;
    width: auto !important;
    max-width: 100% !important;
    height: 100% !important;
}

/* Sidebar Updates Section */
.sidebar-updates-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-updates-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-top: 1rem;
}

.sidebar-updates-container::-webkit-scrollbar {
  width: 4px;
}

.sidebar-updates-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.sidebar-update-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.sidebar-update-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(66, 153, 225, 0.3);
  transform: translateX(4px);
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4299e1;
  flex-shrink: 0;
  margin-top: 0.35rem;
  box-shadow: 0 0 10px rgba(66, 153, 225, 0.5);
}

.sidebar-update-item.loading .update-dot {
  animation: pulse 1.5s infinite;
  background: #cbd5e0;
}

.update-content {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.view-all-updates {
  display: inline-block;
  font-size: 0.8rem;
  color: #4299e1;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.view-all-updates:hover {
  color: #63b3ed;
  text-decoration: underline;
  transform: translateX(3px);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

@media (max-width: 991px) {
  .sidebar-updates-section {
    margin-top: 1.5rem;
  }
}

.menu-item-card .item-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-item-card:hover .item-image a {
    transform: scale(1.08) rotate(1deg);
    filter: brightness(1.1) contrast(1.05);
}

/* Ensure images fit well */
.gallery-track img, .item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* show whole image by default */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-item-card:hover .item-image img {
    transform: scale(1.15) rotate(-1deg);
    filter: brightness(1.05) saturate(1.1);
}

[data-theme="dark"] .menu-item-card .item-image {
    background: #1f2937;
}

[data-theme="dark"] .menu-item-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .menu-item-card:hover {
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.3),
        0 8px 16px -4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .menu-item-card .item-image {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .menu-item-card .item-content {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .menu-item-card .item-name {
    color: #f1f5f9;
}

[data-theme="dark"] .menu-item-card .item-name a:hover {
    color: #60a5fa;
}

[data-theme="dark"] .rating-text {
    color: #94a3b8;
}

[data-theme="dark"] .menu-item-card .btn-favorite-top {
    background: #374151;
    color: #9ca3af;
}

[data-theme="dark"] .menu-item-card .btn-favorite-top:hover {
    background: #4b5563;
    color: #ef4444;
}

/* Gallery Support - Grid-based Image Display */
.gallery {
    width: 100%;
    height: 100%;
    position: relative;
}

.BKd5K {
    display: grid;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(60px, 1fr));
    gap: 3px;
    padding: 0 0 6px;
    list-style: none;
    list-style-type: none;
    -webkit-column-gap: 3px;
    -moz-column-gap: 3px;
    column-gap: 3px;
    row-gap: 6px;
    grid-auto-columns: 1fr;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-item-card:hover .BKd5K {
    opacity: 1;
}

.BKd5K img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.BKd5K img:hover {
    transform: scale(1.1);
    border-color: var(--brand-1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.BKd5K img.active {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    transform: scale(1.05);
}

.BKd5K img[data-active="true"] {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Gallery track for menu item cards - show only active image */
.gallery-track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: block;
}

.menu-item-card .gallery .gallery-track img,
.menu-item .gallery .gallery-track img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1; /* show all slides by default so pan/carousel reveals them */
    transition: opacity 220ms ease, transform 300ms ease;
    will-change: opacity, transform;
}

.menu-item-card .gallery .gallery-track img.active,
.menu-item .gallery .gallery-track img.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1);
}

.item-image img {
    width: auto;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.item-image img, .item-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}
img {
    max-width: 100%;
    height: auto;
}

/* Modern gallery chrome: arrows, dots and pan mode */
.gallery[data-mode="pan"] { overflow: hidden; position: relative; }
.gallery[data-mode="pan"] .gallery-track { display: flex; transition: transform 260ms cubic-bezier(.2,.8,.2,1); will-change: transform; }
.gallery[data-mode="pan"] .gallery-track img { position: relative; inset: auto; opacity: 1; flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 999px; background: rgba(0,0,0,0.45); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 30; opacity: 0; transition: opacity 180ms ease, background 180ms ease; border: none; }
.gallery-arrow:hover { background: rgba(0,0,0,0.6); }
.gallery-arrow--prev { left: 10px; }
.gallery-arrow--next { right: 10px; }
.menu-item-card:hover .gallery-arrow { opacity: 1; }
.gallery-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; display:flex; gap:6px; z-index:30; }
.gallery-dot { width:8px; height:8px; border-radius:50%; background: rgba(255,255,255,0.6); transition: transform 120ms ease, background 120ms ease; border: none; }
.gallery-dot.active { background: var(--menu-accent); transform: scale(1.15); }

/* Center single-image galleries inside the 3:4 container and do not overflow borders.
   Multi-image galleries set `data-mode="pan"` and use flex sizing; those must not be absolute. */
.gallery:not([data-mode="pan"]) .gallery-track img,
.menu-item-card .item-image img,
.menu-item-card .card-image img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Pan-mode images should remain in-flow as flex items so multiple slides are visible */
.gallery[data-mode="pan"] .gallery-track img {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Strong fallback: ensure pan-mode images are visible if JS hasn't run or errored */
.gallery[data-mode="pan"] .gallery-track img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* subtle shadow and rounded corners for the image area */
.item-image, .card-image { border-radius: 12px 12px 0 0; box-shadow: inset 0 -6px 20px rgba(2,6,23,0.03); }

/* Card Content */
.menu-item-card .item-content {
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 50%, rgba(241, 245, 249, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 24px 24px;
    position: relative;
    text-align: center;

    /* Enhanced gradient and border */
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.menu-item-card .item-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.menu-item-card .item-name a {
    color: inherit;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.menu-item-card .item-name a:hover {
    color: #2563eb;
    transform: translateY(-2px) scale(1.02);
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.rating-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.stars {
    display: flex;
    gap: 4px;
    align-items: center;
}

.star {
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 180ms ease, color 180ms ease, filter 180ms ease;
    display: inline-block;
    width: 1.2em;
    text-align: center;
    color: #e5e7eb; /* neutral base for empty stars */
}

.star.filled {
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.28));
    transform: translateY(-1px);
}

/* Improved half-star: use background-clip so a single glyph shows left-half gold */
.star.half {
    color: #e5e7eb; /* neutral base */
    position: relative;
    background: linear-gradient(90deg, #fbbf24 50%, #e5e7eb 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Empty/star-outline: show only the star outline for fully-empty slots */
.star.empty {
    color: transparent;
    -webkit-text-stroke: 1px rgba(101, 116, 139, 0.6); /* subtle outline */
    text-shadow: none;
}

/* make the star glyph crisp on high-DPI */
.star svg, .star i { vertical-align: middle; }

.rating-text {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    text-align: center;
}

.menu-item-card .card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
    background: #dbeafe;
    padding: 4px 12px;
    border-radius: 16px;
    display: inline-block;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Favorite Button */
.menu-item-card .btn-favorite-top {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
    font-size: 16px;
    color: #6b7280;
}

.menu-item-card .btn-favorite-top:hover {
    background: #f3f4f6;
    transform: scale(1.1);
    color: #ef4444;
}

.menu-item-card .item-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: color 0.3s ease;
    text-align: center;
}

.menu-item-card .item-name a {
    color: inherit;
    text-decoration: none;
}

.menu-item-card .item-name:hover {
    color: var(--brand-1);
}

/* Rating Style */
.rating-text {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #6b7280;
}

.card-stars-wrap {
    display: inline-block;
    position: relative;
    font-size: 16px;
    line-height: 1;
    margin-right: 8px;
}

.card-stars-bottom, .card-stars-top {
    white-space: nowrap;
}

.card-stars-bottom {
    color: #e5e7eb;
}

.card-stars-top {
    color: #fbbf24;
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    transition: width 260ms cubic-bezier(.2,.8,.2,1);
}

.rating-text {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* Loading State for Cards */
.menu-item-card.loading {
    position: relative;
    overflow: hidden;
}

.menu-item-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.6),
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loadingShimmer 2s infinite;
    z-index: 5;
}

@keyframes loadingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced focus states for accessibility */
.menu-item-card:focus-within {
    outline: 2px solid var(--brand-1);
    outline-offset: 4px;
    border-color: var(--brand-1);
}

/* Improved scrollbar styling for category buttons */
.category-buttons::-webkit-scrollbar {
    height: 4px;
}

.category-buttons::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.category-buttons::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.category-buttons::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Subtle entrance animations */
.menu-item-card {
    animation: cardEntrance 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}
.menu-item-card:nth-child(1) { animation-delay: 0.1s; }
.menu-item-card:nth-child(2) { animation-delay: 0.2s; }
.menu-item-card:nth-child(3) { animation-delay: 0.3s; }
.menu-item-card:nth-child(4) { animation-delay: 0.4s; }
.menu-item-card:nth-child(5) { animation-delay: 0.5s; }
.menu-item-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Actions footer */
.menu-item-card .card-actions {
    margin-top: 16px;
    padding: 20px 24px 24px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: relative;
    z-index: 2;
}

.btn-add-cart {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 18px;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--brand-2), #1d4ed8);
    transform: scale(1.08) rotate(5deg);
    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-add-cart:active {
    transform: scale(0.95);
    box-shadow:
        0 2px 8px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Favorite Fab styling */
.btn-favorite-top {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    cursor: pointer;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
}

.btn-favorite-top:hover {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.98);
    color: #dc2626;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-favorite-top {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f87171;
}

[data-theme="dark"] .btn-favorite-top:hover {
    background: rgba(30, 30, 30, 0.95);
    color: #fca5a5;
}

/* Category Buttons (Scrollable) */
.category-buttons {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 20px;
    border-radius: 25px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.category-btn.active, .category-btn:hover {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    border-color: var(--brand-1);
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

[data-theme="dark"] .category-btn {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

[data-theme="dark"] .category-btn.active, [data-theme="dark"] .category-btn:hover {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 991px) {
    .main-content {
        flex-direction: column;
        gap: 24px;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        z-index: 9999;
        border-radius: 20px 0 0 20px;
        background: var(--glass-bg);
        backdrop-filter: blur(25px);
        box-shadow: -10px 0 30px rgba(0,0,0,0.2);
        padding: 80px 24px 40px;
        overflow-y: auto;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: block; /* always block but hidden via position */
    }

    .filter-sidebar.show {
        right: 0;
    }



    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px;
        padding: 14px;
        background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
        border: none;
        border-radius: var(--radius-lg);
        color: #fff;
        font-weight: 700;
        cursor: pointer;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        transition: all 0.3s ease;
    }

    .mobile-filter-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    }

    .mobile-close-btn {
        position: absolute;
        top: 18px;
        right: 18px;
        background: rgba(0, 0, 0, 0.1);
        border: none;
        font-size: 24px;
        color: var(--menu-text-main);
        cursor: pointer;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .mobile-close-btn:hover {
        background: rgba(0, 0, 0, 0.2);
        transform: scale(1.1);
    }
}

@media (max-width: 576px) {
    /* card height auto-adjusts based on 1:1 image */
    .card-title {
        font-size: 1rem;
    }
}

/* Enforce 3-column layout for typical laptop widths (prevents accidental 2/4 column overrides) */
@media (min-width: 992px) and (max-width: 1399px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: clamp(20px, 2vw, 28px) !important;
    }

    /* ensure the content-area margin aligns with the fixed sidebar on these sizes */
    .content-area {
        margin-left: calc(var(--filter-width) + 64px) !important;
    }
}

/* Color Filter Swatches */
.color-select {
    padding-left: 35px !important;
}

.color-select option {
    padding-left: 35px;
    position: relative;
}

.color-select-wrapper {
    position: relative;
    width: 100%;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

.color-select-preview {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 10;
}

/* DESKTOP MEDIA QUERIES */
/* Commented out conflicting media query for filter-sidebar */
/*
@media (min-width: 992px) {
    .main-content {
        display: flex;
        gap: 40px;
        align-items: flex-start;
    }

    .filter-sidebar {
        position: sticky;
        top: 100px;
        width: 320px;
        flex-shrink: 0;
        height: fit-content;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 20px;
        padding: 32px;
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
    }

    .content-area {
        flex: 1;
        min-width: 0;
    }

    [data-theme="dark"] .filter-sidebar {
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
}
*/

/* Product Swiper Styles - Updated to match hero swiper */
.product-card-swiper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.product-card-swiper .swiper-wrapper {
    height: 100%;
}

.product-card-swiper .swiper-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.product-card-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    transition: opacity 0.3s ease;
}

.product-card-swiper .swiper-slide-active img {
    opacity: 1;
}

.product-card-swiper .swiper-slide:not(.swiper-slide-active) img {
    opacity: 0.8;
}

/* Swiper Navigation - Hero style */
.product-card-swiper .swiper-button-next,
.product-card-swiper .swiper-button-prev {
    width: 40px;
    height: 40px;
    margin-top: -20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-card-swiper:hover .swiper-button-next,
.product-card-swiper:hover .swiper-button-prev {
    opacity: 1;
    visibility: visible;
}

.product-card-swiper .swiper-button-next::after,
.product-card-swiper .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
    color: #374151;
}

.product-card-swiper .swiper-button-next:hover,
.product-card-swiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Swiper Pagination - Hero style */
.product-card-swiper .swiper-pagination {
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
}

.product-card-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
    transition: all 0.3s ease;
    margin: 0 4px;
    border-radius: 50%;
    cursor: pointer;
}

.product-card-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dark theme swiper styles */
[data-theme="dark"] .product-card-swiper .swiper-button-next,
[data-theme="dark"] .product-card-swiper .swiper-button-prev {
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .product-card-swiper .swiper-button-next::after,
[data-theme="dark"] .product-card-swiper .swiper-button-prev::after {
    color: #f9fafb;
}

[data-theme="dark"] .product-card-swiper .swiper-button-next:hover,
[data-theme="dark"] .product-card-swiper .swiper-button-prev:hover {
    background: rgba(30, 30, 30, 1);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .product-card-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .product-card-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 8. DARK MODE REFINEMENTS */
[data-theme="dark"] body {
    background-color: #0f172a;
}

[data-theme="dark"] .menu-item-card {
    background: #1e293b;
}

[data-theme="dark"] .card-content {
    background: #1e293b;
}

[data-theme="dark"] .card-title {
    color: #f1f5f9;
}

[data-theme="dark"] .card-image-wrap {
    background: #0f172a;
}

[data-theme="dark"] .btn-favorite-top,
[data-theme="dark"] .card-badge {
    background: rgba(30, 41, 59, 0.9);
    color: #f1f5f9;
}

[data-theme="dark"] .category-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="dark"] .sidebar-update-item {
    background: rgba(30, 41, 59, 0.5);
}

[data-theme="dark"] .sidebar-update-item:hover {
    background: #1e293b;
}

/* 9. MOBILE CLOSE BUTTON */
.mobile-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    z-index: 2010;
}

@media (max-width: 1024px) {
    .mobile-close-btn {
        display: flex;
    }
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 24px;
}

.breadcrumb-item a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.breadcrumb-item.active {
    color: var(--menu-accent);
    font-weight: 600;
}

/* END OF MENU STYLES */
