/* ═══════════════════════════════════════════════
   Flavor Menu — Frontend Styles
   Premium bilingual (EN/AR) restaurant menu
   Department Cards → Subpage → Item Popup flow
   ═══════════════════════════════════════════════ */

/* --- CSS Variables --- */
.fm-front {
    --fm-navy: #1a2744;
    --fm-navy-light: #243352;
    --fm-gold: #c5a55a;
    --fm-gold-light: #d4b96e;
    --fm-gold-dark: #a88c3e;
    --fm-cream: #faf7f0;
    --fm-white: #ffffff;
    --fm-text-dark: #1a1a1a;
    --fm-text-muted: #6b7280;
    --fm-border: #e5e7eb;
    --fm-bg: #f8f6f1;
    --fm-radius: 12px;
    --fm-shadow: 0 4px 20px rgba(26, 39, 68, .08);
    --fm-shadow-lg: 0 12px 40px rgba(26, 39, 68, .12);
    --fm-font-en: 'Inter', sans-serif;
    --fm-font-ar: 'Cairo', sans-serif;
    --fm-transition: .3s cubic-bezier(.4, 0, .2, 1);
}

/* --- Reset (scoped) --- */
.fm-front *,
.fm-front *::before,
.fm-front *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.fm-front {
    font-family: var(--fm-font-en);
    color: var(--fm-text-dark);
    background: var(--fm-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* RTL mode */
.fm-front[dir="rtl"] {
    font-family: var(--fm-font-ar);
}

/* ═══════════════════════════════════════════════
   Language Toggle
   ═══════════════════════════════════════════════ */
.fm-lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--fm-navy);
    color: var(--fm-gold);
    border: 2px solid var(--fm-gold);
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--fm-transition);
    font-family: var(--fm-font-ar);
    letter-spacing: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
    backdrop-filter: blur(8px);
}

.fm-lang-toggle:hover {
    background: var(--fm-gold);
    color: var(--fm-navy);
    transform: scale(1.05);
}

.fm-front[dir="rtl"] .fm-lang-toggle {
    right: auto;
    left: 20px;
    font-family: var(--fm-font-en);
}

/* ═══════════════════════════════════════════════
   Hero Section
   ═══════════════════════════════════════════════ */
.fm-hero {
    position: relative;
    height: 100vh;
    min-height: 500px;
    max-height: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Prevent any price badges from leaking into the hero */
.fm-hero .fm-item-price-badge,
.fm-hero .fm-item-card {
    display: none !important;
}

.fm-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(26, 39, 68, .65) 0%,
            rgba(26, 39, 68, .80) 60%,
            rgba(26, 39, 68, .95) 100%);
}

.fm-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    animation: fmHeroFadeIn .8s ease;
}

@keyframes fmHeroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fm-hero-logo {
    width: 160px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
    animation: fmLogoFloat 3s ease-in-out infinite;
}

@keyframes fmLogoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.fm-hero-title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    color: var(--fm-white);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.fm-front[dir="rtl"] .fm-hero-title {
    font-family: var(--fm-font-ar);
    letter-spacing: 0;
}

.fm-hero-subtitle {
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--fm-gold-light);
    font-weight: 500;
}

.fm-hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: fmBounce 2s ease infinite;
}

.fm-scroll-icon {
    font-size: 36px;
    color: var(--fm-gold);
    opacity: .7;
}

@keyframes fmBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* ═══════════════════════════════════════════════
   Department Navigation — HIDDEN (replaced by cards)
   ═══════════════════════════════════════════════ */
.fm-dept-nav {
    display: none !important;
}

/* ═══════════════════════════════════════════════
   Loading
   ═══════════════════════════════════════════════ */
.fm-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--fm-text-muted);
}

.fm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--fm-border);
    border-top-color: var(--fm-gold);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: fmSpin .8s linear infinite;
}

@keyframes fmSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════
   Menu Content
   ═══════════════════════════════════════════════ */
.fm-menu-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    min-height: 50vh;
    position: relative;
    z-index: 1;
    background: var(--fm-bg);
}

/* ═══════════════════════════════════════════════
   Department Cards Section Title
   ═══════════════════════════════════════════════ */
