/* ==========================================================================
   Cafeex Menu - Front-end styles (v1.1.0 design refresh)
   Presentation only. Markup and tab behaviour are unchanged.

   Layout by screen width:
     > 1024px  : 3-column list cards (image left, name right)
     769-1024  : 2-column list cards
     <= 768px  : 2-column photo cards (image top, name below)
   Tabs wrap onto extra rows when they don't fit; they never overflow.
   ========================================================================== */

.cafeex-menu-wrapper {
    --cfx-ink: #4b2a54;          /* headings */
    --cfx-ink-soft: #723b7a;     /* item titles */
    --cfx-accent: #b02a87;       /* active tab, accents */
    --cfx-blush: #fdf2f8;        /* inactive tab, soft fills */
    --cfx-line: #eedae5;         /* borders */
    --cfx-muted: #8a7a8f;        /* descriptions */
    --cfx-card: #ffffff;
    --cfx-gap: 24px;
    --cfx-radius: 16px;

    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
    font-family: inherit;
}

.cafeex-menu-wrapper *,
.cafeex-menu-wrapper *::before,
.cafeex-menu-wrapper *::after {
    box-sizing: border-box;
}

/* ---------- Header ---------- */

.cafeex-menu-header {
    text-align: center;
    margin-bottom: 28px;
}

.cafeex-menu-wrapper .cafeex-menu-subtitle {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cfx-accent);
}

.cafeex-menu-wrapper .cafeex-menu-title {
    margin: 0;
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.8rem);
    line-height: 1.15;
    font-weight: 500;
    color: var(--cfx-ink);
}

/* ---------- Category tabs ---------- */

.cafeex-menu-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 44px;
}

.cafeex-menu-tabs {
    display: inline-flex;
    flex-wrap: wrap;               /* extra categories wrap, never overflow */
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px;
    border: 1px solid var(--cfx-line);
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(75, 42, 84, 0.06);
}

.cafeex-menu-wrapper .cafeex-menu-tab {
    flex: 0 0 auto;
    margin: 0;
    padding: 11px 26px;
    border: 0;
    border-radius: 999px;
    background: var(--cfx-blush);
    color: var(--cfx-ink);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.cafeex-menu-wrapper .cafeex-menu-tab:hover {
    background: #f6dcec;
    color: var(--cfx-ink);
}

.cafeex-menu-wrapper .cafeex-menu-tab.active,
.cafeex-menu-wrapper .cafeex-menu-tab.active:hover {
    background: var(--cfx-accent);
    color: #fff;
    box-shadow: 0 6px 14px rgba(176, 42, 135, 0.28);
}

.cafeex-menu-wrapper .cafeex-menu-tab:focus {
    outline: none;
}

.cafeex-menu-wrapper .cafeex-menu-tab:focus-visible {
    outline: 2px solid var(--cfx-accent);
    outline-offset: 2px;
}

/* ---------- Item grid (desktop / laptop: list cards) ---------- */

.cafeex-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--cfx-gap);
}

.cafeex-menu-wrapper .cafeex-menu-item-card {
    /* display is set inline (flex / none) by the tab script */
    position: relative;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--cfx-line);
    border-radius: var(--cfx-radius);
    background: linear-gradient(100deg, #ffffff 55%, #fff7fb 100%);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(75, 42, 84, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: cafeex-fade-in 0.4s ease both;
}

/* Accent strip on the left edge, grows on hover */
.cafeex-menu-wrapper .cafeex-menu-item-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--cfx-accent);
    opacity: 0;
    transition: opacity 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.cafeex-menu-wrapper .cafeex-menu-item-card:hover {
    transform: translateY(-3px);
    border-color: #e3bfd6;
    box-shadow: 0 14px 30px rgba(75, 42, 84, 0.10);
}

.cafeex-menu-wrapper .cafeex-menu-item-card:hover::before {
    opacity: 1;
    top: 12%;
    bottom: 12%;
}

/* Image: rounded square thumbnail, photo always fills it */
.cafeex-menu-wrapper .cafeex-menu-item-img {
    position: relative;
    flex: 0 0 auto;
    width: 104px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--cfx-blush);
}

.cafeex-menu-wrapper .cafeex-menu-item-img img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    margin: 0;
    object-fit: cover;
    display: block;
    border-radius: 0;
    transition: transform 0.6s ease;
}

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

