/* =========================================================
   VerticalCatMenu - front office styles
   ========================================================= */
:root {
    --vhm-width: 340px;
    --vhm-bg: #ffffff;
    --vhm-text: #2b2b2b;
    --vhm-accent: #ff6600;
    --vhm-border: #ececec;
    --vhm-overlay: rgba(0, 0, 0, .45);
    --vhm-highlight-bg: #fff4ea;
    --vhm-chevron-color: #999999;
}

#vhm-wrapper {
    display: inline-block;
    position: relative;
}

/* --- Toggle button (placed next to the shop logo) --- */
.vhm-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--vhm-border);
    border-radius: 4px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--vhm-text);
    line-height: 1;
}

.vhm-toggle-btn:hover {
    border-color: var(--vhm-accent);
    color: var(--vhm-accent);
}

.vhm-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 13px;
}

.vhm-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
}

/* --- Overlay --- */
#vhm-overlay {
    position: fixed;
    inset: 0;
    background: var(--vhm-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 1040;
}

#vhm-overlay.vhm-open {
    opacity: 1;
    visibility: visible;
}

/* --- Off canvas panel --- */
#vhm-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--vhm-width);
    max-width: 90vw;
    background: var(--vhm-bg);
    color: var(--vhm-text);
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 1050;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .15);
    display: flex;
    flex-direction: column;
}

#vhm-panel.vhm-open {
    transform: translateX(0);
}

/* The body is the ONLY scroll container: when an item is expanded, its
   children push the rest of the list down and the whole panel scrolls
   to reveal them (no separate sliding sub-panels). */
.vhm-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body.vhm-noscroll {
    overflow: hidden;
}

/* --- Lists (all levels) --- */
.vhm-level {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vhm-item {
    position: relative;
    border-bottom: 1px solid var(--vhm-border);
}

.vhm-header-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #fafafa;
    border-bottom: 2px solid var(--vhm-border);
}

.vhm-panel-title {
    font-weight: 700;
    font-size: 16px;
}

.vhm-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--vhm-text);
}

.vhm-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    color: var(--vhm-text);
    text-decoration: none;
    font-size: 14px;
}

.vhm-level-1 > .vhm-item > .vhm-link {
    font-weight: 600;
}

.vhm-item.vhm-highlight > .vhm-link {
    background: var(--vhm-highlight-bg);
    color: var(--vhm-accent);
    font-weight: 700;
}

.vhm-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 auto;
}

.vhm-icon-placeholder {
    width: 22px;
    height: 22px;
}

/* --- Heading (no link) --- */
.vhm-heading-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 8px;
    background: #fbfbfb;
}

.vhm-heading-item .vhm-label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #8a8a8a;
}

/* --- Accordion toggle: the item's own label expands/collapses its
   children. The chevron is purely visual (it lives inside the same
   clickable label, it is not a separate button) and just indicates
   that the item has subcategories. --- */
.vhm-accordion-toggle {
    cursor: pointer;
    user-select: none;
}

.vhm-accordion-toggle:hover {
    background: #f6f6f6;
}

.vhm-item.vhm-accordion-open > .vhm-accordion-toggle {
    background: #f2f2f2;
}

.vhm-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--vhm-chevron-color);
    border-bottom: 2px solid var(--vhm-chevron-color);
    transform: rotate(-45deg);
    transition: transform .2s ease;
    margin-left: auto;
    flex: 0 0 auto;
}

.vhm-item.vhm-accordion-open > .vhm-accordion-toggle > .vhm-chevron {
    transform: rotate(45deg);
}