.fm-cards-section-title {
    text-align: center;
    margin-bottom: 40px;
    animation: fmFadeSlideUp .5s ease-out;
}

.fm-cards-section-title h2 {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    color: var(--fm-navy);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
    padding-bottom: 16px;
}

.fm-cards-section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--fm-gold);
    border-radius: 2px;
}

.fm-cards-section-title p {
    font-size: 16px;
    color: var(--fm-text-muted);
    margin-top: 8px;
}

.fm-front[dir="rtl"] .fm-cards-section-title h2 {
    font-family: var(--fm-font-ar);
}

/* ═══════════════════════════════════════════════
   Department Cards Grid
   ═══════════════════════════════════════════════ */
.fm-dept-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    animation: fmFadeSlideUp .5s ease-out;
}

.fm-dept-card {
    background: var(--fm-navy);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--fm-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(26, 39, 68, .15);
    border: 1px solid rgba(197, 165, 90, .15);
}

.fm-dept-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(26, 39, 68, .25);
    border-color: var(--fm-gold);
}

/* Department card cover image */
.fm-dept-card-img {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--fm-navy-light) 0%, var(--fm-navy) 100%);
}

.fm-dept-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.fm-dept-card:hover .fm-dept-card-img img {
    transform: scale(1.08);
}

.fm-dept-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--fm-navy) 0%, transparent 100%);
    pointer-events: none;
}

.fm-dept-card-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-dept-card-icon {
    width: 64px;
    height: 64px;
    background: rgba(197, 165, 90, .15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.fm-dept-card-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--fm-gold);
}

/* Department card info area */
.fm-dept-card-info {
    padding: 20px 24px 16px;
    text-align: center;
}

.fm-dept-card-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--fm-white);
    margin-bottom: 6px;
}

.fm-front[dir="rtl"] .fm-dept-card-name {
    font-family: var(--fm-font-ar);
}

.fm-dept-card-count {
    font-size: 14px;
    color: var(--fm-gold-light);
    font-weight: 500;
}

.fm-dept-card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(197, 165, 90, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fm-transition);
    margin: 0 auto 20px;
}

.fm-dept-card:hover .fm-dept-card-arrow {
    background: var(--fm-gold);
}

.fm-dept-card-arrow svg {
    width: 20px;
    height: 20px;
    fill: var(--fm-gold);
    transition: all var(--fm-transition);
}

.fm-front[dir="rtl"] .fm-dept-card-arrow svg {
    transform: rotate(180deg);
}

.fm-dept-card:hover .fm-dept-card-arrow svg {
    fill: var(--fm-navy);
}

/* ═══════════════════════════════════════════════
   Subpage Header
   ═══════════════════════════════════════════════ */
.fm-subpage-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--fm-border);
    animation: fmFadeSlideUp .4s ease-out;
}

.fm-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--fm-navy);
    color: var(--fm-gold);
    border: 2px solid var(--fm-gold);
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--fm-transition);
    font-family: inherit;
    white-space: nowrap;
}

.fm-back-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--fm-gold);
    transition: all var(--fm-transition);
}

.fm-front[dir="rtl"] .fm-back-btn svg {
    transform: rotate(180deg);
}

.fm-back-btn:hover {
    background: var(--fm-gold);
    color: var(--fm-navy);
}

.fm-back-btn:hover svg {
    fill: var(--fm-navy);
}

.fm-subpage-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    color: var(--fm-navy);
}

.fm-front[dir="rtl"] .fm-subpage-title {
    font-family: var(--fm-font-ar);
}

/* ═══════════════════════════════════════════════
   Category Section (inside subpage)
   ═══════════════════════════════════════════════ */
.fm-cat-section {
    margin-bottom: 48px;
    animation: fmFadeSlideUp .4s ease-out;
}

@keyframes fmFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fm-cat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--fm-border);
}

.fm-cat-icon {
    width: 40px;
    height: 40px;
    background: var(--fm-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fm-cat-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--fm-white);
}

.fm-cat-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    color: var(--fm-navy);
}

.fm-front[dir="rtl"] .fm-cat-title {
    font-family: var(--fm-font-ar);
}

