/**
 * FQPedidos — Layout (Sprint UX-1)
 */

.fq-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: var(--fq-header-bg);
    border-bottom: 2px solid var(--color-primary-dark);
}

.fq-header__inner {
    max-width: var(--fq-max-width);
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem 1.5rem;
    min-height: var(--fq-header-height);
}

.fq-header__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fq-header-text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.fq-header__brand:hover {
    color: var(--fq-header-text);
}

.fq-header__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: var(--fq-radius);
    flex-shrink: 0;
}

.fq-header__search {
    min-width: 0;
    width: 100%;
    max-width: none;
    justify-self: stretch;
}

.fq-header__actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.fq-header__my-order {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.fq-header__my-order:hover {
    text-decoration: underline;
}

.fq-header__cart {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--fq-header-text);
    user-select: none;
}

.fq-header__cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--fq-header-text);
}

.fq-header__cart-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.fq-header__cart-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    line-height: 1.2;
}

.fq-header__cart-items {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fq-header-text);
    white-space: nowrap;
}

.fq-header__cart-total {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fq-header-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.fq-main {
    max-width: var(--fq-max-width);
    margin: 0 auto;
    padding: 0.75rem 1.25rem 2rem;
    width: 100%;
}

.fq-footer {
    display: none;
}

@media (max-width: 767px) {
    :root {
        /*
         * Cabecera sticky en 2 filas (marca/carrito + buscador).
         * ~0.5rem + fila1 + 0.625rem + 50px búsqueda + 0.5rem + borde ≈ 7.5rem.
         */
        --fq-categories-sticky-top: 7.5rem;
    }

    .fq-header__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        padding: 0.5rem 0.875rem;
        gap: 0.625rem;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .fq-header__brand {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.9375rem;
        min-width: 0;
        overflow: hidden;
    }

    .fq-header__brand span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fq-header__logo {
        width: 52px;
        height: 52px;
    }

    .fq-header__actions {
        grid-column: 2;
        grid-row: 1;
        gap: 0.5rem;
        max-width: 100%;
        min-width: 0;
    }

    .fq-header__search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .fq-header__cart-info {
        gap: 0;
    }

    .fq-header__cart-items {
        font-size: 0.6875rem;
    }

    .fq-header__cart-total {
        font-size: 0.75rem;
    }

    .fq-header__actions .btn-login {
        min-height: 38px;
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .fq-header__my-order {
        font-size: 0.75rem;
    }

    .fq-main {
        padding: 0.625rem 0.875rem 1.75rem;
    }
}

@media (max-width: 390px) {
    .fq-header__brand span {
        display: none;
    }

    .fq-header__actions {
        gap: 0.375rem;
    }
}

@media (max-width: 360px) {
    .fq-header__cart-info {
        display: none;
    }
}

@media (min-width: 768px) {
    .fq-header__inner {
        padding: 0.625rem 2rem;
        gap: 1.25rem 2rem;
    }

    .fq-main {
        padding: 0.875rem 2rem 2.5rem;
    }
}

@media (min-width: 1200px) {
    .fq-header__inner {
        padding: 0.625rem 2.5rem;
        gap: 1.5rem 2.5rem;
    }

    .fq-main {
        padding: 1rem 2.5rem 3rem;
    }
}