/* --- Offer CTA badge (shown to the right of an item's label) --- */
.vhm-offer-badge {
    margin-left: auto;
    flex: 0 0 auto;
    background: var(--vhm-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

/* An item with children already has the chevron pulling to the right via
   margin-left:auto; when an offer badge is also present, the badge takes
   that spot instead and the chevron sits right after it. */
.vhm-has-children .vhm-offer-badge {
    margin-left: auto;
}

.vhm-has-children .vhm-offer-badge + .vhm-chevron {
    margin-left: 8px;
}

/* --- Per-device visibility (set per item in the back office) --- */
@media (min-width: 768px) {
    .vhm-hide-desktop {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .vhm-hide-mobile {
        display: none !important;
    }
}

/* --- Desktop/mobile text swap (button label + panel title) --- */
.vhm-label-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .vhm-label-desktop {
        display: none;
    }
    .vhm-label-mobile {
        display: inline;
    }
}

/* --- Best-effort: hide the theme's own default mobile menu trigger so
   this module's menu becomes the only mobile navigation. Covers the most
   common selectors used by the PrestaShop Classic theme; custom themes
   may need their own selector added here. Controlled by the "Ajustes"
   setting "Ocultar menú principal en móvil". --- */
@media (max-width: 767.98px) {
    html.vhm-hide-theme-mobile-menu #menu-icon,
    html.vhm-hide-theme-mobile-menu .menu-icon,
    html.vhm-hide-theme-mobile-menu #_mobile_menu_,
    html.vhm-hide-theme-mobile-menu ._mobile_menu_,
    html.vhm-hide-theme-mobile-menu .js-mobile-menu,
    html.vhm-hide-theme-mobile-menu #mobile_top_menu_wrapper,
    html.vhm-hide-theme-mobile-menu .mobile-menu-icon {
        display: none !important;
    }
}

/* --- Accordion body (used at every level) --- */
.vhm-submenu-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: #fafafa;
}

.vhm-item.vhm-accordion-open > .vhm-submenu-accordion {
    /* Large enough to always fit the content; the outer panel scrolls. */
    max-height: 3000px;
}

.vhm-view-all {
    display: block;
    padding: 10px 18px;
    color: var(--vhm-accent);
    font-weight: 600;
    text-decoration: underline;
    font-size: 12px;
}

.vhm-level-2 .vhm-link {
    padding-left: 30px;
    font-size: 14px;
}

.vhm-level-3 .vhm-link {
    padding-left: 46px;
    font-size: 13px;
    color: #555;
}

.vhm-level-2 .vhm-heading-item,
.vhm-level-3 .vhm-heading-item {
    padding-left: 30px;
}

/* --- Panel header logo (alternative to the text title) --- */
.vhm-panel-logo {
    max-height: 32px;
    max-width: 70%;
    object-fit: contain;
}

/* --- Separator (plain line) --- */
.vhm-separator-line {
    border-bottom: none !important;
    padding: 10px 18px;
}

.vhm-hr {
    border: none;
    border-top: 1px solid var(--vhm-border);
    margin: 0;
}

/* --- Separator (custom image) --- */
.vhm-separator-image {
    border-bottom: none !important;
    padding: 6px 18px;
    text-align: center;
}

.vhm-separator-image img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* --- Blank space --- */
.vhm-spacer {
    border-bottom: none !important;
    padding: 0;
}

/* --- Full width banner image --- */
.vhm-image-full {
    border-bottom: none !important;
    padding: 8px 18px;
}

.vhm-image-full img,
.vhm-image-full a {
    display: block;
    width: 100%;
}

.vhm-image-full img {
    height: auto;
    border-radius: 6px;
}

/* --- Two images side by side (stacks to 1 column on mobile) --- */
.vhm-image-2col {
    border-bottom: none !important;
    padding: 8px 18px;
}

.vhm-image-2col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.vhm-image-2col-cell a,
.vhm-image-2col-cell img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

@media (max-width: 480px) {
    .vhm-image-2col-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Full width button --- */
.vhm-button-full {
    border-bottom: none !important;
    padding: 8px 18px;
}

.vhm-full-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 13px 16px;
    border-radius: 8px;
    background: var(--vhm-accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

@media (max-width: 480px) {
    :root {
        --vhm-width: 100vw;
    }

    /* Compact button on mobile: icon + short label, sits inline next to
       the logo instead of wrapping onto its own row. Exact placement
       still depends on the theme's own header layout. */
    #vhm-wrapper {
        vertical-align: middle;
    }

    .vhm-toggle-btn {
        padding: 8px 10px;
        gap: 6px;
        font-size: 12px;
    }
}