.fm-cat-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--fm-text-muted);
    background: var(--fm-border);
    border-radius: 20px;
    padding: 3px 12px;
    font-weight: 600;
}

.fm-front[dir="rtl"] .fm-cat-count {
    margin-left: 0;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════
   Item Grid
   ═══════════════════════════════════════════════ */
.fm-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ═══════════════════════════════════════════════
   Item Card (Simplified: Title, Price, Calories)
   ═══════════════════════════════════════════════ */
.fm-item-card {
    background: var(--fm-white);
    border-radius: var(--fm-radius);
    overflow: hidden;
    box-shadow: var(--fm-shadow);
    transition: all var(--fm-transition);
    cursor: pointer;
    padding: 0;
    border: 1px solid transparent;
}

.fm-item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--fm-shadow-lg);
    border-color: var(--fm-gold);
}

/* Item card image */
.fm-item-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #f0ede6;
}

.fm-item-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.fm-item-card:hover .fm-item-img {
    transform: scale(1.08);
}

.fm-item-no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8e2d6 100%);
}

.fm-item-no-img svg {
    width: 48px;
    height: 48px;
    fill: #c5baa8;
}

.fm-item-card-body {
    padding: 18px 20px;
}

.fm-item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fm-navy);
    margin-bottom: 12px;
    line-height: 1.4;
    text-transform: capitalize;
}

.fm-front[dir="rtl"] .fm-item-title {
    font-family: var(--fm-font-ar);
}

.fm-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--fm-border);
}

.fm-item-calories {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--fm-text-muted);
    font-weight: 500;
}

.fm-item-calories svg {
    width: 14px;
    height: 14px;
    fill: var(--fm-gold);
}

.fm-item-price-text {
    margin-left: auto;
    font-size: 16px;
    font-weight: 800;
    color: var(--fm-gold-dark);
}

.fm-front[dir="rtl"] .fm-item-price-text {
    margin-left: 0;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════
   Item Detail Popup
   ═══════════════════════════════════════════════ */
.fm-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(26, 39, 68, .6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .3s ease;
}

.fm-popup-overlay.active {
    opacity: 1;
}

.fm-popup {
    background: var(--fm-white);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(26, 39, 68, .25);
    transform: scale(.9) translateY(20px);
    transition: transform .3s ease;
}

.fm-popup-overlay.active .fm-popup {
    transform: scale(1) translateY(0);
}

/* Popup close button */
.fm-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fm-navy);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fm-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.fm-front[dir="rtl"] .fm-popup-close {
    right: auto;
    left: 16px;
}

.fm-popup-close svg {
    width: 18px;
    height: 18px;
    fill: var(--fm-gold);
}

.fm-popup-close:hover {
    background: var(--fm-gold);
}

.fm-popup-close:hover svg {
    fill: var(--fm-navy);
}

/* Popup image */
.fm-popup-img-wrap {
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8e2d6 100%);
}

.fm-popup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-popup-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8e2d6 100%);
}

.fm-popup-no-img svg {
    width: 64px;
    height: 64px;
    fill: #c5baa8;
}

/* Popup details */
.fm-popup-details {
    padding: 28px 28px 32px;
}

.fm-popup-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--fm-navy);
    margin-bottom: 20px;
    line-height: 1.3;
}

.fm-front[dir="rtl"] .fm-popup-title {
    font-family: var(--fm-font-ar);
}

.fm-popup-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--fm-border);
}

.fm-popup-label {
    font-size: 14px;
    color: var(--fm-text-muted);
    font-weight: 600;
}

.fm-popup-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--fm-navy);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fm-popup-value svg {
    width: 16px;
    height: 16px;
    fill: var(--fm-gold);
}

.fm-popup-price {
    font-size: 20px;
    color: var(--fm-gold-dark);
}

/* Popup descriptions */
.fm-popup-desc-block {
    margin-top: 20px;
}

.fm-popup-desc-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--fm-navy);
    margin-bottom: 8px;
}

.fm-popup-desc-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--fm-text-muted);
}

.fm-popup-desc-ar {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--fm-border);
}

.fm-popup-desc-ar .fm-popup-desc-label {
    font-family: var(--fm-font-ar);
    text-align: right;
}