/* Placeholder when an item has no featured image (no icon font needed) */
.cafeex-menu-wrapper .cafeex-no-img {
    background:
        radial-gradient(circle at 50% 50%, rgba(176, 42, 135, 0.14) 0 22%, transparent 23%),
        linear-gradient(135deg, #fdf2f8 0%, #f3e4f0 100%);
}

.cafeex-menu-wrapper .cafeex-no-img::after {
    content: none;
}

/* Text */
.cafeex-menu-item-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 12px 0 0;
    text-align: left;
}

.cafeex-menu-item-header {
    display: block;
    margin: 0;
}

.cafeex-menu-wrapper .cafeex-menu-item-title {
    position: relative;
    margin: 0;
    padding-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cfx-ink-soft);
    word-break: break-word;
    transition: color 0.3s ease;
}

/* Short accent underline under the item name, widens on hover */
.cafeex-menu-wrapper .cafeex-menu-item-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cfx-accent), #e58bc4);
    transition: width 0.35s ease;
}

.cafeex-menu-wrapper .cafeex-menu-item-card:hover .cafeex-menu-item-title {
    color: var(--cfx-accent);
}

.cafeex-menu-wrapper .cafeex-menu-item-card:hover .cafeex-menu-item-title::after {
    width: 56px;
}

.cafeex-menu-wrapper .cafeex-menu-item-desc {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--cfx-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes cafeex-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Small laptop / tablet landscape ---------- */
@media (max-width: 1024px) {
    .cafeex-menu-wrapper {
        --cfx-gap: 20px;
    }

    .cafeex-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cafeex-menu-wrapper .cafeex-menu-item-card {
        gap: 16px;
        padding: 10px;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-img {
        width: 104px;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-title {
        font-size: 1.15rem;
        padding-bottom: 10px;
    }
}

/* ---------- Tablet portrait and phones: photo cards ---------- */
@media (max-width: 768px) {
    .cafeex-menu-wrapper {
        --cfx-gap: 16px;
        --cfx-radius: 14px;
    }

    /* Tabs: drop the outer capsule and wrap as centred pills */
    .cafeex-menu-tabs-wrapper {
        margin-bottom: 28px;
    }

    .cafeex-menu-tabs {
        display: flex;
        gap: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .cafeex-menu-wrapper .cafeex-menu-tab {
        padding: 10px 18px;
        font-size: 0.95rem;
        border: 1px solid var(--cfx-line);
    }

    .cafeex-menu-wrapper .cafeex-menu-tab.active {
        border-color: var(--cfx-accent);
    }

    /* Cards switch to photo-on-top */
    .cafeex-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cafeex-menu-wrapper .cafeex-menu-item-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background: var(--cfx-card);
    }

    .cafeex-menu-wrapper .cafeex-menu-item-card::before {
        display: none;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-img {
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 0;
    }

    .cafeex-menu-item-content {
        padding: 12px 12px 14px;
        text-align: center;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-title {
        font-size: 1.05rem;
        padding-bottom: 0;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-title::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .cafeex-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Phones ---------- */
@media (max-width: 480px) {
    .cafeex-menu-wrapper {
        --cfx-gap: 12px;
        --cfx-radius: 12px;
    }

    .cafeex-menu-header {
        margin-bottom: 20px;
    }

    .cafeex-menu-wrapper .cafeex-menu-subtitle {
        font-size: 0.8rem;
    }

    .cafeex-menu-tabs {
        gap: 6px;
    }

    .cafeex-menu-wrapper .cafeex-menu-tab {
        padding: 8px 14px;
        font-size: 0.875rem;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-img {
        aspect-ratio: 1 / 1;
    }

    .cafeex-menu-item-content {
        padding: 10px 10px 12px;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-title {
        font-size: 1rem;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-desc {
        font-size: 0.8rem;
    }

    .cafeex-menu-wrapper .cafeex-menu-item-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cafeex-menu-wrapper .cafeex-menu-item-card,
    .cafeex-menu-wrapper .cafeex-menu-item-img img,
    .cafeex-menu-wrapper .cafeex-menu-tab,
    .cafeex-menu-wrapper .cafeex-menu-item-title::after {
        animation: none;
        transition: none;
    }
}
