/* ── Main Container ───────────────────────────────────── */

#fab-interni-navmenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999999;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

#fab-interni-navmenu *,
#fab-interni-navmenu *::before,
#fab-interni-navmenu *::after {
    box-sizing: border-box;
}

.fin-spacer {
    display: block;
}

/* Hide on mobile / tablet */
@media (max-width: 1024px) {
    #fab-interni-navmenu {
        display: none !important;
    }
    .fin-spacer {
        display: none !important;
    }
}

/* ── Rows ─────────────────────────────────────────────── */

.fin-row {
    width: 100%;
}

.fin-row-1 {
    height: 70px;
}

.fin-row-2 {
    height: 28px;
}

.fin-row-3 {
    height: 45px;
}

/* ── Container ────────────────────────────────────────── */

.fin-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 30px;
}

/* ── Row 1: Logo Row ──────────────────────────────────── */

.fin-row-1 .fin-container {
    max-width: none;
    padding: 0 35px;
    justify-content: space-between;
}

.fin-left-shortcode,
.fin-right-shortcode {
    flex: 1;
    display: flex;
    align-items: center;
}

.fin-right-shortcode {
    justify-content: flex-end;
}

/* FiboSearch in nav — minimal icon style */
.fin-left-shortcode {
    justify-content: flex-start;
}

/* Keep wrapper tight around the icon, flush left */
html:not(.dgwt-wcas-overlay-mobile-on) .fab-nav-search.dgwt-wcas-layout-icon {
    max-width: 20px;
    position: relative;
    margin: 0;
}

/* Open search form to the right of the icon */
html:not(.dgwt-wcas-overlay-mobile-on) .fab-nav-search.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
    top: 50% !important;
    left: calc(100% + 12px) !important;
    transform: translateY(-50%);
    min-width: 400px;
}

/* Hide the arrow indicator */
.fab-nav-search .dgwt-wcas-search-icon-arrow {
    display: none !important;
}

.fin-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fin-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.fin-logo-img {
    max-height: 55px;
    width: auto;
    display: block;
}

/* ── Row 2: Secondary Nav ─────────────────────────────── */

.fin-row2-links {
    justify-content: center;
    gap: 0;
}

.fin-row2-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.fin-row2-link:hover {
    opacity: 0.7;
}

.fin-separator {
    margin: 0 12px;
    opacity: 0.4;
    user-select: none;
}

/* ── Row 3: Main Nav ──────────────────────────────────── */

.fin-row3-links {
    justify-content: center;
    gap: 0;
}

.fin-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.fin-row3-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 100%;
}

.fin-row3-link:hover {
    opacity: 0.7;
}

/* Underline indicator for items with submenu */
.fin-underline-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fin-nav-item:hover .fin-underline-indicator {
    opacity: 1;
}

/* ── Submenu ──────────────────────────────────────────── */

.fin-submenu {
    position: fixed;
    top: 143px;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 30px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.admin-bar .fin-submenu {
    top: 175px;
}

.fin-nav-item:hover > .fin-submenu {
    opacity: 1;
    visibility: visible;
}

.fin-submenu-inner {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
}

/* ── Submenu Columns ──────────────────────────────────── */

.fin-submenu-col {
    flex: 1;
    min-width: 0;
}

.fin-submenu-links {
    display: flex;
    flex-direction: column;
}

.fin-submenu-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.fin-submenu-link:hover {
    opacity: 0.6;
}

/* ── Product Cards ────────────────────────────────────── */

.fin-submenu-product {
    display: flex;
    flex-direction: column;
}

.fin-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.fin-product-card:hover {
    opacity: 0.8;
}

.fin-product-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.fin-product-title {
    margin-bottom: 4px;
    color: #333;
}

.fin-product-price {
    color: #666;
}

.fin-empty-col {
    visibility: hidden;
}

/* ── Sub-submenu (nested floating) ───────────────────── */

.fin-submenu-item-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: fit-content;
}

.fin-submenu-chevron {
    margin-left: 4px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.fin-submenu-item-wrap:hover .fin-submenu-chevron {
    opacity: 1;
}

.fin-sub-submenu {
    position: absolute;
    left: calc(100% + 4px);
    top: -8px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 14px 18px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 101;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.fin-submenu-item-wrap:hover > .fin-sub-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.fin-sub-submenu-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    color: inherit;
    font-size: 0.9em;
}

.fin-sub-submenu-link:hover {
    opacity: 0.6;
}

/* Auto-flip when near right edge */
.fin-sub-submenu.fin-flip-left {
    left: auto;
    right: calc(100% + 4px);
}

/* ── WordPress admin bar offset ───────────────────────── */

.admin-bar #fab-interni-navmenu {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar #fab-interni-navmenu {
        top: 46px;
    }
}