.fm-popup-desc-ar .fm-popup-desc-text {
    font-family: var(--fm-font-ar);
    text-align: right;
}

/* ═══════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════ */
.fm-footer {
    background: var(--fm-navy);
    color: rgba(255, 255, 255, .85);
    padding: 60px 24px 0;
}

.fm-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.fm-footer-logo {
    width: 120px;
    height: auto;
    filter: brightness(1.1);
    margin-bottom: 16px;
}

.fm-footer h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--fm-gold);
    margin-bottom: 16px;
    letter-spacing: .3px;
}

.fm-front[dir="rtl"] .fm-footer h4 {
    font-family: var(--fm-font-ar);
}

.fm-footer p,
.fm-footer li {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .7);
}

.fm-footer ul {
    list-style: none;
    padding: 0;
}

.fm-footer a {
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    transition: color var(--fm-transition);
}

.fm-footer a:hover {
    color: var(--fm-gold);
}

/* Footer contact */
.fm-footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.fm-footer-contact-item svg {
    width: 18px;
    height: 18px;
    fill: var(--fm-gold);
    flex-shrink: 0;
    margin-top: 3px;
}

/* Footer hours */
.fm-footer-hours-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

.fm-footer-hours-table td {
    padding: 4px 0;
    font-size: 13px;
    border: none !important;
    color: rgba(255, 255, 255, .7);
}

.fm-footer-hours-table,
.fm-footer-hours-table tr,
.fm-footer-hours-table th {
    border: none !important;
}

.fm-footer-hours-table td:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
    padding-right: 16px;
}

.fm-front[dir="rtl"] .fm-footer-hours-table td:first-child {
    padding-right: 0;
    padding-left: 16px;
}

/* Footer social */
.fm-social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fm-social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fm-transition);
    color: rgba(255, 255, 255, .7);
}

.fm-social-link:hover {
    background: var(--fm-gold);
    color: var(--fm-navy);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(197, 165, 90, .4);
}

.fm-social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Footer bottom */
.fm-footer-bottom {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

.fm-footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, .4);
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .fm-hero {
        height: 70vh;
        min-height: 400px;
    }

    .fm-hero-logo {
        width: 120px;
    }

    .fm-menu-content {
        padding: 24px 16px 40px;
    }

    .fm-dept-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    .fm-dept-card {
        padding: 0px 0px 28px 0px;
    }

    .fm-dept-card-icon {
        width: 52px;
        height: 52px;
    }

    .fm-dept-card-icon svg {
        width: 26px;
        height: 26px;
    }

    .fm-dept-card-name {
        font-size: 18px;
    }

    .fm-item-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .fm-subpage-header {
        gap: 12px;
    }

    .fm-back-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .fm-lang-toggle {
        top: 12px;
        right: 12px;
        padding: 8px 16px;
        font-size: 12px;
    }

    .fm-front[dir="rtl"] .fm-lang-toggle {
        right: auto;
        left: 12px;
    }

    .fm-footer-inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Popup responsive */
    .fm-popup {
        max-width: 100%;
        border-radius: 16px;
    }

    .fm-popup-img-wrap {
        height: 200px;
        border-radius: 16px 16px 0 0;
    }

    .fm-popup-details {
        padding: 20px 20px 24px;
    }

    .fm-popup-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .fm-dept-cards-grid {
        grid-template-columns: 1fr;
    }

    .fm-item-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fm-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .fm-item-price-text {
        margin-left: 0;
    }

    .fm-front[dir="rtl"] .fm-item-price-text {
        margin-right: 0;
    }

    .fm-hero {
        height: 60vh;
    }

    .fm-hero-logo {
        width: 100px;
    }

    .fm-cards-section-title {
        margin-bottom: 24px;
    }

    .fm-popup-img-wrap {
        height: 180px;
    }
}

/* ═══════════════════════════════════════════════
   Categories FAB (Floating Action Button)
   ═══════════════════════════════════════════════ */
.fm-cat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--fm-navy);
    color: var(--fm-gold);
    border: 2px solid var(--fm-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(26, 39, 68, .35);
    transition: all var(--fm-transition);
    animation: fmFabPulse 2.5s ease-in-out infinite;
}

