/* VelveTronic Delivery — menu chooser popup + off-canvas menu sidebar.
   Both surfaces are toggled by assets/menus.js through the [hidden] attribute
   plus an .is-open class (which drives the transitions).

   Every colour goes through a custom property on :root, so a site can restyle
   the whole thing from the theme (Appearance → Customise → Additional CSS)
   without editing the plugin:

       :root { --vtd-accent: #b99a4a; --vtd-radius: 0; }
*/

:root {
    --vtd-accent: #111827;
    --vtd-accent-contrast: #ffffff;
    --vtd-surface: #ffffff;
    --vtd-text: #111827;
    --vtd-muted: #6b7280;
    --vtd-border: #e5e7eb;
    --vtd-radius: 14px;
    --vtd-overlay: rgba(0, 0, 0, 0.55);
    --vtd-sidebar-width: 340px;
}

.vtd-menus,
.vtd-menus *,
.vtd-sidebar,
.vtd-sidebar * {
    box-sizing: border-box;
}

body.vtd-menus-lock {
    overflow: hidden;
}

/* ---------------------------------------------------------------- chooser  */

.vtd-menus {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--vtd-overlay);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vtd-menus.is-open {
    opacity: 1;
}

.vtd-menus[hidden] {
    display: none;
}

.vtd-menus-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 44px 24px 24px;
    background: var(--vtd-surface);
    color: var(--vtd-text);
    border-radius: var(--vtd-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

.vtd-menus.is-open .vtd-menus-dialog {
    transform: none;
}

.vtd-menus-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--vtd-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.vtd-menus-close:hover {
    background: var(--vtd-border);
    color: var(--vtd-text);
}

.vtd-menus-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--vtd-text);
}

.vtd-menus-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--vtd-muted);
}

.vtd-menus-list {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

/* A lone item should not sit in a half-width column. */
.vtd-menus-item:only-child {
    grid-column: 1 / -1;
}

.vtd-menus-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    border: 2px solid var(--vtd-border);
    border-radius: calc(var(--vtd-radius) - 4px);
    background: var(--vtd-surface);
    color: var(--vtd-text);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.vtd-menus-item:hover,
.vtd-menus-item:focus-visible {
    border-color: var(--vtd-accent);
    transform: translateY(-2px);
    color: var(--vtd-text);
}

.vtd-menus-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--vtd-accent);
    color: var(--vtd-accent-contrast);
}

.vtd-menus-item-icon svg {
    width: 26px;
    height: 26px;
}

.vtd-menus-item-text {
    display: block;
}

.vtd-menus-item-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.vtd-menus-item-desc {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--vtd-muted);
}

/* Style variants ---------------------------------------------------------- */

.vtd-menus--sharp .vtd-menus-dialog,
.vtd-menus--sharp .vtd-menus-item {
    border-radius: 0;
}

.vtd-menus--sharp .vtd-menus-item-icon {
    border-radius: 0;
}

/* Compact: one row per item, no icon circle, descriptions hidden. */
.vtd-menus--compact .vtd-menus-list {
    grid-template-columns: 1fr;
    gap: 8px;
}

.vtd-menus--compact .vtd-menus-item {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-align: left;
}

.vtd-menus--compact .vtd-menus-item-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
}

.vtd-menus--compact .vtd-menus-item-icon svg {
    width: 18px;
    height: 18px;
}

.vtd-menus--compact .vtd-menus-item-desc {
    display: none;
}

/* The shortcode trigger, when a page builder button is not being used. */
.vtd-menu-button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: calc(var(--vtd-radius) - 6px);
    background: var(--vtd-accent);
    color: var(--vtd-accent-contrast);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

/* ---------------------------------------------------------------- sidebar  */

.vtd-sidebar-bar {
    margin: 0 0 24px;
}

.vtd-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border: none;
    background: var(--vtd-accent);
    color: var(--vtd-accent-contrast);
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.vtd-sidebar-bar--bar .vtd-sidebar-toggle {
    width: 100%;
}

.vtd-sidebar-toggle-icon {
    display: inline-flex;
}

.vtd-sidebar-toggle-icon svg {
    width: 20px;
    height: 20px;
}

.vtd-sidebar {
    position: fixed;
    inset: 0;
    z-index: 999998;
}

.vtd-sidebar[hidden] {
    display: none;
}

.vtd-sidebar-overlay {
    position: absolute;
    inset: 0;
    background: var(--vtd-overlay);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.vtd-sidebar.is-open .vtd-sidebar-overlay {
    opacity: 1;
}

.vtd-sidebar-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(var(--vtd-sidebar-width), 88vw);
    padding: 56px 28px 32px;
    overflow-y: auto;
    background: var(--vtd-surface);
    color: var(--vtd-text);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.vtd-sidebar--left .vtd-sidebar-panel {
    left: 0;
    transform: translateX(-100%);
}

.vtd-sidebar--right .vtd-sidebar-panel {
    right: 0;
    transform: translateX(100%);
}

.vtd-sidebar.is-open .vtd-sidebar-panel {
    transform: none;
}

.vtd-sidebar-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--vtd-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.vtd-sidebar-close:hover {
    color: var(--vtd-text);
}

.vtd-sidebar-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--vtd-accent);
}

/* The nav menu inside the panel.
   These rules fight the THEME, not the browser: the markup is a normal WP nav
   menu, so the active theme's own `li`/`a`/`.sub-menu` rules apply to it, and
   most themes lay a nav menu out horizontally (flex/inline-block/float) with
   sub-menus as absolutely-positioned hover dropdowns. Inside a vertical
   off-canvas panel every one of those is wrong, so the structural properties
   below are forced. `!important` is confined to those layout properties and
   scoped under .vtd-sidebar — colours, spacing and type stay overridable so a
   site can still restyle the panel. */

.vtd-sidebar .vtd-sidebar-menu,
.vtd-sidebar .vtd-sidebar-menu ul {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    list-style: none;
    background: none;
    box-shadow: none;
    text-align: left;
    /* A theme flex row would otherwise survive display:block on the children. */
    flex-direction: column;
    /* Hover-dropdown themes hide sub-menus until :hover — always show them here. */
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

.vtd-sidebar .vtd-sidebar-menu li {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.vtd-sidebar .vtd-sidebar-menu a {
    display: block !important;
    float: none !important;
    width: auto !important;
    padding: 11px 0;
    border-bottom: 1px solid var(--vtd-border);
    color: var(--vtd-text);
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
}

.vtd-sidebar .vtd-sidebar-menu a:hover,
.vtd-sidebar .vtd-sidebar-menu a:focus-visible,
.vtd-sidebar .vtd-sidebar-menu .current-menu-item > a {
    color: var(--vtd-accent);
}

/* Sub-items read as a nested list, not a second top level. */
.vtd-sidebar .vtd-sidebar-menu ul a {
    padding-left: 16px;
    font-size: 14px;
    color: var(--vtd-muted);
}

/* Some themes inject a caret/toggle button next to parent items; it has no
   dropdown to control in here. */
.vtd-sidebar .vtd-sidebar-menu .sub-menu-toggle,
.vtd-sidebar .vtd-sidebar-menu .menu-item-has-children > a::after {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .vtd-menus,
    .vtd-menus-dialog,
    .vtd-sidebar-overlay,
    .vtd-sidebar-panel {
        transition: none;
    }
}
