/* ========================================
   DICED MEAL FILTERS - Menu Page
   ======================================== */

#diced-filtered-menu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Search */
.diced-search-bar {
    position: relative;
    margin-bottom: 20px;
}
.diced-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    color: #111827;
    background: #FFFFFF;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.diced-search-input:focus {
    border-color: #1B4332;
    outline: none;
    box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}
.diced-search-input::placeholder {
    color: #9CA3AF;
}
.diced-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

/* Filter Section */
.diced-filter-section {
    margin-bottom: 24px;
}
.diced-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.diced-filter-group-label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    flex-shrink: 0;
}
.diced-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.diced-calorie-range {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.diced-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 18px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 42px;
}
.diced-filter-pill:hover {
    border-color: #2D6A4F;
    background: #F0FFF4;
}
.diced-filter-pill.diced-pill-active {
    background: #1B4332;
    color: #FFFFFF;
    border-color: #1B4332;
}
.diced-pill-icon {
    font-size: 14px;
}

/* Diet Toggle Boxes */
.diced-diet-toggles {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.diced-diet-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 14px;
    color: #374151;
    flex: 1;
    min-width: 240px;
}
.diced-diet-toggle:hover {
    border-color: #1B4332;
    background: #F8F9FA;
}
.diced-diet-toggle.diced-pill-active {
    border-color: #1B4332;
    background: #D8F3DC;
    color: #1B4332;
}
.diced-diet-toggle-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #D1D5DB;
    border-radius: 5px;
    font-size: 13px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.2s;
}
.diced-diet-toggle.diced-pill-active .diced-diet-toggle-check {
    background: #1B4332;
    border-color: #1B4332;
    color: #ffffff;
}
.diced-diet-toggle-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.diced-diet-toggle-text {
    font-size: 14px;
    line-height: 1.3;
}
.diced-diet-toggle-text strong {
    font-weight: 800;
    color: #1B4332;
}

/* Active Bar */
.diced-active-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 10px;
}
.diced-results-count {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}
.diced-results-count span {
    font-weight: 700;
    color: #1B4332;
}
.diced-sort-select {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #FFFFFF;
    cursor: pointer;
}
.diced-sort-select:focus {
    border-color: #1B4332;
    outline: none;
}
.diced-clear-btn {
    padding: 6px 14px;
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.diced-clear-btn:hover {
    background: #FCA5A5;
}

/* Menu Grid */
.diced-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}
.diced-menu-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6B7280;
    font-size: 16px;
}
.diced-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
}
.diced-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.diced-no-results-text {
    font-size: 16px;
    font-weight: 500;
}

/* Meal Card */
.diced-menu-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}
.diced-menu-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.diced-menu-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.diced-menu-card-body {
    padding: 14px 16px;
}
.diced-menu-card-name {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 6px;
}
.diced-menu-card-name a {
    color: inherit;
    text-decoration: none;
}
.diced-menu-card-name a:hover {
    color: #2D6A4F;
}
.diced-menu-card-desc {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.diced-menu-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.diced-menu-card-cal {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}
.diced-menu-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #1B4332;
}
.diced-menu-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.diced-menu-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #F3F4F6;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    color: #6B7280;
}
.diced-menu-tag-diet {
    background: #D8F3DC;
    color: #1B4332;
}
.diced-menu-add-btn {
    width: 100%;
    padding: 10px;
    background: #1B4332;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.diced-menu-add-btn:hover {
    background: #2D6A4F;
}
.diced-menu-add-btn.diced-added {
    background: #2E7D32;
}

/* Fade in animation */
.diced-menu-card {
    animation: dicedFadeIn 0.3s ease;
}
@keyframes dicedFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 768px) {
    .diced-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .diced-menu-card-image {
        height: 150px;
    }
    .diced-menu-card-body {
        padding: 10px 12px;
    }
    .diced-menu-card-name {
        font-size: 13px;
    }
    .diced-menu-card-desc {
        display: none;
    }
    .diced-filter-group {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
    }
    .diced-filter-group::after {
        content: '';
        position: absolute;
        right: 0;
        bottom: 0;
        width: 40px;
        height: calc(100% - 20px);
        background: linear-gradient(to right, transparent, #ffffff);
        pointer-events: none;
    }
    .diced-filter-pills,
    .diced-calorie-range {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        max-width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .diced-filter-pills::-webkit-scrollbar,
    .diced-calorie-range::-webkit-scrollbar {
        display: none;
    }
    .diced-filter-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .diced-diet-toggles {
        flex-direction: column;
    }
    .diced-diet-toggle {
        min-width: unset;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .diced-menu-grid {
        grid-template-columns: 1fr;
    }
    .diced-active-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Variation Popup */
.diced-var-popup {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Outfit', -apple-system, sans-serif;
}
.diced-var-popup-inner {
    background: #ffffff; border-radius: 16px; padding: 28px 24px;
    max-width: 380px; width: 90%; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.diced-var-popup-close {
    position: absolute; top: 12px; right: 14px; background: none; border: none;
    font-size: 22px; color: #9CA3AF; cursor: pointer; line-height: 1;
}
.diced-var-popup h3 {
    font-size: 18px; font-weight: 800; color: #1B4332; margin: 0 0 16px 0;
}
.diced-var-group {
    margin-bottom: 14px;
}
.diced-var-group label {
    display: block; font-size: 13px; font-weight: 700; color: #374151;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.diced-var-group select {
    width: 100%; padding: 10px 14px; border: 2px solid #E5E7EB; border-radius: 8px;
    font-size: 15px; font-family: 'Outfit', sans-serif; color: #374151;
    background: #fff; min-height: 44px;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.diced-var-group select:focus {
    border-color: #1B4332; outline: none;
}
.diced-var-price {
    font-size: 20px; font-weight: 800; color: #1B4332; text-align: center;
    margin: 8px 0;
}
.diced-var-add-btn {
    display: block; width: 100%; padding: 14px; background: #D4A017; color: #0d2818;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
    font-family: 'Outfit', sans-serif; transition: all 0.2s;
}
.diced-var-add-btn:hover:not(:disabled) { background: #e8b520; }
.diced-var-add-btn:disabled { background: #D1D5DB; color: #6B7280; cursor: default; }

/* Inline Variation Selectors in Cards */
.diced-card-vars {
    display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}
.diced-card-var-select {
    flex: 1; min-width: 100px; padding: 8px 28px 8px 10px; border: 2px solid #E5E7EB;
    border-radius: 8px; font-size: 13px; font-family: 'Outfit', -apple-system, sans-serif;
    color: #374151; background: #fff; min-height: 40px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.diced-card-var-select:focus { border-color: #1B4332; outline: none; }
.diced-atc:disabled { background: #9CA3AF !important; cursor: default; }
.diced-atc.diced-added { background: #2E7D32 !important; }

/* Category group headers (v4.0.0) */
.diced-menu-group-header {
    grid-column: 1 / -1;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #1B4332;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 24px 0 12px 0;
    margin: 0;
    border-bottom: 3px solid #D8F3DC;
}
.diced-menu-group-header:first-child {
    padding-top: 8px;
}
@media (max-width: 768px) {
    .diced-menu-group-header {
        font-size: 18px;
        padding: 20px 0 10px 0;
    }
}