.fm-cat-fab svg {
    width: 26px;
    height: 26px;
    fill: var(--fm-gold);
    transition: transform var(--fm-transition);
}

.fm-cat-fab:hover {
    background: var(--fm-gold);
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(197, 165, 90, .4);
}

.fm-cat-fab:hover svg {
    fill: var(--fm-navy);
}

.fm-cat-fab.active {
    background: var(--fm-gold);
    animation: none;
}

.fm-cat-fab.active svg {
    fill: var(--fm-navy);
    transform: rotate(45deg);
}

@keyframes fmFabPulse {

    0%,
    100% {
        box-shadow: 0 6px 24px rgba(26, 39, 68, .35);
    }

    50% {
        box-shadow: 0 6px 24px rgba(197, 165, 90, .45);
    }
}

/* RTL positioning */
.fm-front[dir="rtl"] .fm-cat-fab {
    right: auto;
    left: 28px;
}

/* ═══════════════════════════════════════════════
   Categories Popup Panel
   ═══════════════════════════════════════════════ */
.fm-cat-popup {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 9997;
    width: 280px;
    max-height: 60vh;
    background: var(--fm-navy);
    border-radius: 16px;
    border: 1px solid rgba(197, 165, 90, .25);
    box-shadow: 0 16px 48px rgba(26, 39, 68, .4);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.95);
    pointer-events: none;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.fm-cat-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fm-front[dir="rtl"] .fm-cat-popup {
    right: auto;
    left: 28px;
}

/* Popup header */
.fm-cat-popup-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(197, 165, 90, .15);
}

.fm-cat-popup-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--fm-gold);
    margin: 0;
    letter-spacing: .3px;
}

.fm-front[dir="rtl"] .fm-cat-popup-header h4 {
    font-family: var(--fm-font-ar);
}

/* Popup scrollable list */
.fm-cat-popup-list {
    max-height: calc(60vh - 52px);
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--fm-gold-dark) transparent;
}

.fm-cat-popup-list::-webkit-scrollbar {
    width: 4px;
}

.fm-cat-popup-list::-webkit-scrollbar-thumb {
    background: var(--fm-gold-dark);
    border-radius: 4px;
}

/* Each category row */
.fm-cat-popup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all var(--fm-transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.fm-front[dir="rtl"] .fm-cat-popup-row {
    text-align: right;
    font-family: var(--fm-font-ar);
}

.fm-cat-popup-row:hover {
    background: rgba(197, 165, 90, .1);
}

.fm-cat-popup-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(197, 165, 90, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fm-cat-popup-row-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--fm-gold);
}

.fm-cat-popup-row-info {
    flex: 1;
    min-width: 0;
}

.fm-cat-popup-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fm-white);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-cat-popup-row-count {
    font-size: 12px;
    color: rgba(255, 255, 255, .45);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   FAB + Popup Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .fm-cat-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .fm-cat-fab svg {
        width: 22px;
        height: 22px;
    }

    .fm-front[dir="rtl"] .fm-cat-fab {
        right: auto;
        left: 20px;
    }

    .fm-cat-popup {
        bottom: 82px;
        right: 20px;
        width: 260px;
    }

    .fm-front[dir="rtl"] .fm-cat-popup {
        right: auto;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .fm-cat-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .fm-front[dir="rtl"] .fm-cat-fab {
        right: auto;
        left: 16px;
    }

    .fm-cat-popup {
        bottom: 76px;
        right: 16px;
        left: 16px;
        width: auto;
    }


    .fm-front[dir="rtl"] .fm-cat-popup {
        right: 16px;
        left: 16px;
    }
}

/* ── Category Table (Department Subpage) ── */
.fm-cat-table-wrap {
    margin: 0 0 30px;
    padding: 0 16px;
}

.fm-cat-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.fm-cat-table-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.fm-cat-table-item:active {
    transform: scale(0.96);
    background: #f9f9f9;
}

.fm-cat-table-media {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fm-cat-table-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-cat-table-icon svg {
    width: 24px;
    height: 24px;
    fill: #3b82f6;
}

.fm-cat-table-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[dir="rtl"] .fm-cat-table-item {
    direction: results;
}