@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@700&display=swap');

header{
    display: flex;
    height: 13vh;
    justify-content: space-between;
    margin-left: 2%;
    margin-right: 2%;
    align-items: center;
}
.logoprincipal{
    width: 15%;
    height: fit-content;
    cursor: pointer;
}
h2{
    margin-left: 2%;
}
/* Left buttons container: fixed width so header doesn't reflow on hover */
.left-buttons{
    /* Use the same expanded width as install so logo remains centered */
    --btn-expanded: 240px; /* adjustable: expanded width for buttons */
    display: flex;
    gap: 10px;
    align-items: center;
    width: var(--btn-expanded);
    position: relative;
    overflow: visible; /* allow children to visually expand without reflowing header */
}

/* base icon button - collapsed state */
.icon-btn{
    --btn-collapsed: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* center icon when closed */
    height: 56px;
    width: var(--btn-collapsed); /* square collapsed */
    padding: 0;
    border-radius: 10px;
    border: 1px solid white;
    background: transparent;
    color: white;
    font-family: 'Inter', Courier, monospace;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden; /* hide text when closed */
    position: relative;
    transition: width 280ms ease, background-color 200ms ease, color 200ms ease;
    box-sizing: border-box; /* ensure padding doesn't change visual center */
}

.icon-btn{
    position: relative; /* needed so .btn-text can be absolute and not take layout space */
}

/* place the icon absolutely so it's perfectly centered in the closed square */
.icon-btn i{
    font-size: 22px;
    line-height: 1;
    margin: 0;
    display: inline-block;
    color: white; /* icon white when not hovered */
}

/* fallback for inline SVG icons used when icon font doesn't load */
.icon-btn svg{
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor; /* inherit color from button */
}

/* image-based icon fallback / explicit icon file */
.icon-btn .icon-img{
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    /* Make PNG icon appear white by default using filter; on hover we remove filter */
    filter: invert(1) brightness(2);
    transition: filter 160ms ease, opacity 160ms ease;
}

/* When button is hovered (background becomes white and text black), show icon in black */
.icon-btn:hover .icon-img{
    filter: none; /* original PNG color (assumed dark) shows through */
}

.icon-btn .btn-text{
    display: inline-block;
    margin-left: 0; /* no left margin when collapsed so icon stays centered */
    white-space: nowrap;
    overflow: hidden;
    max-width: 0; /* collapsed */
    opacity: 0;
    transform: translateX(-6px);
    transition: max-width 280ms ease, opacity 200ms ease, transform 200ms ease, margin-left 200ms ease;
    color: inherit;
}

/* Hover/expanded state */
/* expand visually on hover but do not affect layout because .left-buttons has fixed width */
.icon-btn:hover{
    width: var(--btn-expanded); /* expanded width */
    background: white;
    color: black;
    z-index: 40; /* float above surrounding elements */
    justify-content: center; /* center icon + text as a group */
}


.icon-btn:hover .btn-text{
    max-width: calc(var(--btn-expanded) - var(--btn-collapsed) - 24px); /* available space for text */
    opacity: 1;
    transform: translateX(0);
    margin-left: 12px; /* add spacing when visible */
}

.icon-btn:hover i{ color: inherit; }
/* ensure icon visible when closed */
.icon-btn i{ margin-right: 0; }

/* Specific behavior: when hovering the primary (catalog/home), hide the secondary (install)
   Only trigger when primary is immediately before secondary in DOM */
/* install button on the right: always open — fixed size, white background, no expand animation */
.install-open{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    width: var(--btn-expanded); /* same as expanded width of left buttons */
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: white;
    color: black;
    font-family: 'Inter', Courier, monospace;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    transition: box-shadow 160ms ease;
}

.install-open i{ color: black; font-size: 22px; margin-right: 8px; }
.install-open .btn-text{ opacity: 1; transform: none; }
.install-open:hover{ box-shadow: 0 6px 18px rgba(0,0,0,0.12); }

/* Disabled state for install button: non-interactive but visible */
.install-open[disabled]{
    pointer-events: none;
    opacity: 0.95;
    cursor: default;
    box-shadow: none;
}

/* Ensure header elements keep spacing */
header{ gap: 12px; }
